Chapter 10: Core Messaging Example 59
(04) <xop:Include
(05) href="cid:ex.mspress.microsoft.com/ebook.zip"/>
(06) </b:content>
(07) </b:EBookResponse>
(08) </soap:Body>
Line 01 The soap:mustUnderstand attribute is added to the message. When the value of this
attribute is set to 1, the SOAP processor must understand how to process the element or
processing must fail.
Transport Independence
One of the commonly used message transport protocols for Web services is HTTP. However,
numerous other transport protocols are expected and appropriate for use within the Web ser-
vices architecture. Transport protocol selection is a deployment or run-time decision that is
left to system administrators. The transports in use for a given Web service are defined in
WSDL binding elements.
The SOAP specification defines a binding to HTTP for Web services. An example of these
HTTP headers is shown here:
HTTP Message Headers
(01) POST /orders HTTP/1.1
(02) User-Agent: Mozilla/4.0
(03) Content-Type: text/xml; charset=utf-8
(04) SOAPAction: "http://http://ex.mspress.microsoft.com/PO"
(05) Content-Length: 570
(06) Expect: 100-continue
(07) Connection: Keep-Alive
(08) Host: 172.30.177.248:80
Line 01 When using HTTP 1.1, Web services messages use HTTP POST.
Line 03 The HTTP Content-Type is text/xml. As shown in the previous example, SOAP mes-
sages using XOP have a HTTP Content-Type of application/xop+xml.
Line 04 The SOAP action is provided in the HTTP header as a hint to help facilitate message
routing and processing. However, all vital information regarding the intent of a message
is carried in the SOAP Envelope.
Addressing: Using Endpoint References
When the Order message is transmitted from the school's procurement system to the book-
ordering system, message routing and delivery information, such as the endpoint address,
must be provided. This routing and delivery information can be obtained by the sender
through multiple means. One approach is through an out-of-band exchange of Endpoint Ref-
erences between the system administrators.
60 Part II: Example Scenarios
The most primitive Endpoint Reference for the order service is equivalent to the traditional
URL. It is structured as follows:
Order Service Base Endpoint Reference
(01) <wsa:EndpointReference>
(02) <wsa:Address>http://ex.mspress/microsoft.com/orders</wsa:Address>
(03) </wsa:EndpointReference>
Line 02 The URI of the ordering system is provided in the Address element.
This address information is then included in the To element of the SOAP Header of each Pur-
chaseOrder message.
Note
A common source of confusion is that an Endpoint Reference is an XSD type and not
an element name. Thus, any element of type Endpoint Reference has the appropriate informa-
tion, irrespective of the name the element has. When Endpoint References are exchanged in
SOAP messages, the element name will be specific to its usage.
WS-Addressing headers in SOAP messages are used to satisfy a variety of messaging require-
ments. Different endpoints can be defined for the To, From, Reply, and Fault locations, as
shown next. The processing behavior required is defined in the Action header.
Address Blocks in a SOAP Header
(01) <env:Header>
(02) <wsa:To:>
(03) <wsa:Address>http://ex.mspress.microsoft.com/orders</wsa:Address>
(04) </wsa:To>
(05) <wsa:From>
(06) <wsa:Address>http://fineartschool.net/orders</wsa:Address>
(07) </wsa:From>
(08) <wsa:ReplyTo>
(09) <wsa:Address>http://fineartschool.net/orders</wsa:Address>
(10) </wsa:ReplyTo>
(11) <wsa:FaultTo>
(12) <wsa:Address>http://fineartschool.net/status</wsa:Address>
(13) </wsa:FaultTo>
(14) <wsa:Action>http://ex.mspress.microsoft.com/PO</wsa:Action>
(15) </env:Header>
Lines 02–04 The Address element provided in the Endpoint Reference above is used as the
value of the To Endpoint Reference in the message’s address block.
Lines 05–13 The From, ReplyTo, and FaultTo endpoint references are populated to by the
sending system to make sure that any responses are routed properly. The optional From
element can be used to specify the message origin.

Get Web Services Architecture and Its Specifications: Essentials for Understanding WS-* now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.