Sender REST Adapter with Polling in SAP PI

The blog will explain how to configure the sender REST adapter with polling mode to pull the data from remote REST APIs. The sender REST adapter in polling mode has been supported since release SAP PI 7.31 SP16 / 7.4 SP11.

We will take a simple example to do a GET operation to extract the API.

Scenario:

Let’s poll the timezone of a particular country every 1 min and create a file. In this case below API will be used for pooling.

https://timezonedb.com/references/list-time-zone

Read More

Error Handling in REST Adapter – SAP PI

This blog will show how to do error handling in REST Adapter. The REST adapter supports Custom Error Handling when used as Sender or receiver.

You can use a custom error handling to define how the adapter will react to certain error codes with custom result messages. Besides, you can create error conditions based on the content of the message data.

In this example when PI will have a mapping error, it will send the custom message as a response to the user. This is simple error handling but it should be good to understand the mechanism.

Read More

REST Adapter with Multiple Operations in SAP PI

This blog will show how to use REST Adapter with Multiple operations in SAP PI. Here we will expose the API with multiple operations for which REST sender will be used.

Flow:

REST Adapter with Multiple Operation Flow

As shown in flow diagram PI will expose the REST API with 2 operation addition & subtraction.

I will recommend going through the Sync/Async scenario using the REST adapter before starting into multiple operation configurations using the REST adapter. That will provide a good REST adapter background.

Async Scenario using REST Adapter Scenario in SAP PI

Sync Scenario using REST adapter in SAP PI

Read More

Sync Scenario using REST adapter in SAP PI – Part II

This blog is a continuation of the sync scenario using the REST adapter in SAP PI. Here we will cover the configuration steps for JSON format.

In case you want to read about XML format here is a link to 1st part of this blog Sync Scenario using REST adapter in SAP PI – Part I

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 it simple we will only work with add operation, for multiple operation check this guide REST Adapter with Multiple Operations in SAP PI

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

Read More

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

Read More

XML to JSON conversion in REST adapter SAP PI

This blog will explain how to handle XML to JSON conversion in REST adapter. Here we will cover enhanced REST adapter settings to handle array – repeated segments.

How REST Adapter converts

REST adapter uses 3rd party Jettison library for JSON processing tasks. It is used for conversion of XML to JSON & vice-versa and sometime it does not correlate or take into consideration payload field properties as defined in a corresponding message type, but has its own optimization and type derivation mechanisms that are based on nature of the value of a processed XML document’s element rather than XSD schema of a processed message.

As a result, sometime conversion are not correct especially in case of XML element as an array.

Read More

REST Adapter scenario in SAP PI – JSON/XML

This blog will provide a step-by-step guide on how to configure the sender REST adapter scenario in SAP PI. This document will help the PI developer/consultant who will like to learn about the Sender REST adapter configuration.

I will explain this by creating a simple asynchronous scenario REST –> PI –> File. usually, REST will be used for sync scenario but to provide

Usually, REST will be used for sync scenarios but to provide a basic understanding of how to configure REST adapter I am using Async.

In case you are interested in sync scenario here is a step by step guide Sync Scenario using REST adapter in SAP PI

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.

Read More