“Java form generator” from the given WSDL file

I'm trying to develop a form generator in Java where users can write a WSDL URL and get it Combo@R_522_2419 @List of operations supported by web services in When the user selects Combo@R_522_2419 @He will see the form fields generated using the WSDL URL

I am a novice in Web service technology. After searching the web service parser on the Internet, I decided to use the axis library But I really don't know which part of the WSDL document I should parse

Instead of creating a Java class for a web service, I have to generate form fields for any WSDL URL

For example, this is a web service that provides nine operations

http://services.aonaware.com/DictService/DictService.asmx

And WSDL files are here:

http://services.aonaware.com/DictService/DictService.asmx?WSDL

I need to know which parts of the WSDL file should be parsed. Any help would be appreciated

Solution

To get started with WSDL and learn how to build such a document, you should check out articles such as understanding WSDL or WSDL tutorial or any other beginner resource you can find on Google

Now, to answer your question in a simplified way, you must start with the porttype element that contains the following:

For example, in your case:

<wsdl:operation name="DictionaryList">
  <wsdl:documentation>Returns a list of available dictionaries</wsdl:documentation>
  <wsdl:input message="tns:DictionaryListSoapIn"/>
  <wsdl:output message="tns:DictionaryListSoapOut"/>
</wsdl:operation>

And for each operation, you will need to parse the input and output messages, which are:

Here, for example, the input message of the previous operation is:

<wsdl:message name="DictionaryListSoapIn">
  <wsdl:part name="parameters" element="tns:DictionaryList"/>
</wsdl:message>

Then, to understand the content of the message, view the type:

Here, the dictionarylist element is defined as an empty completype:

<s:element name="DictionaryList">
  <s:complexType/>
</s:element>

As I said, this is actually a very simplified answer, because WSDL can't be summarized in four paragraphs, and to be honest, what you have to do is not actually a trivial task Let me say it again: there will be blood! So even if these lines can help you (rarely) start, I will never start such a project from scratch, but using existing libraries or tools (such as xydra or eclipse XML forms generator or...) will allow you not to reinvent the wheel

By the way, I noticed that you have decided to use axis and you don't want to generate Java classes, but I strongly recommend not using axis In fact, I use jax-ws RI bundled in Java 6, which is an easier API To generate a Java class just in case:

$mkdir generated
$wsimport -d generated http://services.aonaware.com/DictService/DictService.asmx?WSDL
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>