3.8 Composeability
One of the key guiding principles that has governed the specification of the Web services discussed in this book is that of composeability. Each of the Web service specifications addresses one specific concern and has a value in its own right, independently of any other specification. For example, developers of applications can adopt reliable messaging to simplify development of their business application, use transactions as a method of guaranteeing a reliable outcome of their business application, or use BPEL to define their complex business applications. However, although each of these specifications stands on its own, all the specifications are designed to work seamlessly in conjunction with each other. The term composeable describes independent Web service specifications that you can readily combine to develop much more powerful capabilities. Composeability facilitates the incremental discovery and use of new services; consequently, developers must implement only that which is necessary at any given point in time. The complexity of a solution is a direct consequence of the specific problem that is being addressed.
The basic Web service specifications, WSDL and SOAP in particular, have been designed to support composition inherently. An important characteristic of a Web service is the multipart message structure. Such a structure facilitates the easy composition of new functionality. You can add extra message elements in support of new services in such a way that does not directly alter the processing of and pre-existing functionality. For example, you can add transaction protocol information to a message that already includes reliable messaging protocol information and vice versa without the protocols conflicting with each other, and in a way that is compatible with the pre-existing message structure.
Figure 3-2 Web service message composeability.
Figure 3.2 illustrates this by way of a simple Web service message that contains elements associated with three different Web services specifications. Lines 3–7 are associated with WS-Addressing, lines 8–14 with WS-Security, and lines 15–18 with WS-ReliableMessaging. Each of these elements is independent and can be incorporated and used independently without affecting the processing of other elements present. This enables transactions, security, and reliability of Web services to be defined in terms of composeable message elements.
A good example of the power of composeable Web services in practice is the requirement for service consumers to determine the assurances that are provided by a particular service that they might want to use. This enables the consumer to ascertain whether a particular service meets desired expectations, and if so, in what way. The services must document their requirements in terms of their specific support for transactions, security and reliable messaging, and so on. WS-Policy enables Web services to incrementally augment their WSDL in an independent way to provide a more complete and flexible description of elements that have to be added to the SOAP message to interact with the service successfully.