cancel
Showing results for 
Search instead for 
Did you mean: 

REST Client - REST Server Synchronous Communication - with Lookup

Former Member
0 Kudos

Hi,

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 ?

https://blogs.sap.com/2015/09/11/yes-rest-lookup-is-possible-in-pi/

Reuqest your inputs please.

Accepted Solutions (0)

Answers (1)

Answers (1)

Muniyappan
Active Contributor

I was in the same situation https://archive.sap.com/discussions/thread/3872833

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.

https://blogs.sap.com/2016/01/15/example-of-sender-rest-adapter-in-pi-74/

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

Regards,

Muni

Former Member
0 Kudos

Thanks for the detailed inputs. In my case, first 2 options are not possible.

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 ?

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

Muniyappan
Active Contributor
0 Kudos
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.