Skip to main content /*FB SDK ------VK */
/* FB End*/

REST Adapter scenario in SAP PI – JSON/XML

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 Adapter scenario in SAP PI

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

Mapping

Step 2: Create configuration objects

I am using Iflow so basically, it will look like below

PI version used in 7.5

IFlow

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.

REST Adapter

Channel Selection is EndPoint configuration any name can be given here.

In this case, end point will look like

http://:/RESTAdapter/test/

REST Adapter

REST Resource tab

REST Adapter

REST Operation tab

REST Adapter

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

Chrome REST Adapter Client

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.

Chrome Rest Client

 

Now going to target file system if file is created

Target Folder

XML will look like

Read More about REST adapter

https://blogs.sap.com/2014/12/18/pi-rest-adapter-blog-overview/

 

 

One thought on “REST Adapter scenario in SAP PI – JSON/XML

  1. Thanks for the explanation.
    I have a requirement of changing existing SOAP scenario to REST .
    Can you give an idea hoe to approach for the development.

Leave a Reply

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