Skip to Content
0

REST Client - REST Server Synchronous Communication - with Lookup

Jan 02 at 05:38 AM

58

avatar image
Former Member

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.

rest-interface.jpg (64.1 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Muniyappan Marasamy Jan 02 at 07:18 AM
0

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

Show 2 Share
10 |10000 characters needed characters left characters exceeded
Former Member

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 ?

0
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.

0