Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Web Services Architecture

As can be seen from shown in the architecture diagram, the Web Service Provider registers the Web Service to UDDI registry and provides WSDL for invoking service. The Web Service consumer, which can be an application client or any other Web Service, queries the UDDI registry and finds WSDL. Next the consumer uses WSDL to invoke the SOAP service.

Web Services Description Language (WSDL)

WSDL is a an XML based way of describing a Web Service. It specifies the location of Web Service and methods available with the service. WSDL is basically a document written in XML. A WSDL document has <portType>, <message>, <types > <types> and <binding> as the elements.

The typical syntax of a WSDL document is as shown belowin the following example.

Code Block
XML
XML
titleSyntax of a WSDL document
borderStylesolid
<definitions>
<types>
definition of types....
</types>
<message>
definition of message....
</message>
<portType>
definition of portType....
</portType>
<binding>
definition of binding....
</binding>
<service>
definition of service....
</service>
</definitions>

...

Let us try to understand each element in a WSDL document using a HelloWorld.wsdl document. This is wsdl WSDL document which is automatically generated by the Geronimo Eclipse Plugin (GEP). In With the tutorials section we listed at the end of this document you will learn how to generate it using Eclipse and GEP.

Code Block
XML
XML
titleHelloWorld.wsdl
borderStylesolid
<!--WSDL created by Apache Axis version: 1.4
Built on Apr 22, 2006 (06:55:48 PDT)-->
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions>
 <wsdl:types>
  <schema elementFormDefault="qualified" targetNamespace="http://webservices" xmlns="http://www.w3.org/2001/XMLSchema">
   <element name="hello">
    <complexType/>
   </element>
   <element name="helloResponse">
    <complexType/>
   </element>
  </schema>
 </wsdl:types>

   <wsdl:message name="helloRequest">

      <wsdl:part element="intf:hello" name="parameters"/>

   </wsdl:message>

   <wsdl:message name="helloResponse">

      <wsdl:part element="intf:helloResponse" name="parameters"/>

   </wsdl:message>

   <wsdl:portType name="HelloWorld">

      <wsdl:operation name="hello">

         <wsdl:input message="intf:helloRequest" name="helloRequest"/>

         <wsdl:output message="intf:helloResponse" name="helloResponse"/>

      </wsdl:operation>

   </wsdl:portType>

   <wsdl:binding name="HelloWorldSoapBinding" type="intf:HelloWorld">

      <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>

      <wsdl:operation name="hello">

         <wsdlsoap:operation soapAction=""/>

         <wsdl:input name="helloRequest">

            <wsdlsoap:body use="literal"/>

         </wsdl:input>

         <wsdl:output name="helloResponse">

            <wsdlsoap:body use="literal"/>

         </wsdl:output>

      </wsdl:operation>

   </wsdl:binding>

   <wsdl:service name="HelloWorldService">

      <wsdl:port binding="intf:HelloWorldSoapBinding" name="HelloWorld">

         <wsdlsoap:address location="http://localhost:8080/SimpleWeb/services/HelloWorld"/>

      </wsdl:port>

   </wsdl:service>

</wsdl:definitions>

...