Sender REST Adapter Scenario in SAP PI – Part I

This blog will cover the step-by-step guide on how to create the Sender REST Adapter Scenario in SAP PI. It will cover all the configuration steps of the sender REST adapter.

Scenario :

REST adapter can be used for consuming a REST service or exposing a REST service in PI. This blog will cover only exposing of REST service for which Sender REST Adapter will be used.

Flow:

REST<–> SAP PI<–>SOAP ( calculator service)

It will be a synchronous scenario where the request will send to PI and response will be received based on the operation (Add, Sub, Divide or multiple).

To keep everything simple in this blog I will cover only Add operation and next blogs I will show how to use multiple operations in the REST adapter.

In case you are looking for Async example here is a step by step guide REST Adapter scenario in SAP PI – JSON/XML

ESR Configuration

Download the WSDL from the link below

Calculator WSDL — http://www.dneonline.com/calculator.asmx?WSDL

Import the WSDL in the external definition.

REST Adapter in SAP PI

Create all the ESR objects as shown below.

not covering these in detail as these are are simple objects.

Configuration:

Create Sender REST adapter.

Let’s select the format as XML and later we will cover JSON format as well.

Channel Selection tab

specify the endpoint, this will be important as this will define the API service URL.

The PI REST endpoint is defined as below:

http://host:port/RESTAdapter/<endpoint value>

where <endpointvalue> will be replaced with the value defined in the adapter. In the below case, it will be add.

URL will look like http://host:port/RESTAdapter/add

REST resource tab

REST Operation:

This is a place where we will specify operation GET, POST and so on.

Create a SOAP Receiver adapter.

Enter the URL and SOAP action.

To find the details refer to the WSDL above.

Final step create the ICO

Test the Scenario

SOAP GUI or any REST client can be used here.

Input Payload

For JSON format check the Part II – Sync Scenario using REST adapter in SAP PI – Part II

You may also like:

Async scenario using REST Adapter in SAP PI/PO

Error Handling REST Adapter – SAP PI

SAP Reference : https://help.sap.com/doc/saphelp_nw75/7.5.5/en-US/c8/0bd82a4a4c4408925110371b9a7643/content.htm?no_cache=true

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.