Show TOC

Function documentationProtocols Locate this document in the navigation structure

 

With protocols, you can use additional runtime services. The different runtimes support different protocols.

Integration

The ABAP runtime provides protocols through classes that implement an ABAP object interface. You access these protocol classes differently, depending on whether the proxy is a provider or consumer proxy.

For more information about ABAP object interfaces, see Interfaces.

Naming Conventions

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 implemented ABAP Objects interface comprises the prefix and the constant from the interface attributes.

Example Example

The protocol constant in IF_WSPROTOCOL is PAYLOAD. The corresponding interface for the protocol class is IF_WSPROTOCOL_PAYLOAD.

To access the protocol in this example, use the protocol constant IF_WSPROTOCOL=>PAYLOAD.

End of the example.
Supported ABAP Proxy Runtime Protocols

The following table provides an overview of the available protocols and the supported runtimes. Consider that if you use GET_PROTOCOL to request a protocol that the runtime does not support, the method raises an exception.

Protocol Constant in IF_WS_PROTOCOL

Supported by XI Runtime (Interface Pattern XI 3.0-compatible)

Supported by Web Service Runtime

Use

More information

ASYNC_MESSAGING

Yes

No

Enables the quality of service Exactly Once in Order in asynchronous communication and controls processing of acknowledgments.

Asynchronous Communication

ROUTING

Yes

No

Setting the receiver and other routing services.

Routing

ATTACHMENTS

Yes

Yes

Exchanging message attachments.

Attachments

XI_HEADER

Yes

No

Accessing XI-specific message header fields.

Querying the XI Message Header

PAYLOAD

Yes

Only XML handling, no query of payload

Extended XML handling, for example, for querying initial values and xsd:nil. You can also use it for querying the payload.

Activating Extended XML Handling

Querying the Payload

MESSAGE_ID

Yes

Yes (if configured)

Accessing the Message ID for the message sent.

Accessing the Message ID

SESSION

No

Yes (for services with interface-pattern stateful)

Creating or terminating a session on the receiver side with synchronous communication The logon context can be maintained over multiple calls.

We recommend that you only use this protocol in exceptional cases.

WS_HEADER

No

Yes (only on the consumer side)

Accessing Web service-specific message header fields (WS_Header).

WS_HEADER

Features

Accessing Protocol Classes for Consumer Proxies

With consumer proxies, you access the protocol class using their method GET_PROTOCOL. Below is an example for the IF_WSPROTOCOL_PAYLOAD protocol:

Syntax Syntax

  1. DATA:
  2.   lo_clientProxy TYPE REF TO co_clientProxy,
  3.   lo_payload_protocol TYPE REF TO if_wsprotocol_payload
  4.   lo_payload        TYPE REF TO if_ws_payload.
  5. CREATE OBJECT lo_clientProxy.
  6. *Get Protocol Class Using Method GET_PROTOCOL
  7.   lo_payload_protocol ?= 
  8.   lo_clientProxy->get_protocol( if_wsprotocol=>payload ).
  9. CALL METHOD lo_clientProxy->execute_synchronous
  10.   EXPORTING output  = ls_request
  11.   IMPORTING input   = ls_response.
  12. *Use Protocol Methods
  13.   lo_payload = lo_payload->get_sent_request_payload( ).
End of the source code.
Accessing Protocol Classes for Provider Proxies

Within the implementation of a provider proxy, you obtain the protocol class by using the CL_PROXY_ACCESS=>GET_SERVER_CONTEXT( ) method:

Syntax Syntax

  1. DATA:
  2.   lo_server_context TYPE REF TO if_ws_server_context,
  3.   lo_payload_protocol TYPE REF TO if_wsprotocol_payload.
  4. lo_server_context   = cl_proxy_access=>get_server_context( ).lo_payload_protocol = 
  5. lo_server_context->get_protocol( if_wsprotocol=>payload ).
End of the source code.
Accessing Protocol Classes Regardless of the Proxy Instance (XI Runtime)

The CL_PROXY_ACCESS class provides additional help methods that enable you to access ABAP proxy runtime objects even without using a proxy instance:

Method

Use

More information

GET_ACKNOWLEDGMENT

Reads the acknowledgment status of a message by using the message ID.

Acknowledgments

GET_PRE_ROUTING

Returns an object of type IF_WS_PRE_ROUTING for a proxy class for receiver preidentification.

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, see the class documentation for CL_PROXY_ACCESS (Using Object Links).