Ivan Marsic • Rutgers University
280
1. What is the service interface, that is, what are its methods operations, method
signatures, and return values? 2.
Where in the network host address and port number is the service located? 3.
What communication protocol does the service understand?
8.3.1 The WSDL 2.0 Building Blocks
As seen Figure 8-9, WSDL 2.0 enables the developer to separate the description of a Web service’s abstract functionality from the concrete details of how and where that functionality is
offered. This separation facilitates different levels of reusability and distribution of work in the lifecycle of a Web service and the WSDL document that describes it.
Different implementations of the same Web service can be made accessible using different communication protocols. Recall also that SOAP supports binding to different transport
protocols, Section 8.2.4 above.
The description of the endpoint’s functional capabilities is the abstract interface specification represented in WSDL by the interface element. An abstract interface can support any number
of operations. An operation is defined by the set of messages that define its interface pattern. Recall that invoking an object method involves a request message passing a set of parameters or
arguments as well as receiving a response message that carries the result returned by the method. The reader should recall the discussion of the RPC-style SOAP communication in Section 8.2.3
above. Also, some of the method parameters may be used to pass back the output results; these are known as in-out or out parameters. Since the operation is invoked over the network, we must
specify how the forward message carries the input parameters, as well as how the feedback message carries the result and the output parameters, or error message in case of failure.
WSDL description
Service implementation definition Service interface definition
types interface
Abstract part:
Concrete part:
What types of messages names + data types are
communicated with the service? How are the methods
invoked on the service?
How will the service be used on the network for a protocol?
SOAP-specific details are here.
Where is the service located in the network? – endpoint hosts
service operation1
operation2
binding operation1
operation2
Figure 8-9: The WSDL 2.0 building blocks.
Chapter 8 • Web
Services 281
For the abstract concepts of messages and operations, concrete counterparts are specified in the binding
element. A binding mechanism represented in WSDL by a binding element is used to map the abstract definition of the Web service to a specific implementation using a particular
messaging protocol, data encoding model and underlying communication protocol. When the binding is combined with an address where the implementation can be accessed, the abstract
endpoint becomes the concrete endpoint that service customers can invoke.
The WSDL 2.0 schema defines the following high-level or major elements in the language Figure 8-10, using the notation introduced in Figure 6-5:
description – Every WSDL 2.0 document has a description element as its top-most
element. This merely acts as a container for the rest of the WSDL document, and is used to declare namespaces that will be used throughout the document.
types –
Defines the collection of message types that can be sent to the Web service or received from it. Each message type is defined by the message name and the
data types used in the message.
interface –
The abstract interface of a Web service defined as a set of abstract operations. Each child operation element defines a simple interaction between the
client and the service. The interaction is defined by specifying the messages defined in the types element that can be sent or received in the course of a
service method invocation.
binding –
Contains details of how the elements in an abstract interface are converted into concrete representation in a particular combination of data
formats and transmission protocols. Must supply such details for every operation and fault in the interface.
service –
Specifies which interface the service implements, and a list of endpoint locations where this service can be accessed.
As Figure 8-10 shows, WSDL 2.0 also offers import or interface inheritance mechanisms that are described below. Briefly, an import statement brings in other namespaces into the current
wsdl:
DescriptionType
∗
wsdl:
description
targetNamespace
wsdl:
import
wsdl:
include
wsdl:
types
wsdl:
interface
wsdl:
binding
wsdl:
service
wsdl:
DescriptionType
∗
wsdl:
description
targetNamespace targetNamespace
wsdl:
import
wsdl:
import
wsdl:
include
wsdl:
include
wsdl:
types
wsdl:
types
wsdl:
interface
wsdl:
interface
wsdl:
binding
wsdl:
binding
wsdl:
service
wsdl:
service
Figure 8-10: The XML schema for WSDL 2.0. Continued in Figure 8-12 and Figure 8-14. WSDL version 2.0 schema definition available at:
http:www.w3.orgnswsdl
.