This blog will provide a step-by-step guide on how to configure sender REST adapter scenario in SAP PI.This document will help PI developer/consultant who will like to learn about Sender REST adapter configuration.
I will explain this by creating simple asynchronous scenario REST –> PI –> File. usually, REST will be used for sync scenario but to provide
Usually, REST will be used for sync scenario but to provide a basic understanding of how to configure REST adapter I am using Async.
Rest enabled application will send JSON format to SAP PI which will be converted into XML using REST Adapter.
Step 1: Create ESR objects and mapping
I am not going to show each object but create a simple Data Type for learning.
Create following objects
- Data Type
- Message Type
- Async Service interface Inbound/Outbound
- Message Mapping
- Operation Mapping
Step 2: Create configuration objects
I am using Iflow so basically, it will look like below
PI version used in 7.5
Sender REST Adapter configuration
Configure general tab
Convert to XML need to be enabled.
Log JSON message is enabled so this will log the JSON format in PI monitoring.This is an optional parameter.
Add Wrapper Element is basically a message type name which was created in Step 1.
Channel Selection is EndPoint configuration any name can be given here.
In this case, end point will look like
REST Resource tab
REST Operation tab
Now configure Receiver channel in this case I have used NFS to write file locally.
Step 3: Testing of REST Adapter scenario
Testing can be done by using SOAP GUI, Chrome REST adapter etc.
I am using Chrome REST adapter client which is very light weight app
Download using below link
Once downloaded open the client and configure as shown below and hit the SEND button.
if the request is successfully processed to PI it will show 202 accepted.
Now going to target file system if file is created
XML will look like
Read More about REST adapter