Professional Documents
Culture Documents
April 2004
Authors
Omri Gazitt
David Langworthy
Abstract
This overview describes additions and changes in the WS-Addressing specification since
original publication in 2003, and includes examples and implementation considerations not
contained in the specification. (8 printed pages)
Table of Contents
1. Additions
1.1 WSDL Binding
1.2 Fault Codes
1.3 Request/Reply
2. Changes and Clarifications
2.1 "Response" to "Reply"
2.2 Recipient
2.3 MessageID and Retransmission
2.4 The Anonymous URI
3. Implementation Considerations
3.1 Comparing Message ID and Action
3.2 Comparing EndpointReferences
3.3 Attributes and Elements in ReferenceProperties
4. Examples
4.1 One Way
4.2 Fault
5. References
1. Additions
This publication of WS-Addressing [WS-Addressing] adds fault codes, a WSDL binding, and
explicit direction on formulating the request-reply message exchange pattern. This section
describes those additions and the reasoning behind them.
The Action in every message is the key to the application's intent. Web services endpoints
described with WSDL require a mechanism to determine which Action to place on outbound
messages (output). Correspondingly, WSDL processors require an inbound message be
mapped to an input of an operation.
WS-Addressing defines two mechanisms to accomplish this, a default pattern and an explicit
annotation. The default pattern allows services that use WSDL to adopt WS-Addressing
without modification. Explicit annotation allows direct control over the Action to WSDL
mapping. This control may be used to promote factoring and reuse in to a greater degree
than natively supported in WSDL. It may also be used to allow a new version of a service to
continue to accept messages from a prior version.
WS-Addressing requires an Action header on every message. This differs from the
SOAP:Action header in the SOAP binding for WSDL [WSDL] that places an action URI on the
request only. The specification clarifies this distinction and the binding provides a
mechanism to define an action or construct a default action for both a request and a
response.
WS-Addressing defines 5 new fault codes with explicit bindings to SOAP 1.1 and 1.2 fault
messages. The fault messages are:
The first two faults, Invalid Information Header and Message Information Header Required,
deal with a malformed or missing WS-Addressing header. Action Not Supported is a special
case in which the Action header is present and well formed, but the URI content does not
match any action at the destination.
1.3 Request/Reply
The request-reply pattern is very common. The specification defines the explicit
requirements for this message exchange pattern. In short, ReplyTo and MessageID are
required on all requests, and RelatesTo is required on all responses. These headers may be
used in other message exchange patterns, but must be used as defined in the request-reply
pattern. The specification includes an example request and reply in WS-Addressing Section
3.2 and these are not repeated here.
The prior revision of WS-Addressing used the terms "Response" and "Reply"
interchangeably. To simplify explanations and improve consistency, the authors chose to
use Reply exclusively. This resulted in a single change to the XML message format. For the
RelationshipType attribute, Response changed to Reply. Since Response was the default and
Reply is now the default, and no other RelationshipTypes are defined in the specification,
this change should affect few messages in practice.
2.2 Recipient
The prior revision of WS-Addressing defined a "Recipient" header that contained the entire
endpoint reference (EPR) used to formulate a message. This same information is contained
in the To header and the headers derived from reference properties. Packaging the
information together offered efficiencies; however, our implementation experience proved
that they were not significant. The header was removed to eliminate redundancy and
simplify the processing model.
The purpose of the MessageID header is to assign each message a unique identity. This
identity can be used for duplicate detection, message correlation, and many other purposes.
The prior revision of WS-Addressing required that no message share the exact same
MessageID content. This statement posed a problem for reliable messaging [WSRM], which
retransmits the exact same application message to compensate for transient
communication failures (dropped messages).
This revision relaxes the requirement slightly so that messages that have the same
application intent may use the same MessageID. This definition allows MessageID to be used
for correlation in the presence of retransmissions. Allowing the retransmission caused a
minor security issue since a retransmission might be interpreted as a replay attack. The
security considerations section describes how a timestamp may be used to resolve this
issue.
WS-Addressing requires a ReplyTo header in every request message; however, in the case
that requestor does not have a well-known identity, WS-Addressing Section 3 defines an
anonymous URI for use in the ReplyTo Address. The prior revision forbade the use of this URI
in any other circumstances. This caused a problem because the Address must become the
To in the reply message. The intent of the restriction was to limit the use of the anonymous
URI to this pattern. The specification now allows the anonymous URI to be used in the To of
a reply and restricts its use elsewhere.
3. Implementation Considerations
Our experience implementing WS-Addressing led to several observations. We summarize the
most significant in this section.
Based on this observation, an implementation can optimize critical path dispatch. Therefore,
it is recommended that MessageID and Action content be generated in a uniform manner
and be treated as a string.
It is frequently useful to determine if two EPRs refer to the same service. For example, it is
common to cache metadata about a service so that it does not need to be retrieved on each
usage. This issue is somewhat related to the issue of comparing MessageID and Action in the
prior section. It differs in that an EPR consists of more than a URI.
Informally two EPRs refer to the same service if they have the same address and the same
reference properties. Policy, PortType, and ServiceName do not contribute to EPR
equivalence.
The reference properties in an EPR are promoted to SOAP headers in messages sent to the
EPR. Therefore, the same care taken with headers should be taken with reference
properties. For example, a SOAP 1.1 mustUnderstand="1" attribute on a reference property
will become a SOAP 1.1 mustUnderstand="1" attribute on a header. This has the benefit of
requiring that the endpoint understand the reference properties it created, which is a
reasonable sanity check and useful in versioning. The drawback is it requires the EPR to use
SOAP version 1.1.
4. Examples
The addressing specification provides an example of a request and a reply message pair.
This section provides an example of a simple one-way message and a fault response.
Copy
<S:Envelope xmlns:S="http://www.w3.org/2003/05/soap-envelope"
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing">
<S:Header>
<wsa:To>http://fabrikam123.com/Joe</wsa:To>
<wsa:Action>http://business456.com/mail/NewMail</wsa:Action>
</S:Header>
<S:Body/>
</S:Envelope>
[action] http://business456.com/mail/NewMail
4.2 Fault
The following is an example of a SOAP 1.2 fault message. It is a reply to the request
message in WS-Addressing Section 3.2 and is similar in several ways with the reply example
in that section. The particular properties conveyed in the message are described below.
Copy
<S:Envelope xmlns:S="http://www.w3.org/2003/05/soap-envelope"
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing">
<S:Header>
<wsa:MessageID>
uuid:aaaabbbb-cccc-dddd-eeee-wwwwwwwwwww
</wsa:MessageID>
<wsa:RelatesTo>
uuid:aaaabbbb-cccc-dddd-eeee-ffffffffffff
</wsa:RelatesTo>
<wsa:To S:mustUnderstand="1">
http://business456.com/client1
</wsa:To>
<wsa:Action>
http://schemas.xmlsoap.org/ws/2004/03/addressing/fault
</wsa:Action>
</S:Header>
<S:Body>
<S:Fault>
<S:Code>
<S:Value>S:Receiver</S:Value>
<S:Subcode>
<S:Value>wsa:EndpointUnavailable</S:Value>
</S:Subcode>
</S:Code>
<S:Reason>
<S:Text xml:lang="en">
The endpoint is unable to process the message at this time.
</S:Text>
</S:Reason>
<S:Detail>
<wsa:RetryAfter>3600000</wsa:RetryAfter>
</S:Detail>
</S:Fault>
</S:Body>
</S:Envelope>
[destination] http://business456.com/client1
[action] http://schemas.xmlsoap.org/ws/2004/03/addressing/fault
[code] S:Receiver
[subcode] wsa:EndpointUnavailable
[detail] wsa:RetryAfter>3600000</wsa:RetryAfter>
The first three properties ([destination], [message id], [relationship]) are exactly the same
as the reply message in WS-Addressing Section 3.2. The [action] property is the default fault
action defined in WS-Addressing Section 4. The remaining four properties ([code], [subcode],
[reason], [detail]) are the values defined for the Endpoint Unavailable fault defined in
Addressing 4.5. The content of RetryAfter is 3,600,000 milliseconds or one hour.
5. References
[WS-Addressing]
"Web Services Addressing," BEA Systems, IBM, Microsoft, March 2004.
[WS-Policy]
"Web Services Policy Framework," Microsoft, IBM, BEA Systems, SAP, 18 December 2002.
[WSDL]
"Web Services Description Language (WSDL) 1.1," Microsoft, IBM, March 2001.
[WSRM]
"Web Services Reliable Messaging," BEA Systems, Microsoft, IBM, TIBCO Software, March
2004.