Web Service Consumers

Use

To consume a Web service, you must first create a consumer proxy. The consumer proxy encapsulates communication and takes over the control of technical processes. The consumer proxy is used to create a connection to the server of the Web service required. While the developer programs the business application, the technical part - for example, the automatic packing of calls into a SOAP message or the evaluation of incoming messages - is taken care of using the proxy.

It is not of importance to a service consumer which technology is used on the side of the service provider. It is possible to use Web services from a non-SAP system, irrespective of the implementation behind it.

After consumer proxy creation, you can call the service from a program.

Features

Consuming a service comprises the following steps:

  1. Generating a Consumer Proxy

    Instead of modelling service consumers in Enterprise Services Repository and then generating proxies, you can also create service consumers directly in the ABAP back-end. If you model a service consumer in the back-end, no separate consumer proxy generation is necessary. For more information, see Creating a Service Consumer Using the Metadata Repository (MDR). You can also use the WSDL document of an external service provider to generate a consumer proxy.

    As a general guideline, you would model a Web service consumer if you have also modeled the corresponding Web service provider. If you want to consume a Web service from an external provider, you would use its WSDL document as the basis.

  2. Configuring a Service Consumer

    During proxy generation, all the objects required to call a Web service are created. During configuration, the logical port is created. This is an SAP-specific concept for the configuration of runtime features for consumer proxies. Runtime features are features that must be configured in the runtime environment when the service consumer is activated. So, for example, the logical port contains the URL address to be used for calling the service.

    For more information, refer to the section Configuring a Consumer Proxy (SOA Manager). Read also the section entitled Working with Service Groups.

  3. Calling a Service from an Application

    During proxy generation, a proxy class as well as data types for parameter transmission are generated.

Using the outside-in approach, you develop the Web service in the ES Repository or in the ABAP back-end. Choosing an interface pattern when modeling a service interface determines which programming model and which Web service processing type is to be used.

The Interface patterns section covers the following areas:

Consuming A Stateless Web Service

Consuming A Stateless Web Service (XI 3.0 compatible)

Consuming A Stateful Web Service

Consuming a TU&C/C Web Service

While the Stateless and TU&C/C interface patterns can be used with both synchronous and asynchronous communication, Stateful and Stateless (XI 3.0 compatible) interface patterns only support synchronous communication.

More Information

Types of Message Transmission

You can use a mapping mechanism on consumer side for the consumption of different services for the same purpose. For more information, see Working with Consumer Mappings.