Showing posts with label wsdl. Show all posts
Showing posts with label wsdl. Show all posts

Monday, April 18, 2011

WSDL Definition Element

The <definition> element must be the root element of all WSDL documents. It defines the name of the web service.
Refer here for more:
http://www.tutorialspoint.com/wsdl/index.htm
http://www.herongyang.com/WSDL/

Thursday, March 17, 2011

WSDL Document Example

Following is the WSDL file that is provided to demonstrate a simple WSDL program.
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!".

Content of HelloService.wsdl file


<definitions name="HelloService"
   targetNamespace="http://www.examples.com/wsdl/HelloService.wsdl"
   xmlns="http://schemas.xmlsoap.org/wsdl/"
   xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
   xmlns:tns="http://www.examples.com/wsdl/HelloService.wsdl"
   xmlns:xsd="http://www.w3.org/2001/XMLSchema">
 
   <message name="SayHelloRequest">
      <part name="firstName" type="xsd:string"/>
   </message>
   <message name="SayHelloResponse">
      <part name="greeting" type="xsd:string"/>
   </message>

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

   <binding name="Hello_Binding" type="tns:Hello_PortType">
   <soap:binding style="rpc"
      transport="http://schemas.xmlsoap.org/soap/http"/>
   <operation name="sayHello">
      <soap:operation soapAction="sayHello"/>
      <input>
         <soap:body
            encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
            namespace="urn:examples:helloservice"
            use="encoded"/>
      </input>
      <output>
         <soap:body
            encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
            namespace="urn:examples:helloservice"
            use="encoded"/>
      </output>
   </operation>
   </binding>

   <service name="Hello_Service">
      <documentation>WSDL File for HelloService</documentation>
      <port binding="tns:Hello_Binding" name="Hello_Port">
         <soap:address
            location="http://www.examples.com/SayHello/">
      </port>
   </service>
</definitions>

Analysis of the Example

  • Definition : HelloService
  • Type : Using built-in data types and they are defined in XMLSchema.
  • Message :
    1. sayHelloRequest : firstName parameter
    2. 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 http://www.examples.com/SayHello/.
  • Port: Associates the binding with the URI http://www.examples.com/SayHello/ where the running service can be accessed.

Tuesday, March 15, 2011

WSDL Elements

A WSDL document describes a web service using these major elements:
Element Defines
<types> The data types used by the web service
<message> The messages used by the web service
<portType> The operations performed by the web service
<binding> The communication protocols used by the web service


Following are the elements of WSDL document. Within these elements are further subelements, or parts:
  • Definition: element must be the root element of all WSDL documents. It defines the name of the web service, declares multiple namespaces used throughout the remainder of the document, and contains all the service elements described here.
  • Data types: the data types - in the form of XML schemas or possibly some other mechanism - to be used in the messages
  • Message: an abstract definition of the data, in the form of a message presented either as an entire document or as arguments to be mapped to a method invocation.
  • Operation: the abstract definition of the operation for a message, such as naming a method, message queue, or business process, that will accept and process the message
  • Port type : an abstract set of operations mapped to one or more end points, defining the collection of operations for a binding; the collection of operations, because it is abstract, can be mapped to multiple transports through various bindings.
  • Binding: the concrete protocol and data formats for the operations and messages defined for a particular port type.
  • Port: a combination of a binding and a network address, providing the target address of the service communication.
  • Service: a collection of related end points encompassing the service definitions in the file; the services map the binding to the port and include any extensibility definitions.
In addition to these major elements, the WSDL specification also defines the following utility elements:
  • Documentation: element is used to provide human-readable documentation and can be included inside any other WSDL element.
  • Import: element is used to import other WSDL documents or XML Schemas.
NOTE: WSDL parts usually are generated automatically using Web services-aware tools.

The WSDL Document Structure

The main structure of a WSDL document looks like this:
<definitions>
<types>
   definition of types........</types>

<message>
   definition of a message....</message>

<portType>
      <operation>
    definition of a operation.......  
      </operation>
</portType>

<binding>
   definition of a binding....</binding>

<service>
   definition of a service....</service>

</definitions>
A WSDL document can also contain other elements, like extension elements and a service element that makes it possible to group together the definitions of several web services in one single WSDL document.
Proceed further to analyze an example of WSDL Document.

WSDL introduction

WSDL Abstract:

  • WSDL stands for Web Services Description Language
  • WSDL is an XML based protocol for information exchange in decentralized and distributed environments.
  • WSDL is the standard format for describing a web service.
  • WSDL definition describes 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 UDDI, an XML-based worldwide business registry.
  • WSDL is the language that UDDI uses.
  • WSDL was developed jointly by Microsoft and IBM.
  • WSDL is pronounced as 'wiz-dull' and spelled out as 'W-S-D-L'

WSDL Usage:

WSDL is often used in combination with SOAP and XML Schema to provide web services over the Internet. A client program connecting to a web service can read the WSDL to determine what functions are available on the server. Any special datatypes used are embedded in the WSDL file in the form of XML Schema. The client can then use SOAP to actually call one of the functions listed in the WSDL.

History of WSDL

WSDL 1.1 was submitted as a W3C Note by Ariba, IBM and Microsoft for describing services for the W3C XML Activity on XML Protocols in March 2001.
WSDL 1.1 has not been endorsed by the World Wide Web Consortium (W3C), however it has just (May 11th, 2005) released a draft for version 2.0, that will be a recommendation (an official standard), and thus endorsed by the W3C.

Chitika