2

(I am fairly new to web services, kindly excuse any incorrect terminology)

Given a WSDL URL, how does one determine what methods are available in that web service by looking at the source of the WSDL file?

Also, how does one construct a SOAP response to use with the WSDL file to post data back to the web service?

John Saunders
  • 160,644
  • 26
  • 247
  • 397
KM.
  • 1,382
  • 1
  • 19
  • 34
  • What platform are you using? C#? Java? PHP? And what versions? The platforms usually take care of this for you. – John Saunders Sep 23 '11 at 19:56
  • By far the easiest way of doing this is to pass the WSDL to your tools and then inspect the generated output in your IDE. – Flexo Sep 23 '11 at 19:57
  • Thanks @John Saunders. The web service is written in Java. JVM version is 1.5.0_14. When you say platforms, what do you mean? – KM. Sep 23 '11 at 19:59
  • Thanks @awoodland I have Eclipse, what do I look for? – KM. Sep 23 '11 at 20:08
  • I've used [wsdl2java](https://ws.apache.org/axis/java/user-guide.html#WSDL2JavaBuildingStubsSkeletonsAndDataTypesFromWSDL) in the past. I *think* there's a nice way to integrate it into eclipse, but I'm not sure on that one. – Flexo Sep 23 '11 at 20:11
  • Mm ... I looked at: http://axis.apache.org/axis2/java/core/tools/eclipse/wsdl2java-plugin.html and it refers to generate java class file from the wsdl. Is that what I want? A class file ... ? I tried installing it, but I don't see it in the wizard window. – KM. Sep 23 '11 at 20:40

3 Answers3

2

I think what you ask is how to interpret a wsdl. Following articles[1][2] may help you.

[1] http://wso2.org/library/2873

[2] http://wso2.org/library/2935

Amila Suriarachchi
  • 1,228
  • 7
  • 5
  • 1
    Thank you all. While the other responses increased my knowledge and understanding of WSDL files and web services, this is what I was ultimately after. – KM. Sep 30 '11 at 19:00
2

Unlike the others, I'm not going to go into details about the WSDL file and how you can read it. You will eventually learn all of that by yourself by reading books, articles, experimenting with web services etc.

What I'm going to do is recommend you a very simple to use, yet powerful tool, than must be in the toolbox of every web service developer (especially someone new to web services): SoapUI.

You create a simple project in SoapUI and point it to the WSDL file of the web service. It will discover the operations, create sample request and response messages, create mocks of the web service and much more.

You can then look at the WSDL code and with the help of what's presented inside SoapUI discover which elements are involved in each method.

1

Just open this url to WSDL (looks like http://host:port/ddfdgfgd?wsdl) in your browser or download it to file. Find all WSDL sections portType (portType is similar Java interface). All WSDL port types contains operations linked to input/output messages. These messages linked with XSD elements or types (it depends SOAP encoding type).

Also you can import WSDL with Java with wsimport command line tool and implement client or server side.

abdolence
  • 2,369
  • 1
  • 21
  • 29