Show TOC Start of Content Area

Procedure documentation Consuming a Stateless Web Service  Locate the document in its SAP Library structure

Use

The interface patterns stateless (XI 3.0 compatible), stateless, stateful, and TU&C/C assign the type of communication to be performed to each service interface.. Stateless communication means that the messaging runtime does not support the saving of a status at the provider once the messaging runtime has completed the message exchange successfully.

Depending on the interface pattern, the service interface editor provides you with different operation patterns and modes. Read the explanations on Interface Patterns and Operations in the documentation on the Enterprise Services Repository.

Prerequisites

      The Web service runtime is configured (for more information, refer to the section Configuring the Web Service Runtime).

      You have generated a proxy (refer also to Generating a Consumer Proxy).

      You have configured the consumer proxy.

For more information, refer to the section Configuring the Consumer Proxy.

      The role SAP_BC_WEBSERVICE_CONSUMER has been assigned to your user master record (refer to the section Authorizations).

Calling a Synchronous Service from an Application

Proceed as follows:

...

       1.      Instantiate the proxy class.

DATA: lv_<client proxy name> TYPE REF TO <client proxy name>.

CREATE OBJECT lv_<client proxy name>

  EXPORTING

     LOGICAL_PORT_NAME =

The logical port must be specified if no standard port has been agreed upon.

       2.      Fill in the displayed query data.        

DATA: lv_<request data> TYPE <request data>.

      lv_<response data> TYPE <response data>.

       3.      Call the service.

CALL METHOD lv_<client proxy name>-><name of method / operation>

EXPORTING

 INPUT = lv_<request data>

IMPORTING

 OUTPUT = lv_<response data>

       4.      Edit the received data.

LOOP AT lv_<response data>

   <process the data>

ENDLOOP.

The runtime supports protocols for the purpose of more specialist services.

Calling an Asynchronous Service from an Application

Read the section Programming with Sequences.

Testing the Client Application

You can test how the Web service behaves when it is called by an application. Select the proxy that you have generated and choose Test (F8).

 

For more information, refer to the section:

Types of Message Transmission

 

End of Content Area