What is WSDL (Web Services Description Language)?

Asked

Viewed 30,102 times

22

  • The wikipedia article provides a good idea: http://pt.wikipedia.org/wiki/Web_Services_Description_Language and the W3C documentation here http://www.W3.org/TR/wsdl and the relationship with Rest as far as I know is none and with SOAP it is WSDL that defines which SOAP services are published and how to use them

2 answers

27


WSDL is a description in XML format of a Web Service that will use SOAP / RPC as protocol. It is the acronym for Web Services Description Language (Web Services Description Language).

RPC - Remote Procedure Calls (English: Remote Procedure) is a model of how calls to remote operations are made through web services.

Through a WSDL you inform the customer how each service at 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 as a 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:

http://msdn.microsoft.com/en-us/library/windows/desktop/dd323317%28v=vs.85%29.aspx

The section below 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 excerpt below 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 section below 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 quoted in the first paragraph, WSDL is used directly with SOAP, when a customer performs a service call through SOAP, first he 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 customer to request REST services, he needs to know their path and interface beforehand. This 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 master’s dissertation uses SOAP and WSDL for a Selling Price framework, you can read chapter 4 for more detail, and mainly, see the references I used, there you find good documents on SOA: http://repositorio.utfpr.edu.br/jspui/bitstream/1/635/1/PG_PGEP_M_Mazer%20Junior,%20Ademir_2013.pdf

12

Speaking in extremely simple and practical terms:

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

A good reference: Wikipedia

SOAP is a protocol used for the exchange of information.

Full reference: Wikipedia

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

Complete Reference Wikipedia

Therefore, WSDL is a web service access interface and SOAP is the protocol used to exchange messages between the web service and the application.

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

Finally, the WSDL documentation can be found at w3c.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.