Introduction to WSDL:
Web Service Description Language is an XML document which describes the information about the web services like what are the operations it provide,where the service is located and what protocol it use to communicate.
WSDL has the following elements to describe web services.
Structure of a WSDL:
<Definition> // set of namespaces
<Types>.........</Types> // XML schema types
<Message> // set of parameters
<part>....</part> // single Parameter
.
.
</Message>
<PortType> // set of operations
<Operations>
<Input /> // input message type
<Output /> // output message type
<Fault /> // fault message type
</Operations>
</PortType>
<Binding>.........</Binding> // Communication protocol
<Service>.........</Service> // information of Bindings,ports and location.
</Definition>
There are the following types of operations possible between the Requester and Publisher.
One-way : The service only receive a message but can't send a response.
Example:
<portType name="xyz">
<operation name="singlewayOperation">
<Input name="MyInput" message="InputTypeMsg">
</operation>
Request-Response : The service receive a message and send a response.
Example:
<portType name="xyz">
<operation name="singlewayOperation">
<Input name="MyInput" message="InputTypeMsg">
<output name="MyOutput" message"OutputTypeMsg">
</operation>
Solicit-Response : The service send a request and wait for the response.
Example:
<portType name="xyz">
<operation name="singlewayOperation">
<output name="MyOutput" message"OutputTypeMsg">
<Input name="MyInput" message="InputTypeMsg">
</operation>
</portType>
Notification : The service send a message and will not wait for response.
Example:
<portType name="xyz">
<operation name="singlewayOperation">
<output name="MyOutput" message"OutputTypeMsg">
</operation>
Web Service Description Language is an XML document which describes the information about the web services like what are the operations it provide,where the service is located and what protocol it use to communicate.
WSDL has the following elements to describe web services.
- <
definitions >: It is root element of every WSDL document.It has the name of the web service and has all the namespaces used in the document.
- <
service >: It is having the URL,location information i.e where the web service actually reside.
- <
binding >: It having the information about what protocol the web service use to communicate like HTTP Get, HTTP Post, SOAP etc.
- <
portType >: It gives the information of the Type or structure of message passing through the applications and the operations that can be performed.
- <
message >: This element having the information of what are the parameters passed from or to the web service.Each message can consist of one or more element which describe exactly one parameter.
- <
types >: Through this element we can import data types from an external schema file.
- <
operation >: It bounds the message with input-output tags.
- <
part >: It describes one parameter in the element.
<Definition> // set of namespaces
<Types>.........</Types> // XML schema types
<Message> // set of parameters
<part>....</part> // single Parameter
.
.
</Message>
<PortType> // set of operations
<Operations>
<Input /> // input message type
<Output /> // output message type
<Fault /> // fault message type
</Operations>
</PortType>
<Binding>.........</Binding> // Communication protocol
<Service>.........</Service> // information of Bindings,ports and location.
</Definition>
One-way : The service only receive a message but can't send a response.
Example:
<portType name="xyz">
<operation name="singlewayOperation">
<Input name="MyInput" message="InputTypeMsg">
</operation>
Example:
<portType name="xyz">
<operation name="singlewayOperation">
<Input name="MyInput" message="InputTypeMsg">
<output name="MyOutput" message"OutputTypeMsg">
</operation>
Example:
<portType name="xyz">
<operation name="singlewayOperation">
<output name="MyOutput" message"OutputTypeMsg">
<Input name="MyInput" message="InputTypeMsg">
</operation>
</portType>
Example:
<portType name="xyz">
<operation name="singlewayOperation">
<output name="MyOutput" message"OutputTypeMsg">
</operation>
COMMENTS