Skip to Content
avatar image
Former Member

Proxy to Rest - Facing Problem while passing the data through Communication channel to REST API.

Hi SAP Experts,

I am configuring SAP Proxy to Rest API Scenario through SAP PI.

In this configuration, I have a problem with passing Header & body parameters value to Rest API.

How should I configure Communication channel for Receiver Rest Adapter?

API URL à http://xxxx:3000/merchant/generate_token

API Parameters à

Request -- Header -> secret_key , Body -> merchant_id

Response-- access_token

req.png (25.9 kB)
req1.png (24.4 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Apr 06, 2017 at 01:04 AM

    Hi Kunal,

    You can use the HTTP Headers section of REST channel to configure the HTTP header parameters, as per your screenshot.

    Regarding the Body, check the raw payload and you could always write a simple java map to create the output in the format that raw data looks like in Postman.

    Regards,

    Sanjeev

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Sanjeev

      Thanks for reply.

      I don't have 'HTTP Header' Tab as we are on the older service pack (SP - 9) therefore i have done some changes in API by adding both the parameters in HTTP Body as shown in below screen shot.

      Can you please help me to write the java code for mapping the parameters i.e. to convert XML to JSON for request and JSON to XML for response.

      Thanks & Regards,

      Kunal

      .

      api.png (40.1 kB)