Basic WSDL Structure Understanding – (Web Service Description Language) Explained

Last updated
App Shah
Crunchify » Design Development » Basic WSDL Structure Understanding – (Web Service Description Language) Explained


You may have seen my previous post on SOAP vs. REST call. Now a day companies are moving to REST service calls but still there are majority of companies still uses SOAP over REST. This tutorial explains basic of WSDL (Web Service Description Language).

If you have any of below question then you are at right place:

  • What is Web Services Description Language (WSDL)?
  • WSDL Tutorial
  • Web Services Description Language (WSDL) Explained
  • Examples of WSDL – Web Service Description Language

Web Services Description Language (WSDL)

In Java Web Development World, WSDL is an XML format for describing network services as a set of endpoints operating on messages containing either document-oriented or procedure-oriented information.

The operations and messages are described abstractly, and then bound to a concrete network protocol and message format to define an endpoint. Related concrete endpoints are combined into abstract endpoints (services).

WSDL is extensible to allow description of endpoints and their messages regardless of what message formats or network protocols are used to communicate, however, the only bindings described in this document describe how to use WSDL in conjunction with SOAP 1.1, HTTP GET/POST, and MIME.

Web Service Description Language Explained

Another must read: 

In other words: A WSDL document defines services as collections of network endpoints, or ports. In WSDL, the abstract definition of endpoints and messages is separated from their concrete network deployment or data format bindings. This allows the reuse of abstract definitions: messages, which are abstract descriptions of the data being exchanged, and port types which are abstract collections of operations.

The concrete protocol and data format specifications for a particular port type constitutes a reusable binding. A port is defined by associating a network address with a reusable binding, and a collection of ports define a service.

Hence, a WSDL document uses the following elements in the definition of network services:

  • Types– a container for data type definitions using some type system (such as XSD).
  • Message– an abstract, typed definition of the data being communicated.
  • Operation– an abstract description of an action supported by the service.
  • Port Type–an abstract set of operations supported by one or more endpoints.
  • Binding– a concrete protocol and data format specification for a particular port type.
  • Port– a single endpoint defined as a combination of a binding and a network address.
  • Service– a collection of related endpoints.
<types>Defines the (XML Schema) data types used by the web service
<message>Defines the data elements for each operation
<portType>Describes the operations that can be performed and the messages involved.
<binding>Defines the protocol and data format for each port type

Example: SOAP 1.1 Request/Response via HTTP

Sample XML WSDL Document.

<?xml version="1.0"?>
<definitions name="StockQuote"


       <schema targetNamespace=""
           <element name="TradePriceRequest">
                      <element name="tickerSymbol" type="string"/>
           <element name="TradePrice">
                      <element name="price" type="float"/>

    <message name="GetLastTradePriceInput">
        <part name="body" element="xsd1:TradePriceRequest"/>

    <message name="GetLastTradePriceOutput">
        <part name="body" element="xsd1:TradePrice"/>

    <portType name="StockQuotePortType">
        <operation name="GetLastTradePrice">
           <input message="tns:GetLastTradePriceInput"/>
           <output message="tns:GetLastTradePriceOutput"/>

    <binding name="StockQuoteSoapBinding" type="tns:StockQuotePortType">
        <soap:binding style="document" transport=""/>
        <operation name="GetLastTradePrice">
           <soap:operation soapAction=""/>
               <soap:body use="literal"/>
               <soap:body use="literal"/>

    <service name="StockQuoteService">
        <documentation>My first service</documentation>
        <port name="StockQuotePort" binding="tns:StockQuoteBinding">
           <soap:address location=""/>

Basic WSDL Structure Understanding

SOAP 2.0 WSDL Example:

<!-- Crunchify's example of WSDL 2.0 -->

<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="" 

<!-- Abstract type -->
      <xs:schema xmlns:xs=""
         <xs:element name="request"> ...add your code here... </xs:element>
         <xs:element name="response">  ...add your code here... </xs:element>

<!-- Abstract interfaces -->
   <interface name="CrunchifyItem">
      <fault name="ErrorDescription" element="tns:response"/>
      <operation name="Get" pattern="">
         <input messageLabel="In" element="tns:request"/>
         <output messageLabel="Out" element="tns:response"/>

<!-- Concrete Binding Over HTTP -->
   <binding name="HttpBinding" interface="tns:CrunchifyItem" 
      <operation ref="tns:Get" whttp:method="GET"/>
<!-- Concrete Binding with SOAP-->
   <binding name="SoapBinding" interface="tns:CrunchifyItem" 
      <operation ref="tns:Get" />

<!-- Web Service offering endpoints for both bindings-->
   <service name="ServiceOne" interface="tns:CrunchifyItem">
      <endpoint name="HttpEndpoint" 
      <endpoint name="SoapEndpoint" 

Factory Design Pattern explained with Example.

Let me know if you have any questions.

14 thoughts on “Basic WSDL Structure Understanding – (Web Service Description Language) Explained”

  1. you have a mistake in the xml file binding=”tns:StockQuoteBinding” should be binding=”tns:StockQuoteSoapBinding”

    • Hi Hamza. I think tns:StockQuoteBinding is correct 🙂

      Any reason you mentioned tns:StockQuoteSoapBinding. What behavior change are you referring?

  2. so my question : if I was given a wsdl file and I wanted to call the service, how can I know the full URL for each operation ?

  3. Thank you for explaining this. I’m not a technical person and it is fairly easy to follow. Your work is


Leave a Comment