Protocols
Protocols enable you to use the additional runtime services. The different runtimes support different protocols.
The ABAP proxy runtime provides protocols through classes that implement an ABAP Objects interface. You access these protocol classes differently, depending on whether the proxy is a client or server proxy (see below).
All protocol classes have the following attributes:
● They implement an ABAP Objects interface and include the interface IF_WSPROTOCOL.
● All protocol classes start with the prefix IF_WSPROTOCOL.
● For each protocol class there is a constant in the interface attributes of IF_WSPROTOCOL.
● The name of the implementing ABAP Objects interface comprises the prefix and the constant from the interface attributes.
Example
Protocol Constant in IF_WSPROTOCOL |
Corresponding Interface for the Protocol Class |
PAYLOAD |
IF_WSPROTOCOL_PAYLOAD |
To access the protocol in this example, use the protocol constant IF_WSPROTOCOL=>PAYLOAD. For an overview of all protocol classes, see the Features section of this documentation.
With consumer proxies, you access the protocol class by using their method GET_PROTOCOL . Below is an example of the IF_WSPROTOCOL_PAYLOAD protocol:
DATA:
lo_clientProxy TYPE REF
TO co_clientProxy,
lo_payload_protocol TYPE REF TO if_wsprotocol_payload
lo_payload TYPE REF
TO if_ws_payload.
CREATE OBJECT lo_clientProxy.
* Get Protocol Class Using Method GET_PROTOCOL
lo_payload_protocol ?=
lo_clientProxy->get_protocol( if_wsprotocol=>payload ).
CALL METHOD
lo_clientProxy->execute_synchronous
EXPORTING
output = ls_request
IMPORTING
input = ls_response.
* Use Protocol Methods
lo_payload = lo_payload->get_sent_request_payload( ).
Within the implementation of a provider proxy, you get the protocol class by using the CL_PROXY_ACCESS=>GET_SERVER_CONTEXT( ) method:
DATA: lo_server_context TYPE
REF TO if_ws_server_context,
lo_payload_protocol TYPE REF TO
if_wsprotocol_payload.
lo_server_context =
cl_proxy_access=>get_server_context( ).
lo_payload_protocol =
lo_server_context->get_protocol( if_wsprotocol=>payload ).
The following table provides an overview of the available protocols and which runtime each one supports:

If you use GET_PROTOCOL to request a protocol that the runtime does not support, the method raises an exception.
Supported ABAP Proxy Runtime Protocols
Protocol Constant in IF_WS_PROTOCOL |
Supported by |
Function |
|
XI Runtime |
Web Services Runtime |
||
ASYNC_MESSAGING |
Yes |
No |
Enables the quality of service Exactly-Once-in-Order in asynchronous communication and controls processing of acknowledgments. |
ROUTING |
Yes |
No |
Sets the receiver and other routing services. |
ATTACHMENTS |
Yes |
Yes |
Exchange of message attachments |
XI_HEADER |
Yes |
No |
Access to XI-specific message header fields. |
PAYLOAD |
Yes |
Only XML handling, if no query of payload |
Extended XML handling (for example, for querying initial values and xsd:nil); querying the payload. |
MESSAGE_ID |
Yes |
Yes |
Accessing the message ID for the message sent. |
SESSION |
No |
Yes |
Creating or terminating a session on the receiver side. The logon context can be maintained over multiple calls. SAP recommends that you only use this protocol in exceptional cases. |
WS_HEADER |
No |
Yes (only on the consumer side) |
Access to Web-service-specific message header fields (WS Header). |
The CL_PROXY_ACCRESS class has additional help methods that enable you to access ABAP proxy runtime objects without using a proxy instance:
Method |
Function |
GET_ACKNOWLEDGMENT |
Reads the acknowledgment status of a message by using the message ID (see Acknowledgments).. |
GET_PRE_ROUTING |
Returns an object of type IF_WS_PRE_ROUTING for a proxy class for receiver pre-identification. |
GET_PAYLOAD_HANDLER |
Returns a payload handler that you can use for rendering and parsing the XML payload. |
GET_SERVER_CONTEXT |
See above. |
Furthermore, using additional methods of the class, you can store relationships between PI messages and BOR application objects. For more information, refer to the class documentation for CL_PROXY_ACCESS (Using Object Links).