+

Search Tips   |   Advanced Search

 

Web Services Addressing message exchange patterns

 

The Worldwide Web Consortium (W3C) Web Services Addressing (WS-Addressing) specification explicitly defines the WS-Addressing core properties for the message exchange patterns (MEPs) that are defined by WSDL 1.0. These MEPs are summarized in this topic, illustrating the mandatory WS-Addressing properties for each pattern.

 

One-way MEP

This straightforward one-way message is defined in WSDL 1.0 as an input-only operation. The WSDL for this operation is of the following form:

<operation name="myOperation">
    <input message="tns:myInputMessage"/>
</operation>
The following WS-Addressing message addressing properties (MAPs) are automatically added to the message header of a one-way WS-Addressing input message by the client WAS run time, to ensure compliance with the WS-Addressing specification.

You can override these values using the WS-Addressing system programming interfaces (SPIs).

Table 1.
Abstract WS-Addressing MAP name Default value for a one-way input message
[action] The WS-Addressing [action] that is generated in accordance with the version of the WS-Addressing specification that is in use.
[reply endpoint] The WS-Addressing [reply endpoint] indicating that no replies are expected to this input message. The value of this MAP depends on the version of the WS-Addressing specification that is in use.
[message id] A uniquely generated message identifier; although not mandated by the specification. The WAS run time automatically sets this value.

Although the Web Services Description Language (WSDL) operation for this message exchange does not specify any responses, related messages can be sent as part of other message exchanges. In particular, applications can use the WS-Addressing [reply endpoint] or [fault endpoint] MAPs to indicate to the target of a one-way message where to send related messages. To propagate a [reply endpoint] or [fault endpoint], associate the appropriate property with the JAX-RPC Stub or Call, object as described in Web Services Addressing SPI, to override the defaults.

 

Two-way request-response

This is a request-response MEP as defined in WSDL 1.1. The response part of the operation might be defined as an output message, or a fault message or both. The WSDL definition for a request-response operation is, therefore, of one of the following forms:

<operation name="myOperation">
   <input message="tns:myInputMessage"/>
   <output message="tns:myOutputMessage"/>
   <fault="tns:myFaultMessage"/>
</operation>

<operation name="myOperation">
   <input message="tns:myInputMessage"/>
   <output message="tns:myOutputMessage"/>
</operation>

<operation name="myOperation">
   <input message="tns:myInputMessage"/>
   <fault="tns:myFaultMessage"/>
</operation>
The WAS client run time ensures that the SOAP header of the outgoing request message contains the relevant WS-Addressing message information headers. The calling application does not have to set the WS-Addressing headers. A response is expected, therefore specify a [reply endpoint] or [fault endpoint] in the request message.

In the 2005/08 specification, an unspecified [reply endpoint] is valid as it defaults to an endpoint reference that contains the anonymous URI. The following table summarizes the MAPs that WebSphere Application Server sets by default on a Web service request that uses WS-Addressing. You can override or specify other MAPs using the WS-Addressing SPIs.

Table 2.
Abstract WS-Addressing MAP name Default value for the input message of a request-response operation
[action] The WS-Addressing [action] that is generated in accordance with the version of the WS-Addressing specification that is in use.
[message id] A uniquely generated message identifier.

The following table summarizes the MAPs that are set by default by WAS on a WS-Addressing response or fault message.

Table 3.
Abstract WS-Addressing MAP name Default value for the input message of a request-response operation
[action] The WS-Addressing [action] that is generated in accordance with the version of the WS-Addressing specification that is in use.
[relationship]* A relationship set containing a reply relationship to the [message id] that is passed in the request message.
[message id] A uniquely generated message identifier; although not mandated by the specification, the WAS run time automatically sets this property.

 

Synchronous request-response

By default, if you do not use the WS-Addressing SPI to set the [reply endpoint] or [fault endpoint], the response part of a two-way message is returned according to the underlying protocol in use. In particular, in the case of an HTTP request, the response is returned synchronously in the HTTP response.

 

Asynchronous request-response

The JAX-RPC 1.0 programming model does not allow for asynchronous replies or faults to a two-way request-response operation. Responses to, or faults generated from, requests that are directed at endpoints hosted on WAS are targeted at the [reply endpoint] or [fault endpoint], in accordance with the WS-Addressing specification. The connection with the requesting client will be closed with an HTTP 202 response.




 

Related concepts


Web Services Addressing overview

 

Related Reference


Web Services Addressing SPI