Start of Content Area

Procedure documentation Sending a Message  Locate the document in its SAP Library structure

Use

You can use a consumer proxy to do the following:

      To call a service using the Integration Server

      To call a Web service

How the proxy is used depends on the runtime configuration.

The programming model for ABAP proxy runtime for Web services that are developed in outside-in mode supports synchronous communication. The XI runtime also supports asynchronous communication.

Procedure

To send a message, call the corresponding consumer proxy in your application program.

Note

You can select a consumer proxy in the Object Navigator and drag it to the editor by using Drag&Drop.

 

...

       1.      Declare the following variables:

DATA:

* Reference variables for proxy and exception class
  lo_clientProxy     TYPE REF TO [Generated proxy class],
  lo_sys_exception   TYPE REF TO cx_ai_system_fault,

* Structures to set and get message content
   ls_request         TYPE [Output message type],
   ls_response        TYPE [Input message type].

       2.      Complete the structure ls_request for the request message.

       3.      Instantiate your consumer proxy.

TRY.

* create proxy client

    CREATE OBJECT lo_consumerProxy

EXPORTING LOGICAL_PORT_NAME = ‘LOGICAL_PORT_NAME’

Note

LOGICAL_PORT_NAME is the name of the logical port that you want to use, which is used to define the receiver. You can omit this parameter if you are using a default port or the XI runtime (see runtime configuration).

       4.      To send a message, call the corresponding consumer proxy method. WSDL allows several such methods (specified by the element <operation>). In XI, there is only one method, with the default name EXECUTE_SYNCHRONOUS or EXECUTE_ASYNCHRONOUS. Catch at least the exception cx_ai_system_fault:

* do synchronous consumer proxy call

    CALL METHOD lo_consumerProxy->execute_synchronous

             EXPORTING output  = ls_request
             IMPORTING input   = ls_response.

    CATCH cx_ai_system_fault INTO lo_sys_exception.

*   Error handling

ENDTRY.

Note

See also: Error Handling.

 

 

 

 

 

 

 

 

End of Content Area