Web Services Addressing message exchange patterns
The World Wide 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
<operation name="myOperation">
<input message="tns:myInputMessage"/>
</operation>
Abstract WS-Addressing MAP name, using the notational convention of the W3C XML Information Set | Description 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 WebSphere® Application Server run time automatically sets this value. |
Although the 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 request context for the JAX-WS BindingProvider object, or with the JAX-RPC Stub or Call object, as described in Specifying and acquiring message-addressing properties by using the IBM proprietary Web Services Addressing SPIs, to override the defaults.
Two-way request-response
<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>
Abstract WS-Addressing MAP name, using the notational convention of the W3C XML Information Set | Description 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. |
Abstract WS-Addressing MAP name, using the notational convention of the W3C XML Information Set | Description 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 application server run time automatically sets this property. |
Synchronous request-response
For JAX-WS synchronous invocations, if you set the reply endpoint or the fault endpoint, the endpoint reference that you set must use the anonymous URI. If the endpoint reference does not use the anonymous URI, a javax.xml.ws.WebServiceException exception is thrown. Although the endpoint reference uses the anonymous URI, you can use reference parameters within the endpoint reference to target the reply or fault endpoint.
- You do not have WS-Security enabled, or have not used an assembly tool to specify that the ReplyTo and FaultTo elements of the SOAP message should be signed. In this situation, it is possible for a JAX-WS endpoint to be used to send messages to a third party, potentially taking part in a Denial of Service attack. To prevent such attacks, specify the synchronous message exchange pattern, and enable WS-Policy so that clients are aware of this requirement.
- A JAX-WS client is communicating through a NAT device. URIs in the ReplyTo or FaultTo elements of the SOAP message cannot be routed through such a device. In this situation, the client must use the anonymous URI defined by the WS-Addressing specification, and a synchronous message exchange pattern. To ensure that the client conforms to these requirements even if the server uses WS-Policy to request a non-anonymous URI in the ReplyTo element, specify the synchronous message exchange pattern on the client.
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.
- By applying and configuring a WS-Addressing policy set. See the Configuring the WS-Addressing policy topic.
- By setting the
com.ibm.websphere.webservices.use.async.mep
property on the client request context. See the Invoking JAX-WS web services asynchronously topic. - Through the use of deployment descriptor elements, @Addressing annotations, addressing features, or by adding WS-Policy assertions into the WSDL document. See the Enabling Web Services Addressing support for JAX-WS applications topic and its child topics.
- WS-Policy sharing is enabled.
- WS-Policy
sharing is not enabled, but:
- the packaged WSDL (as retrived by an HTTP GET request) contains the relevant policy information.
- @Addressing annotations have been used in the code. In this case, the server runtime generates a WSDL document containing the WS-Policy attachments.