Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

...

This article will move through basics of Web Services, the various Web Services platform elements SOAP (Simple Object Access Protocol), UDDI (Universal Description, Discovery and Integration) and WSDL (Web Services Description Language).

Table of Contents

What is Web Services?

Web Services is a platform to build loosely coupled applications. A web service is piece of code that can be remotely invoked using HTTP, that means an HTTP request is enough to invoke a web service. Moving back in time, remote access to binary data has been either platform specific or vendor specific. For example:

...

There are several reasons why Web Services has become a need:

  1. One of the biggest reason why we need web services reasons is interoperability wherein different Vendor vendor specific applications can interact with each other. For Example a .Net application accessing a Java web service.
  2. Using Web Services you can expose your application and its functionality globally.
  3. Using Web Services, an enterprise need would not not depend on one particular vendor for all the solutions. It can move to different vendors for different functionality and can optimally choose out of several options.
  4. Web Services used use standardized protocols SOAP, UDDI, WSDL and HTTP for implementation.
  5. Web Services has support for most of the communication protocol and it can be implemented using FTP as well as HTTP.
  6. Web Services follow a loosely coupled architecture.

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 below

...

in the following example.

...

The syntax of a WSDL suggests that it is a set of definitions where the definition element is at the root.

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.

...

  • <types>- Web Service is all about sending and receiving messages. The <types> element describes the various messages which will be used by the service. Basically it defines the various data types. As can be seen HelloWorld service uses hello and helloResponse as the two messages.

...

  • <service>- Service element defines where the service can be accessed. Each service is associated with a unique name which is suggested by <wsdl:service name="HelloWorldService"> in our example. The next element <wsdl:port binding="intf:HelloWorldSoapBinding" name="HelloWorld"> suggests the previous binding which will be used by service. The element <wsdlsoap:address location="http://localhost:8080/SimpleWeb/services/HelloWorld"/> suggests the physical address through which a service can be accessed.

Web

...

Services tutorials

...