What is WSDL (Web Services Description Language)?

Related to: differences of Web Service types: SOAP, REST, XML

  • What is WSDL?
  • What is your relationship to rest and SOAP?
  • Where do I find the WSDL documentation?
Author: Comunidade, 2014-08-15

2 answers

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

RPC-Remote Procedure Calls is a model that defines how calls to remote operations are performed through web services.

Through a WSDL you tell the client how each service on an end-point should be invoked: which parameters and data type of each parameter is expected, and which data type of the return will be sent as a response.

In addition to describing each service (which can be compared analogously to a method to 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:

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 excerpt below defines the location of the CalculatorService

<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 of SOAP, first it asks 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 carry out 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, he needs to know their path and interface 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 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_PPGEP_M_Mazer%20Junior,%20Ademir_2013.pdf

 23
Author: Ademir Mazer Jr - Nuno, 2014-08-15 15:07:38

Speaking in extremely simple and practical terms:

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

A good reference: Wikipedia

SOAP is a protocol used for the exchange of information.

Full reference: Wikipedia

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

Full Reference Wikipedia

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

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

Finally, WSDL documentation can be found at w3c .

 11
Author: Edgar Muniz Berlinck, 2015-12-15 18:46:13