Copyright © 2002-2004 BEA Systems Inc., International Business Machines Corporation, Microsoft
Corporation, Inc, SAP AG, and Sun Microsystems, Inc.. All rights reserved.
This document is available under the W3C
Document License. See the W3C
Intellectual Rights Notice and Legal Disclaimers for additional information.
WS-Addressing provides transport-neutral mechanisms to address Web services and messages. Specifically, this specification defines XML [XML 1.0, XML Namespaces] elements to identify Web service endpoints and to secure end-to-end endpoint identification in messages. This specification enables messaging systems to support message transmission through networks that include processing nodes such as endpoint managers, firewalls, and gateways in a transport-neutral manner.
This section describes the status of this document at the time of its publication. Other documents may supersede this document.
By publishing this document, W3C acknowledges that BEA, IBM, Microsoft, SAP, and Sun Microsystems, Inc. have made a formal submission to W3C for discussion. Publication of this document by W3C indicates no endorsement of its content by W3C, nor that W3C has, is, or will be allocating any resources to the issues addressed by it. This document is not the product of a chartered W3C group, but is published as potential input to the W3C Process. Publication of acknowledged Member Submissions at the W3C site is one of the benefits of W3C Membership. Please consult the requirements associated with Member Submissions of section 3.3 of the W3C Patent Policy. Please consult the complete list of acknowledged W3C Member Submissions.
2.1. Information Model for Endpoint References
2.2. Endpoint Reference XML Infoset Representation
2.3. Binding Endpoint References
2.4 Endpoint Reference Comparison
3. Message Information Headers
3.1. Message Information Headers XML Infoset Representation
3.2 Formulating a Reply Message
3.3 Associating Action with WSDL Operations
4.1 Invalid Message Information Header
Web Services Addressing (WS-Addressing) defines two interoperable constructs that convey information that is typically provided by transport protocols and messaging systems. These constructs normalize this underlying information into a uniform format that can be processed independently of transport or application. The two constructs are endpoint references and message information headers.
A Web service endpoint is a (referenceable) entity, processor, or resource where Web service messages can be targeted. Endpoint references convey the information needed to identify/reference a Web service endpoint, and may be used in several different ways: endpoint references are suitable for conveying the information needed to access a Web service endpoint, but are also used to provide addresses for individual messages sent to and from Web services. To deal with this last usage case this specification defines a family of message information headers that allows uniform addressing of messages independent of underlying transport. These message information headers convey end-to-end message characteristics including addressing for source and destination endpoints as well as message identity.
Both of these constructs are designed to be extensible and re-usable so that other specifications can build on and leverage endpoint references and message information headers.
The following example illustrates the use of these mechanisms in a SOAP 1.2 message being sent from http://business456.example/client1 to http://fabrikam123.example/Purchasing:
(001) <S:Envelope xmlns:S="http://www.w3.org/2003/05/soap-envelope" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"> (002) <S:Header> (003) <wsa:MessageID> (004) uuid:6B29FC40-CA47-1067-B31D-00DD010662DA (005) </wsa:MessageID> (006) <wsa:ReplyTo> (007) <wsa:Address>http://business456.example/client1</wsa:Address> (008) </wsa:ReplyTo> (009) <wsa:To>http://fabrikam123.example/Purchasing</wsa:To> (010) <wsa:Action>http://fabrikam123.example/SubmitPO</wsa:Action> (011) </S:Header> (012) <S:Body> (013) ... (014) </S:Body> (015) </S:Envelope>
Lines (002) to (011) represent the header of the SOAP message where the mechanisms defined in the specification are used. The body is represented by lines (012) to (014).
Lines (003) to (010) contain the message information header blocks. Specifically, lines (003) to (005) specify the identifier for this message and lines (006) to (008) specify the endpoint to which replies to this message should be sent as an Endpoint Reference. Line (009) specifies the address URI of the ultimate receiver of this message. Line (010) specifies an Action URI identifying expected semantics.
The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 [RFC 2119].
When describing abstract data models, this specification uses the notational convention used by the XML Infoset [XML Infoset]. Specifically, abstract property names always appear in square brackets (e.g., [some property]).
When describing concrete XML schemas [XML Schema Part 1, Part 2], this specification uses the notational convention of WS-Security [WS-Security]. Specifically, each member of an element's [children] or [attributes] property is described using an XPath-like notation (e.g., /x:MyHeader/x:SomeProperty/@value1). The use of {any} indicates the presence of an element wildcard (<xs:any/>). The use of @{any} indicates the presence of an attribute wildcard (<xs:anyAttribute/>).
This specification uses a number of namespace prefixes throughout; they are listed in Table 1. Note that the choice of any namespace prefix is arbitrary and not semantically significant (see [ XML Namespaces ]).
Prefix |
Namespace |
---|---|
S |
http://www.w3.org/2003/05/soap-envelope |
S11 |
http://schemas.xmlsoap.org/soap/envelope |
wsa |
http://schemas.xmlsoap.org/ws/2004/08/addressing |
wsp |
http://schemas.xmlsoap.org/ws/2002/12/policy |
xs |
http://www.w3.org/2001/XMLSchema |
Table 1 Prefixes and Namespaces used in this specification
WS-Addressing is defined in terms of the XML Information Set [XML Infoset]. WS-Addressing is conformant to the SOAP 1.2 [SOAP 1.2] processing model; SOAP 1.2 is not a requirement for using the constructs defined in this specification. WS-Addressing is also designed to be able work with WSDL 1.1 [WSDL 1.1] described services. The examples in this specification use an XML 1.0 [XML 1.0] representation but this is not a requirement.
All information items defined by WS-Addressing are identified by the XML namespace URI [XMLNamespaces] "http://schemas.xmlsoap.org/ws/2004/08/addressing". A normative XML Schema [XML Schema Part 1, Part 2] document can be obtained by dereferencing the XML namespace URI.
This section defines the model and syntax of an endpoint reference.
This specification introduces a new description element type, the endpoint reference, with the intent of supporting a set of dynamic usage patterns not currently appropriately covered by WSDL 1.1 [WSDL 1.1]. In particular, this specification intends to facilitate the following usage scenarios:
To support these scenarios, we define a lightweight and extensible mechanism to dynamically identify and describe service endpoints and instances. Because of the current limits of the WSDL 1.1 extensibility model, the WSDL 1.1 service and port elements cannot be used to cover the use cases listed above. Endpoint references logically extend the WSDL description model (e.g., portTypes, bindings, etc.), but do not replace it. Endpoint references will be used instead of WSDL <service/> elements in the following cases:
Endpoint references complement and do not replace the WSDL/1.1 <wsdl:service> element. We expect solutions built on WSDL/1.1 to continue to utilize a service element. Moving forward we anticipate that endpoint references and WSDL will evolve coherently. The endpoint references may link to service elements in WSDL/1.1, and support additional scenarios in which the WSDL information is not known by a party processing a message. These scenarios may include dynamic messaging or limited capability message processors.
An endpoint reference consists of the following abstract properties:
This section defines an XML Infoset-based representation for an endpoint reference as both an XML type (wsa:EndpointReferenceType) and as an XML element (<wsa:EndpointReference>).
The wsa:EndpointReferenceType type is used wherever a Web service endpoint is referenced. The following describes the contents of this type:
<wsa:EndpointReference> <wsa:Address>xs:anyURI</wsa:Address> <wsa:ReferenceProperties>... </wsa:ReferenceProperties> ? <wsa:ReferenceParameters>... </wsa:ReferenceParameters> ? <wsa:PortType>xs:QName</wsa:PortType> ? <wsa:ServiceName PortName="xs:NCName"?>xs:QName</wsa:ServiceName> ? <wsp:Policy> ... </wsp:Policy>* </wsa:EndpointReference>
The following describes the attributes and elements listed in the schema overview above:
The following illustrates an endpoint reference. This element references the port of type "fabrikam:InventoryPortType" at the URI "http://www.fabrikam123.example/acct".
<wsa:EndpointReference xmlns:wsa="..." xmlns:fabrikam="..."> <wsa:Address>http://www.fabrikam123.example/acct</wsa:Address> <wsa:PortType>fabrikam:InventoryPortType</wsa:PortType> </wsa:EndpointReference>
When a message needs to be addressed to the endpoint, the information contained in the endpoint reference is mapped to the message according to a transformation that is dependent on the protocol and data representation used to send the message. Protocol-specific mappings (or bindings) will define how the information in the endpoint reference is copied to message and protocol fields. This specification defines the SOAP binding for endpoint references. This mapping MAY be explicitly replaced by other bindings (defined as WSDL bindings or as policies); however, in the absence of an applicable policy stating that a different mapping must be used, the SOAP binding defined here is assumed to apply. To ensure interoperability with a broad range of devices, all conformant implementations MUST support the SOAP binding.
The SOAP binding for endpoint references is defined by the following two rules:
The next example shows how the default SOAP binding for endpoint references is used to construct a message addressed to the endpoint:
<wsa:EndpointReference xmlns:wsa="..." xmlns:fabrikam="..."> <wsa:Address>http://www.fabrikam123.example/acct</wsa:Address> <wsa:ReferenceProperties> <fabrikam:CustomerKey>123456789</fabrikam:CustomerKey> </wsa:ReferenceProperties> <wsa:ReferenceParameters> <fabrikam:ShoppingCart>ABCDEFG</fabrikam:ShoppingCart> </wsa:ReferenceParameters> </wsa:EndpointReference>
According to the mapping rules stated before, the address value is copied in the "To" header and the "CustomerKey" element should be copied literally as a header in a SOAP message addressed to this endpoint. The SOAP message would look as follows:
<S:Envelope xmlns:S="http://www.w3.org/2003/05/soap-envelope" xmlns:wsa="..." xmlns:fabrikam="... "> <S:Header> ... <wsa:To>http://www.fabrikam123.example/acct</wsa:To> <fabrikam:CustomerKey>123456789</fabrikam:CustomerKey> <fabrikam:ShoppingCart>ABCDEFG</fabrikam:ShoppingCart> ... </S:Header> <S:Body> ... </S:Body> </S:Envelope>
During the course of Web services interactions applications may receive multiple endpoint references describing the endpoints it needs to interact with. Different copies of an endpoint reference may also be received over time.
The following rules clarify the relation between the behaviors of the endpoints represented by two endpoint references with the same [address] and the same [reference properties].
The [address] properties of two endpoint references are compared according to Section 6 of [RFC 2396]. The [reference properties] of two endpoint references are equal if:
Therefore, a consuming application should assume that different XML Schemas, WSDL definitions and policies apply to endpoint references whose address or reference properties differ.
This section defines the model and syntax of a message information header.
The message information headers collectively augment a message with the following abstract properties. These properties enable the identification and location of the endpoints involved in an interaction. The basic interaction pattern from which all others are composed is "one way". In this pattern a source sends a message to a destination without any further definition of the interaction.
"Request Reply" is a common interaction pattern that consists of an initial message sent by a source endpoint (the request) and a subsequent message sent from the destination of the request back to the source (the reply). A reply can be either an application message, a fault, or any other message.
The properties below support one way, request reply, and any other interaction pattern:
It is RECOMMENDED that value of the [action] property is a URI identifying an input, output, or fault message within a WSDL port type. An action may be explicitly or implicitly associated with the corresponding WSDL definition. Section 3.3 below describes the mechanisms of association. Finally, if in addition to the [action] property, a SOAP Action URI is encoded in a request, the URI of the SOAP Action MUST be the same as the one specified by the [action] property.
http://schemas.xmlsoap.org/ws/2004/08/addressing/id/unspecified
This specification has one predefined relationship type:
QName |
Description |
---|---|
wsa:Reply |
Indicates that this is a reply to the message identified by the URI. |
A reply message MUST contain a [relationship] property consisting of wsa:Reply and the message id property of the request message.
The dispatching of incoming messages is based on two message properties. The mandatory "destination" and "action" fields identify the target processing location and the verb or intent of the message.
Due to the range of network technologies currently in wide-spread use (e.g., NAT, DHCP, firewalls), many deployments cannot assign a meaningful global URI to a given endpoint. To allow these "anonymous" endpoints to initiate message exchange patterns and receive replies, WS-Addressing defines the following well-known URI for use by endpoints that cannot have a stable, resolvable URI.
http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous
Requests whose [reply endpoint], [source endpoint] and/or [fault endpoint] use this address MUST provide some out-of-band mechanism for delivering replies or faults (e.g. returning the reply on the same transport connection). This mechanism may be a simple request/reply transport protocol (e.g., HTTP GET or POST). This URI MAY be used as the [destination] for reply messages and SHOULD NOT be used as the [destination] in other circumstances.
The message information header blocks provide end-to-end characteristics of a message that can be easily secured as a unit. The information in these headers is immutable and not intended to be modified along the message path.
The following describes the contents of the message information header blocks:
<wsa:MessageID> xs:anyURI </wsa:MessageID> <wsa:RelatesTo RelationshipType="..."?>xs:anyURI</wsa:RelatesTo> <wsa:To>xs:anyURI</wsa:To> <wsa:Action>xs:anyURI</wsa:Action> <wsa:From>endpoint-reference</wsa:From> <wsa:ReplyTo>endpoint-reference</wsa:ReplyTo> <wsa:FaultTo>endpoint-reference</wsa:FaultTo>
The following describes the attributes and elements listed in the schema overview above:
The reply to a WS-Addressing compliant request message MUST be compliant to WS-Addressing and be constructed according to the rules defined in this section.
The following example illustrates a request message using message information header blocks in a SOAP 1.2 message:
<S:Envelope xmlns:S="http://www.w3.org/2003/05/soap-envelope" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:f123="http://www.fabrikam123.example/svc53"> <S:Header> <wsa:MessageID>uuid:aaaabbbb-cccc-dddd-eeee-ffffffffffff </wsa:MessageID> <wsa:ReplyTo> <wsa:Address>http://business456.example/client1</wsa:Address> </wsa:ReplyTo> <wsa:To S:mustUnderstand="1">mailto:joe@fabrikam123.example</wsa:To> <wsa:Action>http://fabrikam123.example/mail/Delete</wsa:Action> </S:Header> <S:Body> <f123:Delete> <maxCount>42</maxCount> </f123:Delete> </S:Body> </S:Envelope>
This message would have the following property values:
[destination] The URI mailto:joe@fabrikam123.example
[reply endpoint] The endpoint with [address] http://business456.example/client1
[action] http://fabrikam123.example/mail/Delete
[message id] uuid:aaaabbbb-cccc-dddd-eeee-ffffffffffff
The following example illustrates a reply message using message information header blocks in a SOAP 1.2 message:
<S:Envelope xmlns:S="http://www.w3.org/2003/05/soap-envelope" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:f123="http://www.fabrikam123.example/svc53"> <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.example/client1 </wsa:To> <wsa:Action>http://fabrikam123.example/mail/DeleteAck</wsa:Action> </S:Header> <S:Body> <f123:DeleteAck/> </S:Body> </S:Envelope>
This message would have the following property values:
[destination] http://business456.example/client1
[action] http://fabrikam123.example/mail/DeleteAck
[message id] uuid:aaaabbbb-cccc-dddd-eeee-wwwwwwwww
[relationship] (wsa:Reply, uuid:aaaabbbb-cccc-dddd-eeee-ffffffffffff)
WS-Addressing defines two mechanisms to associate an action with input, output and fault elements within a WSDL port type.
The action may be explicitly associated using the wsa:Action attribute or in the absence of the attribute the action is defined by the rule in section 3.3.2.
For example consider the following WSDL excerpt:
<definitions targetNamespace="http://example.com/stockquote" ...> ... <portType name="StockQuotePortType"> <operation name="GetLastTradePrice"> <input message="tns:GetTradePricesInput" wsa:Action="http://example.com/GetQuote"/> <output message="tns:GetTradePricesOutput" wsa:Action="http://example.com/Quote"/> </operation> </portType> ... </definitions>
The action for the input of the GetLastTradePrice operation within the StockQuotePortType is explicitly defined to be http://example.com/GetQuote. The action for the output of this same operation is http://example.com/Quote.
In the absence of the wsa:Action attribute, the following pattern is used to construct a default action for inputs and outputs. The general form of an action URI is as follows:
[target namespace]/[port type name]/[input|output name]
The "/" is a literal character to be included in the action. The values of the properties are as defined below.
[target namespace] is the target namespace (/definition/@targetNamespace). If [target namespace] ends with a "/" an additional "/" is not added.
[port type name] is the name of the port type (/definition/portType/@name).
[input|output name] is the name of the element as defined in Section 2.4.5 of WSDL 1.1.
For fault messages, this pattern is not applied. Instead, the following URI is the default action URI for fault messages:
http://schemas.xmlsoap.org/ws/2004/08/addressing/fault
For example consider the following WSDL excerpt:
<definitions targetNamespace="http://example.com/stockquote" ...> ... <portType name="StockQuotePortType"> <operation name="GetLastTradePrice"> <input message="tns:GetTradePricesInput" name="GetQuote"/> <output message="tns:GetTradePricesOutput" name="Quote"/> </operation> </portType> ... </definitions>
[targetNamespace] = http://example.com/stockquote
[port type name] = StockQuotePortType
[input name] = GetQuote
[output name] = Quote
Applying the pattern above with these values we have:
input action = http://example.com/stockquote/StockQuotePortType/GetQuote
output action = http://example.com/stockquote/StockQuotePortType/Quote
WSDL defines rules for a default input or output name if the name attribute is not present. Consider the following example:
For example consider the following WSDL excerpt:
<definitions targetNamespace="http://example.com/stockquote" ...> ... <portType name="StockQuotePortType"> <operation name="GetLastTradePrice"> <input message="tns:GetTradePricesInput"/> <output message="tns:GetTradePricesOutput"/> </operation> </portType> ... </definitions>
[targetNamespace] = http://example.com/stockquote
[port type name] = StockQuotePortType
According to the rules defined in WSDL 2.4.5, if the name attribute is absent for the input of a request response operation the default value is the name of the operation "Request" appended.
[input name] = GetLastTradePriceRequest
Likewise, the output defaults to the operation name with "Response" appended.
[output name] = GetLastTradePriceResponse
Applying the pattern above with these values we have:
input action = http://example.com/stockquote/StockQuotePortType/GetLastTradePriceRequest
output action = http://example.com/stockquote/StockQuotePortType/GetLastTradePriceResponse
The faults defined in this section are generated if the condition stated in the preamble in each subsection is met. They are sent to the [fault endpoint], if present and valid. Otherwise they are sent to the [reply endpoint] if present. If neither is present faults may be sent to the [source endpoint].
Endpoints compliant with this specification MUST include required message information headers on all fault messages. Fault messages are correlated as replies using the [relationship] property as defined in Section 3. The [action] property below designates WS-Addressing fault messages (this URI is also used as default Action value for WSDL fault messages, as described in Section 3.3.2):
http://schemas.xmlsoap.org/ws/2004/08/addressing/fault
The definitions of faults use the following properties:
[Code] The fault code.
[Subcode] The fault subcode.
[Reason] The English language reason element.
[Detail] The detail element. If absent, no detail element is defined for the fault.
The properties above bind to a SOAP 1.2 fault as follows:
<S:Envelope> <S:Header> <wsa:Action> http://schemas.xmlsoap.org/ws/2004/08/addressing/fault </wsa:Action> <!-- Headers elided for clarity. --> </S:Header> <S:Body> <S:Fault> <S:Code> <S:Value>[Code]</S:Value> <S:Subcode> <S:Value>[Subcode]</S:Value> </S:Subcode> </S:Code> <S:Reason> <S:Text xml:lang="en">[Reason]</S:Text> </S:Reason> <S:Detail> [Detail] </S:Detail> </S:Fault> </S:Body> </S:Envelope>
The SOAP 1.1 fault is less expressive and map only [Subcode] and [Reason]. These the properties bind to a SOAP 1.1 fault as follows:
<S11:Envelope> <S11:Body> <S11:Fault> <faultcode>[Subcode]</faultcode> <faultstring xml:lang="en">[Reason]</faultstring> </S11:Fault> </S11:Body> </S11:Envelope>
A message information header cannot be processed.
[Code] S:Sender
[Subcode] wsa:InvalidMessageInformationHeader
[Reason] A message information header is not valid and the message cannot be processed. The validity failure can be either structural or semantic, e.g. a [destination] that is not a URI or a [relationship] to a [message id] that was never issued.
[Detail] [invalid header]
A required message information header is absent.
[Code] S:Sender
[Subcode] wsa:MessageInformationHeaderRequired
[Reason] A required message information header, To, MessageID, or Action, is not present.
[Detail] [Missing Header QName]
The no endpoint can be found capable of acting in the role of the [destination] property.
[Code] S:Sender
[Subcode] wsa:DestinationUnreachable
[Reason] No route can be determined to reach the destination role defined by the WS-Addressing To.
[Detail] empty
The [action] property in the message is not supported at this endpoint.
The contents of this fault are as follows:
[Code] S:Sender
[Subcode] wsa:ActionNotSupported
[Reason] The [action] cannot be processed at the receiver.
[Detail] [action]
The endpoint is unable to process the message at this time either due to some transient issue or a permanent failure.
The endpoint may optionally include a RetryAfter parameter in the detail. The source should not retransmit the message until this duration has passed.
[Code] S:Receiver
[Subcode] wsa:EndpointUnavailable
[Reason] The endpoint is unable to process the message at this time.
[Detail] <wsa:RetryAfter ...>[xs:NonNegativeInteger]</wsa:RetryAfter>
The following describes the attributes and elements listed above:
It is strongly recommended that the communication between services be secured using the mechanisms described in WS-Security [WS-Security]. In order to properly secure messages, the body and all relevant headers need to be included in the signature. Specifically, the message information headers described in this specification (e.g. <wsa:To>) need to be signed with the body in order to "bind" the two together. It should be noted that for messages traveling through intermediaries, it is possible that some or all of the message information headers may have multiple signatures when the message arrives at the ultimate receiver. It is strongly recommended that the initial sender include a signature to prevent any spoofing by intermediaries.
Whenever an address is specified (e.g. <wsa:From>, <wsa:ReplyTo>, <wsa:FaultTo>, ...), the processor should ensure that a signature is provided with claims allowing it to speak for the specified target in order to prevent certain classes of attacks (e.g. redirects). As well, care should be taken if the specified endpoint contains resource properties or parameters as unverified endpoint references could cause certain classes of header insertion attacks.
The message information headers blocks may have their contents encrypted in order to obtain end-to-end privacy, but care should be taken to ensure that intermediary processors have access to required information (e.g. <wsa:To>).
Some processors may use message identifiers (<wsa:MessageID>) as part of a uniqueness metric in order to detect replays of messages. Care should be taken to ensure that a unique identifier is actually used. For example, it may be appropriate in some scenarios to combine the message identifier with a timestamp.
The following list summarizes common classes of attacks that apply to this protocol and identifies the mechanism to prevent/mitigate the attacks:
Keith Ballinger, Microsoft; Michael Coulson, Microsoft; Giovanni Della-Libera, Microsoft; Christopher Ferris, IBM; Tom Freund, IBM; Steve Graham, IBM; Christoph Hofmann, SAP; Maryann Hondo, IBM; Efim Hudis, Microsoft; John Ibbotson, IBM; Gopal Kakivaya, Microsoft; Al Lee, Microsoft; Anthony Nadalin, IBM; Bill Nagy, IBM; Martin Nally, IBM; Henrik Frystyk Nielsen, Microsoft; Vladimir Savchenko, SAP; Jeffrey Schlimmer, Microsoft; Chris Sharp, IBM; Keith Stobie, Microsoft; Vladimir Videlov, SAP; Volker Wiechers, SAP; Hervey Wilson, Microsoft;