IBM Support

How to read WSDL. A bottom up approach

Question & Answer


Question

If I need to write a Web Services application based on a Web Services Description Language (WSDL) document, perhaps the two most important pieces of information I need to know about are the input and output parameters. Faced with a WSDL document for the first time can be a bit daunting. How can I easily locate the bits of information that you are interested in without having to understand all the other information present?

Answer

The best way is to work from the bottom up as demonstrated in the example below. This example is a fairly straightforward piece of WSDL, but however complex the principle is the same.

Perform the following steps using the piece of example WSDL below (a copy of this code is also provided in the PDF attachment):

1) Go to the service tag at the bottom and locate the binding, binding="s0:ChoosePlantBinding"

2) Working upwards go to the binding tag that has the matching name, ChoosePlantBinding and locate the portType type="s0:ChoosePlantPortType"

3) Working upwards go to the portType tag that has name ChoosePlantPortType and locate the operation required. In this example there is only one operation within the portType tags that you are concerned with. For that operation, ChoosePlant, you are given the name of each input and output message.

4) Working upwards go to the message tag that has the name of the input message, in this case ChoosePlantIn. Each part tag listed within the input message tags describes an input parameter. Similarly there is a message tag that has the name of the output message, ChoosePlantOut. Each part tag listed within the output message tags describes an output parameter. For each part tag locate element, for example element="s0:Plant" . Depending on the type of WSDL document used, you might see type appearing here instead of element.

5) Working upwards go to the element tag that has name "Plant" and locate its type, in this case type="s0:plant". In this example plant is defined to be a choice of four types of plants. So there will be one input parameter (and also one output parameter in this example) of type string with name annual, herb perennial or bulb.

Example WSDL:

alt text

View larger WSDL example in PDF

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSGMGV","label":"CICS Transaction Server"},"Platform":[{"code":"PF035","label":"z\/OS"}],"Component":"WSDL","Version":"","Line of Business":{"code":"LOB35","label":"Mainframe SW"}}]

Product Synonym

CICS/TS CICSTS CICS TS CICS Transaction Server

Document Information

Modified date:
07 May 2015

UID

dwa1178819