I’m trying to develop a form generator in java, in which users will be able to write a wsdl url and get the list of the operations supported by the web service in a ComboBox. When the user selects one of the items in ComboBox then he will see form fields generated using the wsdl url.
I’m a newbie in web service technologies, after searching about web service parsers on the net I decided to use axis library. But I really do not know which part of the wsdl document should I parse
I’m not trying to create java classes of the web service, I have to generate form fields for any wsdl url.
For instance here is a web service which provides 9 operations
http://services.aonaware.com/DictService/DictService.asmx
and the wsdl file is here:
http://services.aonaware.com/DictService/DictService.asmx?WSDL
I need to know which parts of wsdl file should be parsed, any help would be appreciated.
To get started with WSDL and understand how such a document is structured, you should maybe have a look at some article like Understanding WSDL or the WSDL Tutorial or any other beginner resource that you’ll find on Google.
Now, to answer your question in a simplified way, you’ll have to start with the
portTypeelement that contains:For example, in your case:
And, for each operation, you’ll need to parse the input and output messages, a
messagebeing:Here, for example the input message of the previous operation is:
Then, to understand the content of the message, have a look at the
types:Here, the
DictionaryListelement is defined as an empty compleType:As I said, this is really a very simplified answer as WSDL can’t be summarized in four paragraphs and, to be honest, what you are going to do is really not a trivial task. Let me rephrase this: there will be blood! So, even if these few lines may help you (a very little) to get started, I’d definitely not start such a project from scratch but rather use an existing library or tool (like Xydra or Eclipse XML Forms Generator or …) that would allow to not reinvent the wheel.
By the way, I noticed that you have decided to use Axis and that you don’t want to generate the Java classes but I’d warmly recommend to not use Axis anyway. Actually, I’d use JAX-WS RI wich is bundled in Java 6 and is a much easier API. Just in case, to generate the Java classes, just execute: