Avijeet and Satyabrata Dash
We looked at SOAP basics in last article. SOAP is primarily used as the data packaging protocol for data transfers between service producers and consumers. When two web-services run-time environments talk to each other as client and server they exchange SOAP messages. Before web services infrastructures could start communicating, the client needs to understand the service offered by the server.
WSDL provides the XML grammar to provide the service description. The entry point to talk to a web service is its WSDL document. WSDL document is the public face of the web service. In this article we will have an overview of the WSDL specification and its major elements.
A WSDL document describes four critical pieces of data-
The WSDL Specification
WSDL is an XML grammar for describing web services. The specification itself is divided into six major elements:
definitions
The definitions element must be the root element of all WSDL documents. It defines the name of the web service, declares multiple name spaces used throughout the reminder of the document.
types
The types element describes all the data types used between the client and the server. If the service uses only XML schema built-in types such as strings and integers, the types element is not required.
message
The message element describes a one-way message, whether it is a single message request or a single message response. It defines the name of the message and contains zero or more message part elements, which can refer to message parameters or message return values.
portType
The portType element combines multiple message elements to form a complete one way or round trip operation. A portType defines multiple operations.
binding
The binding element describes the concrete specifics of how the service will be implemented on wire. WSDL includes built-in extensions for defining SOAP services, and SOAP specific information therefore goes here.
service
The service element defines the address for invoking the specified service. Most commonly this includes a URL for invoking the SOAP service.
The WSDL version 1.1 specification is also available online.
Basic WSDL Document
How it works
WSDL is perhaps the most critical element in the web services architecture. WSDL lets two different applications talk. It’s an interface, which is language and platform independent. Client programs use WSDL document published by web services to create client stubs to call methods on them and in turn the web services run time environment like JAX-RPC or .NET routes the call to the server as a SOAP message. For creating the client stubs WSDL provides a standard, which the web services platforms use to convert WSDL information to local data types and code in an uniform manner.
The diagram shows how WSDL is the central point in the contract between the client and server. It’s the WSDL, which tells the client platform how to create the stub for the remote object.
In next article we will cover how with WSDL-aware tools the whole process of application integration can be automated.
(The authors can be reached at
avijeetd@yahoo.com and satyabrata_dash@yahoo.com)