SAP PI integration with Salesforce.com REST API


Scenario

Whenever a customer master is created or changed, a message is sent to Salesforce to create new account or to update an existing account. This simple scenario possesses three important challenges that cannot be easily addressed with the standard SAP PI adapters.

This blog describes how these challenges can be handled by the Advantco REST adapter with minimal or zero development effort.

Challenge 1: XML <-> JSON conversion.

The Salesforce REST API exchanges data in JSON (JavaScript Object Notation) format. This means that we need to convert the internal SAP PI XML data presentation to JSON before sending it to Salesforce. This can be done by developing a custom adapter module or using java mapping. This is cumbersome as there are many use cases that need to be covered by the custom development. The Advantco REST adapter supports XML <-> JSON out of the box by simple declarative conversion rules.

Converting XML to JSON in the request to Salesforce.com

Converting JSON to XML in the response from Salesforce.com

Challenge 2: Dynamic URL construction.

In the scenario above, in case of an update, the Salesforce URL must be constructed dynamically based on the Salesforce’s accountID. The accountID is part of the DEBMAS idoc data and must be retrieved and added to the URL. The Advantco REST adapter handles this by using the Variable Substitution feature to retrieve the data and use that in the URL field. The Advantco REST adapter supports also URL parameters and custom header fields.

Constructing the account object URL dynamically

Challenge 3: Authentication with Open Authorization (OAuth).

Salesforce uses OAuth for user authentication and authorization. This can be done in standard SAP PI with help of BPM to make a call to retrieve access code and to make a call to access a particular object. The Advantco REST adapter handles OAuth with very simple configuration in the channel itself. This removes the need to create complex constructs just to log into the Salesforce server.

OAuth authentication configuration

Summary

REST API integration with cloud applications can be complex due to the specific requirements like message conversion, dynamic URL construction and OAuth authorization. These requirements can be handled by custom developments or by using the Advantco REST adapter.

Please reach out to our sales team at sales@advantco.com if you have any questions.