SOAP language basics
In the previous section we established that a WSDL definition intentionally separates abstract from concrete definition details. One of the benefits of doing so is that we can isolate communication protocols that implement the messaging required by a service from the implementation-neutral service interface. However, given that SOAP has become the messaging format of choice for SOA, we will very likely be binding our abstract interfaces to SOAP.
Within the service-oriented design process, we place a great deal of emphasis on hand crafting the WSDL definition, along with required XSD schema types. SOAP messages generally do not require as much hands on attention. We spend more time working with SOAP syntax in Chapter 17, where we explore WS-* extensions that are implemented via SOAP headers. Still, this is as good of a time as any to introduce some basic parts of the SOAP language.
As we established in Chapter 5, the structure of SOAP messages is relatively simple. They consist of header, body, and fault sections, all encased in an envelope. Appropriately, the elements we describe in this section (Figure 13.5) are represented by the same names. (The manner in which SOA affects the utilization of SOAP is explored in the SOAP and SOA section in Chapter 14.)
Figure 13.6. The structure of a SOAP message document.
13.4.1. The Envelope element
The Envelope element represents the root of SOAP message structures. It contains a mandatory Body construct and an optional Header construct.
Example 13.18. The root Envelope construct hosting Header and Body constructs.
<Envelope xmlns ="http://schemas.xmlsoap.org/soap/envelope/">
...
...