Protocols
Protocols enable you to use the additional services of ABAP proxy runtime, which go beyond the simple exchange of synchronous messages. The different runtimes support different protocols.
ABAP proxy runtime provides protocols by means of classes, which implement an ABAP object 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 object interface and include the interface IF_WSPROTOCOL.
● All protocol classes have 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 object 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.
In client proxies, you access the protocol class by using the GET_PROTOCOL method. Below is an example for 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 server 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 CL_PROXY_ACCESS class has help methods that enable you to access ABAP proxy runtime objects without using a proxy instance:
Method |
Use |
GET_ACKNOWLEDGMENT |
Reads the acknowledgment status of a message by using the message ID (see: Acknowledgments) (XI only). |
GET_PRE_ROUTING |
Returns an object of type IF_WS_PRE_ROUTING for a proxy class for receiver pre-identification (XI only). |
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 XI messages and BOR application objects. For more information, see the class documentation for CL_PROXY_ACCESS (Using Object Links).
Before you can use a protocol you must decide whether you want to use the XI runtime or the Web service runtime. Provided that you only use protocols that support both runtimes, the application program does in fact support both runtimes. In both cases the customer must make the necessary configuration settings (see: Runtime Configuration), before messages can be exchanged.
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 |
Use |
|
XI Runtime |
Web Service 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 |
Setting the receiver and other routing services. |
ATTACHMENTS |
Yes |
No |
Exchanging message attachments |
XI_HEADER |
Yes |
No |
Accessing XI-specific message header fields. |
PAYLOAD |
Yes |
Yes |
Extended XML handling (for example, for querying initial values and xsd:nil); querying the payload. |
MESSAGE_ID |
Yes |
Yes (if configured) |
Querying the message ID for the message sent. |
SESSION |
No |
Yes (if supported by service) |
Creating or terminating a session at the receiver. The logon context can be maintained over multiple calls. SAP recommends that you only use this protocol in exceptional cases. |
WS_HEADER |
No |
Yes |
Accessing Web-service-specific message header fields (WS Header). |