|
This chapter assumes that you're already familiar with XML, and to some extent, the form and function of WSDL. If you don't understand the terms in the following discussion, consider taking an online WSDL tutorial such as that available at http://www.w3schools.com/wsdl/wsdl_intro.asp.
To review, a WSDL document contains the following elements:
portType
The description of the operations and their associated messages
messages
The description of parameters (input and output) and return values
types
The schema for describing XML complex types used in the Messages
bindings
A concrete encoding of the parameters and return values in a specific portType that binds the values to a specific protocol that is used to invoke the service
The rest of the WSDL document describes how to invoke an operation in the portType, through the following constructs:
Service
Has a name and a list of Ports
Port
The location of the service plus the binding to be used to access the service
Separating the interface definition into portType and bindings allows multiple bindings to be created and associated with the same portType. This allows the same service interface to be accessible over multiple transports and protocols as used by the Service-Oriented Architecture described in Chapter 7. This is one of the great values of the web services architecture. By describing multiple ways to call a service, the service implementation becomes more reusable by virtue of increased accessibility. Application developers can combine the power of the EJB component model with the accessibility of web services, to produce truly reusable software components.
The protocol most commonly associated with WSDL-based web services is the Simple Object Access Protocol (SOAP), defined by a W3C memo at http://www.w3.org/TR/SOAP. SOAP is a specification for the format of an XML envelope that contains a value, a set of encoding rules for the values, and a convention for invoking operations remotely. When used with WSDL, the values in the SOAP envelope correspond to WSDL parts, and the remote operations are WSDL operations. Normally, WSDL and SOAP are used together, but it should be noted that SOAP can be used without WSDL and vice versa. For example, SOAP is used without WSDL by the Apache SOAP project (http://xml.apache.org/SOAP). WSDL can be used without SOAP when a protocol other than SOAP is specified in the WSDL binding.
With that introduction to WSDL and SOAP, let's delve more into the J2EE standards and WebSphere features that enable the creation and use of WSDL-described web services.
|