Querying the XI Message Header
Use
Using this protocol you can query the fields of the message header after a proxy call.
Integration
You can also query the fields of the message header during a mapping or by using technical context objects in the Integration Directory. See also: Container Object (message mappings), Java Mapping , XSLT Mapping .
Features
Using the Protocol Depending on the Call Situation
| Proxy Call | Readable Message Header |
|---|---|
|
Asynchronous proxy call at sender |
Message header of request message |
|
Synchronous proxy call at sender |
Message header of response message |
|
Synchronous/asynchronous proxy call at receiver |
Message header of request message |
Fields in Message Header
The GET_HEADER_FIELD method returns the value of a field in the message header as a string. There is a constant in the IF_WSPROTOCOL_XI_HEADER interface for each readable field of the message header.
Accessing Message Header Fields by Using Constants
| Constant | Meaning |
|---|---|
|
MESSAGE_CLASS |
Classification of message. Possible values:
|
|
VERSION_MAJOR |
XI message protocol version. Example: For the XI 3.0 message protocol VERSION_MAJOR = 3 and VERSION_MINOR = 0. |
|
VERSION_MINOR |
|
|
PROCESSING_MODE |
The mode of a message can be synchronous or asynchronous. Correspondingly, these constants can have the value synchronous or asynchronous. |
|
MESSAGE_ID |
The message ID. It can change during communication: Response messages get a new message ID. If new messages result from a message (the message is copied at multiple receivers), the new messages get new message IDs. |
|
REF_TO_MESSAGE_ID |
The ID of a referenced message that belongs semantically to this message.For example, a response message uses this field to note which request message it belongs to. |
|
CONVERSATION_ID |
This field is not mandatory in the message. It enables an ID to be used to group messages that belong together. This field is not intended to be used for message serialization and has nothing to do with the serialization context (see context object QueueId). |
|
TIME_SENT |
Time stamp specifying when the message was sent by the sender. The format of the time stamp is as follows: YYYY-MM-DDTHH:MM:SSZ The letter 'T' separates the date from the time, which is generally specified in UTC. If it is a local time, the closing 'Z' is omitted. |
|
INTERFACE |
Name of the sender interface. |
|
INTERFACE_NAMESPACE |
Namespace of the sender interface. |
|
SENDER_PARTY |
Communication party that sent the message. |
|
SENDER_PARTY_AGENCY |
Issuing agency for the message sender. |
|
SENDER_PARTY_SCHEME |
Identification scheme used by the sender. |
|
SENDER_SERVICE |
Service on the sender side that sent the message.For example, the name of a business system. |
|
RECEIVER_PARTY |
Communication party to receive the message. |
|
RECEIVER_PARTY_AGENCY |
Issuing agency for the message receiver. |
|
RECEIVER_PARTY_SCHEME |
Identification scheme used by the receiver. |
|
RECEIVER_SERVICE |
Service on the receiver side that receives the message. For example, the name of a business system. |
|
QUALITY_OF_SERVICE |
Specifies the quality of service used to process the message. Possible values are BestEffort, ExactlyOnce, or ExactlyOnceInOrder. |
|
QUEUE_ID |
Only relevant for QUALITY_OF_SERVICE = "ExactlyOnceInOrder". The value in this field corresponds to the serialization context that a sender uses to bundle related asynchronous messages (see also: ABAP runtime, Java proxy runtime). |
The following message header fields are only relevant for MessageClass="ApplicationMessage" and ProcessingMode="asynchronous"(see above). They can have the Boolean value true or false. See also: Acknowledgments .
Fields of the Message Header for Acknowledgments
| Constant | Meaning |
|---|---|
|
SYSTEM_ACK_REQUESTED |
If the value of this field is true, the sender requested a positive system acknowledgment. |
|
SYSTEM_ERROR_ACK_REQUESTED |
If the value of this field is true, the sender requested a negative system acknowledgment. |
|
APPLICATION_ACK_REQUESTED |
If the value of this field is true, the sender requested a positive application acknowledgment. |
|
APPLICATION_ERROR_ACK_REQUESTD |
If the value of this field is true, the sender requested a negative application acknowledgment. |
Example
In the following example, the IF_WSPROTOCOL_XI_HEADER protocol is used to access the MESSAGE_CLASS field in the message header of the response message at the receiver.
DATA: interface TYPE REF TO co_sxidag_fsa_query, request TYPE sxidag_fsa_query_mt, response TYPE sxidag_fsa_response_mt, xi_header_protocol TYPE REF TO if_wsprotocol_xi_header, xi_header_value TYPE string.
* create instanceCREATE OBJECT interface
* fill request datarequest-flight_seat_availability_query-flight_id-airline_id = 'LH'.
TRY.
* get xi_header protocol xi_header_protocol ?= interface->get_protocol( if_wsprotocol=>xi_header ).
* call client proxy CALL METHOD interface->execute_synchronous EXPORTING output = request IMPORTING input = response.
* get header field xi_header_value = xi_header_protocol->get_header_field( if_wsprotocol_xi_header=>message_class ).
CATCH cx_ai_system_fault . CATCH cx_ai_application_fault .
ENDTRY.