Photo Gallery

Sunday, July 9, 2017

WSDL - Web Service Description Language

In this post, I will explain elements of WSDL.

WSDL is a language for describing web services and how to access them written in XML syntax.

Elements description:

<definitions>


   <types>
      data type definitions...

 WSDL uses XML schema syntax to define data types.
  </types>

<message>

       definition of the data being communicated...
</message>

<port type>
       set of operations ...

It defines the connection point to a web service.
It describes a web service, the operations that can be performed, and the messages that are involved.

     One-way --> can receive a message but will not return response
     Request-Response --> can receive a request and will return response
     Solicit-Response --> can send a request and will wait for a response
     Notification --> can a send a message but will not wait for a response
</port type>

<binding>
      protocol and data format specification...

 WSDL bindings defines the message format and protocol details for a web service.  
 binding - The name attribute (you can use any name) defines the name of the binding, and the 
 type attribute points to the port for the binding, in this example the "employeeData" port.

soap:binding - The style attribute can be "rpc" or "document". In this example we use document. The transport attribute defines the SOAP protocol to use. In this example we use HTTP.
operation - This element defines each operation that the portType exposes.
</binding>

</definitions>

Example :

<message name="getDataRequest">
<part name="data" type="xs:string"/>
</message>
<message name="getDataResponse">
<part name="value" type="xs:string"/>
</message>
<portType name="employeeData">
<operation name="getData">
<input message="getDataRequest"/>
<output message="getDataResponse"/>
</operation>
</portType>
<binding type="employeeData" name="binding1">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
<operation>
<soap:operation soapAction="http://test.com/getData"/>
<input><soap:body use="literal"/></input>
<output><soap:body use="literal"/></output>
</operation>
</binding>
view raw WSDL.xml hosted with ❤ by GitHub


If you have any questions, post here. Also, provide your valuable suggestions and thoughts in form of comments in the section below.

Thank you !!!


No comments:

Post a Comment