Java Reference
In-Depth Information
The <Sequence> header is used to indicate an identity for this specific set of message ex-
changes, and the ordinal position of this message within that sequence. This ordinal is 1-based,
not 0-based, and increments by 1 for each message in the same sequence.
Looks complicated, huh? You might think that this code was sending a rocket to the moon
given its length. But this is a lot of text to represent a single message in a single SOAP request
matching an operation called get that takes a single parameter, defined like this in the schema:
<xs:schema xmlns:tns="http://soacookbook.com/sigcap"...>
<xs:complexType name="get">
<xs:sequence>
<xs:element name="getRequest" type="xs:string"
form="qualified" minOccurs="0" />
</xs:sequence>
In other words, it's one element that wraps a string. Wow, that's a big package for such a tiny
present. Reliable messaging and addressing really add to the size of every single message.
And reliable messaging sends additional messages to indicate to the destination that the se-
quence is complete.
Let's look at the reliable messaging response to the request just shown. The first pertinent
things that we see in the response are the HTTP headers, which indicate that the response is
multipart. The content type is application/xop+xml , and it uses binary content encoding.
This is due to the fact that this service returns binary data with an image as its content,
based on the unique identifier passed into the request. The service does a lookup for that ID
and returns the corresponding image, which is the <signatureData> element, specified as
xs:base64Binary in the schema.
But the binary content is not inlined within the message; instead, it is replaced with an XOP
<Include> element. The image data itself is then exported to an attachment and assigned the
same ID. Runtime processes can then reconstruct the binary data using the include ID as a
reference. The HTTP headers indicate the multipart content using UUIDs. This is shown in
Example 13-2 , which contains the response message.
NOTE
XOP stands for XML-binary Optimized Packaging. This is a W3C standard that describes a means to
efficiently serialize XML infosets that have binary content. It's not directly part of WS-A or WS-RM,
but because it's part of this example, it seemed useful to make the distinction. You can read the XOP
spec at http://www.w3.org/TR/xop10 .
Example13-2.WS-RM response message
Search WWH ::




Custom Search