A Web service description is a document by which
the service provider communicates the specifications for invoking
the Web service to the service requester. Web service descriptions
are expressed in the XML application known as Web Service Description Language
(WSDL).
The service description describes the Web service in such a way as to minimize
the amount of shared knowledge and customized programming that is needed to
ensure communication between the service provider and the service requester.
For example, neither the requester nor the provider needs to be aware of the
platform on which the other runs, nor of the programming language in which
the other is written.
The structure of WSDL allows a service description to be partitioned
into:
- An abstract service interface definition that describes the
interfaces of the service, and makes it possible to write programs that implement,
and invoke, the service.
- A concrete service implementation definition that describes
the location on the network (or endpoint) of the provider's Web
service, and other implementation specific details, and that makes it possible
for a service requester to connect to the service provider.
This is illustrated in
Figure 1.
A WSDL document uses the following major elements in the definition of
network services:
- <types>
- A container for data type definitions using some type system
(such as XML Schema). Defines the data types used within the message. The <types> element
is not required when all messages consist of simple data types.
- <message>
- Specifies which XML data types are used to define the input
and output parameters of an operation.
- <portType>
- Defines the set of operations supported by one or more endpoints.
Within a <portType> element, each operation is described
by an <operation> element.
- <operation>
- Specifies which XML messages can appear in the input and output data flows.
An operation is comparable with a method signature in a programming language.
- <binding>
- Describes the protocol, data format, security and other attributes
for a particular <portType> element.
- <port>
- Specifies the network address of an endpoint, and associates
it with a <binding> element.
- <service>
- Defines the Web service as a collection of related endpoints.
A <service> element contains one or more <port> elements.
Figure 1. Structure of a Web service description
The ability to partition the Web service description makes it possible
to divide responsibility for creating a complete service description. As an
illustration, consider a service which is defined by a standards body for
use across an industry, and implemented by individual companies within that
industry:
- The standards body provides a service interface definition, containing
the following elements:
- <types>
- <message>
- <portType>
- <binding
- A service provider who wishes to offer an implementation of the service
provides a service implementation definition, containing the following elements: