What is Web Services Description Language (WSDL)?

19

Related to: Differences in Web Service Types: SOAP, REST, XML

  • What is WSDL?
  • What is your relationship with REST and SOAP?
  • Where can I find the WSDL documentation?
asked by anonymous 15.08.2014 / 14:43

2 answers

21

WSDL is an XML-formatted description of a Web Service that will use SOAP / RPC as a protocol. It is the acronym for Web Services Description Language.

Remote Procedure Calls (RPC) is a template that defines how remote operations calls are made through web services.

Through a WSDL you inform the client how each service in an end-point should be invoked: what parameters and data type of each parameter is expected, and what kind of return data will be sent in response.

In addition to describing each service (which can be compared analogously to a method to be run in the server program), it also describes how they can be found. Its basic elements are:

<types>: aqui deverão ser descritos os tipos de dados suportados pelo serviço em questão

<message>: aqui devem ser especificados os padrões de entrada e saída de dados dos web services

<portType>: aqui devem ser descritos os agrupamentos lógicos das operações. São as operações executadas pelo web service

<binding>: aqui devem ser apresentados os protocolos de comunicação que os web services utilizam

<operation>: região que permite a especificação das assinaturas dos métodos disponibilizados

<definitions>: elemento padrão de todos os documentos WSDL. Permite efetuar descrições sobre schemas e namespaces

At this address you can see an example of a WSDL for a set of calculator services:

link

The following is the point where the services are defined:

<wsdl:portType name="ICalculator">
    <wsdl:operation name="Add">
      <wsdl:input wsaw:Action="http://Example.org/ICalculator/Add" message="tns:ICalculator_Add_InputMessage" />
      <wsdl:output wsaw:Action="http://Example.org/ICalculator/AddResponse" message="tns:ICalculator_Add_OutputMessage" />
    </wsdl:operation>
    <wsdl:operation name="Subtract">
      <wsdl:input wsaw:Action="http://Example.org/ICalculator/Subtract" message="tns:ICalculator_Subtract_InputMessage" />
      <wsdl:output wsaw:Action="http://Example.org/ICalculator/SubtractResponse" message="tns:ICalculator_Subtract_OutputMessage" />
    </wsdl:operation>
  </wsdl:portType>

The following snippet describes how each service should be called:

<wsdl:binding name="DefaultBinding_ICalculator" type="tns:ICalculator">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
    <wsdl:operation name="Add">
      <soap:operation soapAction="http://Example.org/ICalculator/Add" style="document" />
      <wsdl:input>
        <soap:body use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
    <wsdl:operation name="Subtract">
      <soap:operation soapAction="http://Example.org/ICalculator/Subtract" style="document" />
      <wsdl:input>
        <soap:body use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>

The following section defines the location of the CalculatorService service

<wsdl:service name="CalculatorService">
        <wsdl:port name="ICalculator" binding="tns:DefaultBinding_ICalculator">
            <soap:address location="http://Example.org/ICalculator" />
        </wsdl:port> 
  </wsdl:service>
</wsdl:definitions>

As mentioned in the first paragraph, WSDL is used directly with SOAP, when a client makes a service call through SOAP, it first requests the WSDL to understand how this negotiation will take place.

REST works on the pure HTTP protocol, so it does not depend on the SOAP protocol to perform the communication, therefore it does not need to use a WSDL. Only HTTP verbs are used. In this case, for a client to request REST services, it needs to know the path and interface of them beforehand. It means that the developer will need a manual or programming guide to use a REST API.

The official documentation is on the W3C website: w3.org/TR/wsdl

My MSc dissertation uses SOAP and WSDL for a Pricing framework, you can read Chapter 4 for more detail, and above all, see the references I've used, there you'll find good SOA documents: link

    
15.08.2014 / 17:07
9

Speaking in extremely simple and practical terms:

WSDL is an XML that describes a web service. The WSDL content describes the methods provided by the web service and how do we access it.

A good reference: Wikipedia

SOAP is a protocol used to exchange information.

Full Reference: Wikipedia

REST is a principle that simply uses HTTP and XML or JSON or Simply Text. REST is (theoretically) more performative than SOAP because it does not use the process of enveloping and de-enveloping messages.

Complete Reference Wikipedia

So, WSDL is a webservice access interface and SOAP is the protocol used to exchange messages between webservice and application.

There is no relationship between WSDL and REST. They are totally different approaches.

Finally, the WSDL documentation can be found at w3c .

    
15.08.2014 / 15:13