3.1.4.1 SEND_CM

The SEND_CM event MUST be signaled by the higher-layer business logic with the following arguments:

  • The Client Message argument.

  • The Protocol argument with two possible values: HTTP or SOAP.

  • The ServerMessageExpected argument with two possible values: true or false.

If the SEND_CM event is signaled, the client role implementation MUST perform the following actions:

  • If the Context Identifier Store contains an empty value:

    • Send the client message to the server role by using the underlying transport protocol.

    • Set the State field to WAIT_CORRELATED_SM.

  • Otherwise:

    • Transform the client message to a Context Participating Message by performing the following steps:

      • If the Protocol value is HTTP and the client message is an HTTP request message [RFC2616]:

        • Create an HTTP Client Message Header that is isomorphic with the value of the Context Identifier Store.

        • Add the HTTP Client Message Header to the client message.

      • Else if the Protocol value is SOAP and the client message is a SOAP envelope:

        • Create a CONTEXT_XML element that is isomorphic with the value of the Context Identifier Store.

        • Add the CONTEXT_XML element to the client message as a SOAP header.

      • Otherwise:

        • Return an implementation-specific failure result to the higher-layer business logic.

    • Send the Context Participating Message to the server role by using the underlying transport protocol.

    • If the ServerMessageExpected value is true:

      • Set the State field to WAIT_SM.