You can use a client proxy to do the following:
· To call a service using the SAP XI Integration Server
· To call a Web service
How the server proxy is used depends on the runtime configuration.
Customers that do not have SAP XI Release 3.0 or higher installed cannot access the Integration Repository or exchange messages directly using XI.
The general programming model of the ABAP proxy runtime supports synchronous communication. The XI runtime also supports asynchronous communication.
To send a message using the ABAP proxy runtime, call the corresponding client proxy in your application program.
You can select a client 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 client proxy.
TRY.
* create proxy client
CREATE OBJECT lo_clientProxy( ‘LOGICAL_PORT_NAME’ ).
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 client 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 client proxy call
CALL METHOD lo_clientProxy->execute_synchronous
EXPORTING
output = ls_request
IMPORTING
input = ls_response.
CATCH cx_ai_system_fault INTO lo_sys_exception.
* Error handling
ENDTRY.
See also: Error Handling.