WSDL

WSDL is an XML document describing a Web service and how to access it. (Web Services Description Language)

A WSDL document describes a web service using these major tags:
<types> The data types used by the web service
Defines the data tags of an operation. WSDL uses XML Schema syntax to define data types.

<message>  The messages used by the web service
Each message can consist of one or more parts. The parts can be compared to the parameters of a function call in a traditional programming language.

<portType>
Each port Lists the operations performed by the web service: Port defines the connection point to a web service, like a function library or class in a programming language.
1. It describes a web service,
2. the operations that can be performed,
3. and the messages that are involved.

The <portType> element can be compared to a function library (or a module, or a class) in a traditional programming language.

<operation> Like a function
Operation Types:
1. One-way: without output
2. Request-Response: input-output
3.
<binding> Defines the message format and protocol details for each port. Low level definition of a portType
Attributes:
name: any name
type: port name


WSDL structure:

<definitions>

<types>
  definition of types........
</types>

<message name="messageName1">
  definition of a message....
</message>

<portType>
<operation>
<input message="messageName1"/>
<output message="messageName2"/>
<operation/>
</portType>

<binding name="some_name" type="portType_name">
<soap:binding style="rpc|document" transport="transport_protocol_type_uri" />
<operation>
<soap:operation soapAction="uri_of_web_service"/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>

</definitions>

It can also contain other tags, like extension tags, and a service tag that makes it possible to group together the definitions of several web services in one single WSDL document.

Portion of a WSDL
 <message name="getTermRequest"> //signatures of functions
  <part name="term" type="xs:string"/> //associated data type list
</message>

<message name="getTermResponse"> //Output could be a complex data structure
  <part name="value" type="xs:string"/>
</message>

<portType name="glossaryTerms">  //web service
  <operation name="getTerm">  //operations
    <input message="getTermRequest"/> //input message (signatures of functions)
    <output message="getTermResponse"/> //output message
  </operation>
</portType>

<binding type="glossaryTerms" name="b1">
   <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /> //uri of the data transport protocol identifier
   <operation>//same structure as in the mentioned portType
     <soap:operation soapAction="http://example.com/getTerm"/> //uri of the web service (could be servlet, php, jsp, etc.)
     <input>
            <soap:body use="literal"/>
     </input>
     <output>
            <soap:body use="literal"/> // input/output encoding (e.g. literal)
     </output>
  </operation>
</binding>

// Compared to traditional programming, glossaryTerms is a function library, "getTerm" is a function with "getTermRequest" as the input parameter, and getTermResponse as the return parameter.

one-way operation
<message name="newTermValues"> //signature, contains parameter list
  <part name="term" type="xs:string"/>
  <part name="value" type="xs:string"/>
</message>

<portType name="glossaryTerms">
  <operation name="setTerm">
    <input name="newTerm" message="newTermValues"/>
  </operation>
</portType >







Comments