Message exchanges

Web Services Addressing (WS-Addressing) supports these message exchanges: one-way, two-way request-response, synchronous request-response, and asynchronous request-response.

Web Services Addressing message exchanges involve message addressing properties (MAPs) and endpoint references (EPRs). If you are not familiar with MAPs and EPRs, they are introduced in the Web Services Addressing overview topic.

At run time CICS® ensures that the SOAP header of the request message contains the relevant WS-Addressing message information, the requester application does not have to set the WS-Addressing headers and might not even be aware that it is using WS-Addressing.

One-way

This straightforward one-way message is defined as an input-only operation. The web Services Description Language (WSDL) for this operation takes the following form:
<operation name="myOperation">
  <input message="tns:myInputMessage"/>
</operation>

If you are using WS-Addressing, CICS adds the <wsa:Action> MAPs and the <wsa:MessageID> MAP to the SOAP message header of the WS-Addressing request message at run time to ensure compliance with the WS-Addressing specification.

The <wsa:MessageID> MAP is a unique ID, if not specified CICS generates this ID automatically.

The <wsa:Action> MAPs are derived from the WSDL and stored in the WSBind file.

You can override the values of these MAPs using the CICS WS-Addressing API commands.

Two-way request-response

This two-way exchange involves a request message and a response message. The response part of the operation can be defined as an output message, a fault message, or both. The WSDL definition for a request-response operation takes the following form:
<operation name="myOperation">
  <input message="tns:myInputMessage"/>
  <output message="tns:myOutputMessage"/>
  <fault="tns:myFaultMessage"/>
</operation>
Responses to, or faults generated from, requests that are directed at endpoints are targeted at the <wsa:ReplyTo> MAP or the <wsa:FaultTo> MAP depending on whether the reply type is normal or a fault.

Specify a <wsa:ReplyTo> or <wsa:FaultTo> MAP in the request message to indicate where the response must be sent.

If you are using the recommendation specifications and do not specify a value for the <wsa:ReplyTo> MAP, the <wsa:ReplyTo> MAP defaults to an endpoint reference that contains the anonymous URI (http://www.w3.org/2005/08/addressing/anonymous), which causes CICS to send the response back to the requester.

If you are using the recommendation specifications and do not specify a value for the <wsa:FaultTo> MAP, the <wsa:FaultTo> MAP defaults the value of the <wsa:ReplyTo> MAP.

If the requester builds MAPs that are incorrect and that cause validation failures, CICS sends the fault message back to the requester instead of to the address specified by the <wsa:FaultTo> MAP.

Synchronous request-response

By default, the response part of a two-way message is returned according to the underlying protocol in use. In the case of an HTTP request, the response is returned synchronously in the HTTP response.
The client sends a message to the web service. The SOAP header contains the element <wsa:To>http://example.ibm.com/example/acct</wsa:To>. The web service returns a synchronous response.

Asynchronous request-response

An asynchronous response is targeted at another web service and does not arrive back at the original requester application. In the case of an HTTP request, the connection with the requesting client is closed with an HTTP 202 response. If the web service provider is running on a CICS system, the requester application will receive an empty response message. If the web service provider is running on a WebSphere MQ system, the requester application will not receive any response.

To change the destination of the response part of a two-way message, you must specify the appropriate addresses in the <wsa:ReplyTo> MAP, or the <wsa:ReplyTo> and <wsa:FaultTo>, MAPs.

The client sends a message to the web service. The SOAP header contains the element <wsa:ReplyTo>, which itself contains the element <wsa:address>http://example.ibm.com/example/action/replyEP</wsa:address>. The web service sends a response to the reply endpoint. The SOAP header of the reply message contains the element <wsa:To>http://example.ibm.com/example/action</wsa:To>.
For a full list of the MAPs that are mandatory in WSDL 1.1 and WSDL 2.0, see Mandatory message addressing properties for WS-Addressing.