Skip to Content
avatar image
Former Member

REST Client - REST Server Synchronous Communication - with Lookup


I have scenario where the Message flow is from REST Client to REST Server Synchronous GET. However, In between I need to do another REST GET call to other server from PI to enhance the message from the HTTP Response Header value ( as shown in the diagram). As I have tried, it seems to be not possible through BPM as the sender is synchronous and all the calls are synchronous in nature. Let me know if this is not the case and still possible with BPM ?

Also, I have referred the below blog on REST lookup. However, the values are consumed from HTTP body and it seems we can't read the values from the http response header through the lookup mapping ?

Reuqest your inputs please.

rest-interface.jpg (64.1 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Jan 02, 2018 at 07:18 AM

    I was in the same situation

    in my case I created new interface proxy to rest sync scenario. after getting the response, i triggered the main interface.

    Normally, header data will come in the dynamic header of sap pi message. you have to read it via udf/java map. you can apply this first two points.

    you have below options.

    1. Ask the rest client itself to make a call to the look up service and get the data.

    2. If point 1 is not possible, create two interfaces, one is for lookup and main. Ask the rest client to call lookup interface first, after that they can call second interface.

    3. create java mapping or UDF to call the rest service by directly constructing url. The call will be made without using adapter.bear in mind that you have to make the url and other connections parameters dynamic. ie need to use parameterized mapping

    you can check the sample code in below blog.this is for put operation, you can search how to make a call for get operation and read the incoming header data.

    4.create an adapter module to make a call to rest lookup service.



    Add comment
    10|10000 characters needed characters exceeded

    • So, the third option means - a Java mapping or UDF which does a lookup service directly from the code itself and not using even the channel.. is my understanding right ?

      That is correct.

      Also, can you share if you an idea on using BPM ?

      BPM will not come into play as yours is sync interface.bpm is used for async interface.