Question: Describe the significance & working of WSDL with an example.

Subject: Internet Programming

Topic: Web Extensions and Web Services

Difficulty: High

modified 14 months ago  • written 14 months ago by gravatar for Binita Mayekar Binita Mayekar40

Web Services Description Language (WSDL)

WSDL is the standard format for describing a Web service. WSDL was developed jointly by Microsoft and IBM.

Significance of WSDL

  • WSDL is an XML-based protocol for information exchange in decentralized and distributed environments.
  • WSDL definitions describe how to access a web service and what operations it will perform.
  • WSDL is a language for describing how to interface with XML-based services.
  • WSDL is an integral part of Universal Description, Discovery, and Integration (UDDI), an XML-based worldwide business registry.
  • WSDL is the language that UDDI uses.
  • WSDL is often used in combination with SOAP and XML Schema to provide web services over the Internet.
  • The WSDL file is used to describe in a nutshell what the web service does and gives the client all the information required to connect to the web service and use all the functionality provided by the web service.

Working of WSDL

  • Given below is a WSDL file that is provided to demonstrate a simple WSDL program.
  • Let us assume the service provides a single publicly available function, called sayHello. This function expects a single string parameter and returns a single string greeting. For example, if you pass the parameter world then service function sayHello returns the greeting, "Hello, world!”.
  • Example - Contents of HelloService.wsdl file
<definitions name = "HelloService"
   targetNamespace = ""
   xmlns = ""
   xmlns:soap = ""
   xmlns:tns = ""
   xmlns:xsd = "">

   <message name = "SayHelloRequest">
      <part name = "firstName" type = "xsd:string"/>

   <message name = "SayHelloResponse">
      <part name = "greeting" type = "xsd:string"/>

   <portType name = "Hello_PortType">
      <operation name = "sayHello">
         <input message = "tns:SayHelloRequest"/>
         <output message = "tns:SayHelloResponse"/>

   <binding name = "Hello_Binding" type = "tns:Hello_PortType">
      <soap:binding style = "rpc"
         transport = ""/>
      <operation name = "sayHello">
         <soap:operation soapAction = "sayHello"/>
               encodingStyle = ""
               namespace = "urn:examples:helloservice"
               use = "encoded"/>

               encodingStyle = ""
               namespace = "urn:examples:helloservice"
               use = "encoded"/>

   <service name = "Hello_Service">
      <documentation>WSDL File for HelloService</documentation>
      <port binding = "tns:Hello_Binding" name = "Hello_Port">
            location = "" />

Example Analysis

  • Definitions − HelloService
  • Type − Using built-in data types and they are defined in XMLSchema.
  • Message
    • sayHelloRequest − firstName parameter
    • sayHelloresponse − greeting return value
  • Port Type − sayHello operation that consists of a request and a response service.
  • Binding − Direction to use the SOAP HTTP transport protocol.
  • Service − Service available at
  • Port − Associates the binding with the URI where the running service can be accessed.
written 14 months ago by gravatar for Binita Mayekar Binita Mayekar40
Please log in to add an answer.