Introduction to WSDL (Web Service Definition Language) – Sample HelloWorld Tutorial

Last updated
App Shah
Crunchify » Java and J2EE Tutorials » Introduction to WSDL (Web Service Definition Language) – Sample HelloWorld Tutorial

Web Service Description Language

The Web Services Description Language (WSDL) is an XML-based language that is used for describing the functionality offered by a Web service. A WSDL description of a web service (also referred to as a WSDL file) provides a machine-readable description of how the service can be called, what parameters it expects, and what data structures it returns. It thus serves a roughly similar purpose as a method signature in a programming language.

Assuming 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!”.

HelloWorld WSDL file:

<definitions name="HelloService"

   <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"
   <operation name="sayHello">
      <soap:operation soapAction="sayHello"/>

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

Analysis of the Example:

  • DefinitionHelloService
  • Type : Using built-in data types and they are defined in XML Schema.
  • Message :
    • sayHelloRequest : firstName parameter
    • sayHelloresponse: greeting return value
  • Port Type : sayHello operation that consists of a request and 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.

Here is a post which explains How to Create Sample WSDL in Eclipse. Also, try this tutorial to Create and Deploy Simple Web Service and Web Service Client.

4 thoughts on “Introduction to WSDL (Web Service Definition Language) – Sample HelloWorld Tutorial”

  1. I don’t see ‘the next page’ where you describe how to create the web service in eclipse using this wsdl. I realize this was 2 years ago but …..


Leave a Comment