Show TOC

Procedure documentationSending a Message Locate this document in the navigation structure

 

You can use a consumer proxy to do the following:

  • To call a service through the Integration Server

  • To call a Web service

How the server proxy is used depends on the runtime configuration.

Procedure

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

Note Note

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

End of the note.
  1. Declare the following variables:

    DATA:

    * Reference variables for proxy and exception class

       lo_clientProxy TYPE REF TO [generierte Proxy-Klasse],

       lo_sys_exception TYPE REF TO cx_ai_system_fault,

    * Structures to set and get message content

       ls_request TYPE [Output-Message-Typ],

       ls_response TYPE [Input-Message-Typ].

  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 Note

      LOGICAL_PORT_NAME is the name of the logical port that you want to use> it is also used to define the receiver. You can omit this parameter if you are using a default port or the PI runtime (refer to Runtime Configuration).

      End of the note.
  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 Note

    Refer also to: Error Handling.

    End of the note.