Developing a Web Service Using the Enterprise Services Repository (Outside-In)
Use
You create an outside-in service by performing the following steps:
-
Modeling in the Enterprise Services Repository
-
Creating the interface
-
Implementing the application logic
-
Configuring the Web Service
We distinguish between the following processing types for methods of Web services:
-
Synchronous
-
Asynchronous
More information: Types of Message Transmission.
Prerequisites
The Web service runtime has been configured (refer to Configuring the Web Service Runtime).
The Web service has been modelled in the Enterprise Services Repository (ESR).
You have activated the Enterprise Services Browser in the ABAP Workbench. You can also call the browser in transaction SPROXY.
The user is assigned the relevant Authorizations.
Procedure
-
Generate a provider proxy.
While the service modeling takes place centrally in the ES Repository, the proxy generation and subsequent service implementation is done in a specific back-end. Before the corresponding Web service proxy is generated, the developer has to decide in which system the proxy is to be generated. Afterwards, he or she starts the proxy generation locally in this system. This transfers the entities from the ES Repository into the local system. The resulting proxies are stored in the back-end. The proxies can be used independent of of the ES Repository. The connection to the ES Repository is only required for generation, re-generation, and for checking the proxies against the ES Repository.
Call transaction SPROXY, select the inbound service interface, and choose Create Proxy from the context menu. Enter the name of a package. (Refer to Working with ABAP Proxies).
The service definition is automatically generated during proxy generation.
After generation, the provider proxy contains methods for each service operation.
-
Fill the operations with the required logic.
In the Properties tab of the service interface, click the name of the provider class, and then specify the method name in order to get to the editor. You then implement the provider proxy.
-
Create a runtime configuration for the provider proxy. In the proxy editor, choose Start SOA Manager. For more information, refer to Configuring a Service Provider (from point 5 onwards).
-
Test your service in the Web Service Navigator.
Select the service definition in the Object Navigator (Transaction SE80) and choose Start Web Service Navigator. Make sure that a connection to the Web Service Navigator has been set up (refer to Setting Up the WS Navigator). If the service has not yet been configured, a standard configuration is created before starting the Web Service Navigator. In this case, choose the appropriate pushbutton.
More information: Testing a Service.
Result
An endpoint exists that can be used to call the Web service.
The provider proxy comprises the following:
-
An ABAP proxy interface
-
An implementing class that implements the proxy interface
The implementing class contains the operations that were modeled in the Enterprise Services Repository as methods.
A template for the implementing class is created during proxy generation. A developer must add the appropriate application code to the implementing class. The ABAP proxy interface is generated and cannot be changed.
Example
Below is an example of an implementation of a method that returns an echo of imported data:
METHOD ZMY_II_SYNCHRON_INBOUND_INTERF~EXECUTE_SYNCHRONOUS.
**** INSERT IMPLEMENTATION HERE ****
OUTPUT-RESPONSE_MESSAGE_TYPE-SIMPLE = INPUT-REQUEST_MESSAGE_TYPE-SIMPLE.
ENDMETHOD.