Ws - Addressing: References and Message Information Headers
Ws - Addressing: References and Message Information Headers
1. Introduction
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.
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).
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/>).
1.2. 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
2. Endpoint References
This section defines the model and syntax of an endpoint reference.
<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:
/wsa:EndpointReference
This represents some element of
type wsa:EndpointReferenceType. This example uses the
predefined <wsa:EndpointReference> element, but any element
of type wsa:EndpointReferenceType may be used.
/wsa:EndpointReference/wsa:Address
This REQUIRED element (of type xs:anyURI) specifies the
[address] property of the endpoint reference. This address may be a
logical address or identifier for the service endpoint.
/wsa:EndpointReference/wsa:ReferenceProperties/
This OPTIONAL element contains the elements that convey the
[reference properties] of the reference.
/wsa:EndpointReference/wsa:ReferenceProperties/{any}
Each child element of ReferenceProperties represents an individual
[reference property].
/wsa:EndpointReference/wsa:ReferenceParameters/
This OPTIONAL element contains the elements that convey the
[reference parameters] of the reference.
/wsa:EndpointReference/wsa:ReferenceParameters/{any}
Each child element of ReferenceParameters represents an individual
[reference parameter].
/wsa:EndpointReference/wsa:PortType
This OPTIONAL element (of type xs:Qname) specifies the value of
the [selected port type] property of the endpoint reference.
/wsa:EndpointReference/wsa:ServiceName
This OPTIONAL element (of type xs:QName) specifies
the <wsdl:service> definition that contains a WSDL description of
the endpoint being referenced.
/wsa:EndpointReference/wsa:ServiceName/@PortName
This OPTIONAL attribute (of type xs:NCName) specifies the name of
the <wsdl:port> definition that corresponds to the endpoint being
referenced.
/wsa:EndpointReference/wsp:Policy
This OPTIONAL element specifies a policy that is relevant to the
interaction with the endpoint.
/wsa:EndpointReference/{any}
This is an extensibility mechanism to allow additional elements to be
specified.
/wsa:EndpointReference/@{any}
This is an extensibility mechanism to allow additional attributes to be
specified.
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:
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>
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 two endpoints accept the same sets of messages, and follow
and require the same set of policies. That is, the XML Schema,
WSDL, and WS-Policy metadata applicable to the two references are
the same.
In particular, the policies applicable to the two endpoints are the
same regardless of the values of the embedded [policy]. Embedded
policies are not authoritative and may be stale or incoherent with the
policies associated with the endpoint.
The properties below support one way, request reply, and any other
interaction pattern:
QName Description
http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous
The following describes the attributes and elements listed in the schema
overview above:
/wsa:MessageID
This OPTIONAL element (of type xs:anyURI) conveys the
[message id] property. This element MUST be present if
wsa:ReplyTo or wsa:FaultTo is present.
/wsa:RelatesTo
This OPTIONAL (repeating) element information item contributes one
abstract [relationship] property value, in the form of a (URI, QName)
pair. The [children] property of this element (which is of
type xs:anyURI) conveys the [message id] of the related message.
This element MUST be present if the message is a reply.
/wsa:RelatesTo/@RelationshipType
This OPTIONAL attribute (of type xs:QName) conveys the
relationship type as a QName. When absent, the implied value of this
attribute is wsa:Reply.
/wsa:ReplyTo
This OPTIONAL element (of type wsa:EndpointReferenceType)
provides the value for the [reply endpoint] property. This element
MUST be present if a reply is expected. If this element is present,
wsa:MessageID MUST be present.
/wsa:From
This OPTIONAL element (of type wsa:EndpointReferenceType)
provides the value for the [source endpoint] property.
/wsa:FaultTo
This OPTIONAL element (of type wsa:EndpointReferenceType)
provides the value for the [fault endpoint] property. If this element is
present, wsa:MessageID MUST be present.
/wsa:To
This REQUIRED element (of type xs:anyURI) provides the value for
the [destination] property.
/wsa:Action
This REQUIRED element of type xs:anyURI conveys the [action]
property. The [children] of this element convey the value of this
property.
<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:[email protected]</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>
[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>
[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)
The "/" is a literal character to be included in the action. The values of the
properties are as defined below.
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
[targetNamespace] = http://example.com/stockquote
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:
[targetNamespace] = http://example.com/stockquote
input action =
http://example.com/stockquote/StockQuotePortType/GetLastTradePrice
Request
output action =
http://example.com/stockquote/StockQuotePortType/GetLastTradePrice
Response
4. Faults
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].
http://schemas.xmlsoap.org/ws/2004/08/addressing/fault
<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>
[Subcode] wsa:InvalidMessageInformationHeader
[Detail] [invalid header]
[Code] S:Sender
[Subcode] wsa:MessageInformationHeaderRequired
[Code] S:Sender
[Subcode] wsa:DestinationUnreachable
[Detail] empty
[Code] S:Sender
[Subcode] wsa:ActionNotSupported
[Detail] [action]
The endpoint is unable to process the message at this time either due to
some transient issue or a permanent failure.
[Code] S:Receiver
[Subcode] wsa:EndpointUnavailable
[Detail] <wsa:RetryAfter ...>[xs:NonNegativeInteger]</wsa:RetryAfter>
/wsa:RetryAfter
This element (of type xs:NonNegativeInteger) is a suggested
minimum duration in milliseconds to wait before retransmitting the
message. If this element is omitted from the detail, the value is
infinite.
/wsa:RetryAfter/@{any}
These optional extensibility attributes do not affect processing.