Web Services Description Language (WSDL) is a standard specification for describing networked, XML-based services. It provides a simple way for service providers to describe the basic format of requests to their systems regardless of the underlying runtime implementation. A WSDL specification contains the following parts:
The operations editor allows you to create and modify port types, messages, and types. These artifacts are part of the web service interface document.
| Component: | Contains: |
|---|---|
| Port type | Operation signature |
| Messages | Parameter definitions |
| Types | Complex type definitions |
| Bindings | Transport protocol and preload format |
When the Web service is implemented, it contains the following components derived from the WSDL document:
The description of the operations and their associated messages. PortTypes define abstract operations.
<portType name="EightBall">
<operation name="getAnswer">
<input message="ebs:IngetAnswerRequest"/>
<output message="ebs:OutgetAnswerResponse"/>
<operation/>
<portType>
The description of parameters (input and output) and return values.
<message name="IngetAnswerRequest">
<part name="meth1_inType" type="ebs:questionType"/>
</message>
<message name="OutgetAnswerResponse">
<part name="meth1_outType" type="ebs:answerType"/>
</message>
The schema for describing XML complex types used in the messages.
<types>
<xsd:schema targetNamespace="...">
<xsd:complexType name="questionType">
<xsd:element name="question" type="string"/>
</xsd:complexType>
<xsd:complexType name="answerType">
...
Bindings describe the protocol used to access a service, as well as the data formats for the messages defined by a particular portType.
<binding name="EightBallBinding" type="ebs:EightBall">
<soap:binding style="rpc" transport="schemas.xmlsoap.org/soap/http">
<operation name="ebs:getAnswer">
<soap:operation soapAction="urn:EightBall"/>
<input>
<soap:body namespace="urn:EightBall" ... />
...
Contains the Web service name and a list of the ports.
Contains the location of the Web service and the binding to used to access the service.
<service name="EightBall">
<port binding="ebs:EightBallBinding" name="EightBallPort">
<soap:address location="localhost:8080/axis/EightBall"/>
</port>
</service>
The abstract service interface provides operation definitions (functions) and the messages used.
The following example WSDL file shows the relationship between the messages, operation, and portType that comprise a service interface definition.
<?xml version="1.0" encoding="UTF-8"?>
<definitions name="StockQuote"
targetNamespace="http://example.com.wsdl/stockquote/"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="http://example.com.wsdl/stockquote/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<message name="getQuoteRequest">
<part name="ticker" type="xsd:string"/>
</message
<message name="getQuoteResponse">
<part name="result" type="xsd:float"/>
</message
<portType name="StockQuote">
<operation name="getQuote" parameterOrder="ticker">
<input message="tns:getQuoteRequest" name="getQuoteRequest"/>
<output message="tns:getQuoteResponse" name="getQuoteResponse"/>
</operation
</portType
</definitions>