UNIT -4
WSDL
- Used to describe web services and written in XML.
- W3C recommendation.
WSDL Documents
Document describes web service.
Specifies location and method of service using major elements.
WSDL primarily consists of the following elements:
Element | Description |
<types> | Defines XML Schema data types used by web service |
<message> | Defines the data elements for each operation |
<port type> | Describes the operations that can be performed and the messages involved. |
<binding> | Defines the protocol and data format for each port type |
When a client wants to make use of a Web service
It first loads the WSDL file and uses the information contained in it to format a SOAP request.
The WSDL and WSML are both generated by the wsdlgen utility.
The main structure of a WSDL document looks like this:
<definitions>
<types>
data type definitions........
</types>
<message>
definition of the data being communicated....
</message>
<portType>
set of operations......
</portType>
<binding>
protocol and data format specification....
</binding>
</definitions>
Example:
This is a simplified fraction of a WSDL document:
<message name="getTermRequest">
<part name="term" type="xs:string"/>
</message>
<message name="getTermResponse">
<part name="value" type="xs:string"/>
</message>
<portType name="glossaryTerms">
<operation name="getTerm">
<input message="getTermRequest"/>
<output message="getTermResponse"/>
</operation>
</portType>
Here the <portType> element defines "glossaryTerms" as the name of a port, and "getTerm" as the name of an operation.
The "getTerm" operation has an input message called "getTermRequest" and an output message called "getTermResponse".
The <message> elements define the parts of each message and the associated data types.