on 06-03-2015 12:55 PM
Hi Experts,
I am working on Proxy to rest , synchronous scenario and using POST method. Whenever data triggers in ECC that data need to be created in rest server and send back "Location" which comes in Response Header and there is no data in Body.
The same location data we need to capture anyway and send back to ECC.
Note: i had checked with SAP people regarding this..they were saying that feature planning to release 7.4 SP13 which is planned to be released only in November 2015.
So please help me to how to handle this situation.if you could provide custom module
also appreciate if you could provide code for custom adapter module.
Thanks & Regards,
Maheswarareddy
Have you tried the Prolog of the communication channel?
It might work with that.
Regards,
J
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Maheswarareddy,
I am working on Proxy to rest , synchronous scenario and using POST method. Whenever data triggers in ECC that data need to be created in rest server and send back "Location" which comes in Response Header and there is no data in Body.
The same location data we need to capture anyway and send back to ECC.
In the SOAP receiver adapter (or even HTTP/HTTP_AAE) you can add HTTP headers in a request but cannot read an additional header in the response. However, if you remote-enable the standard SAP function module HTTP_POST, it is now possible to read the response headers.
Here is a POC I've done three years ago
The idea is to make your scenario Proxy to RFC. The RFC will trigger the POST to the rest webservice and in it you can read the response HTTP headers. Other than that, I do not see any other way other than a lookup. In the API for adapter module, only the content-type can be set, so we are out of options here.
Hope this helps,
Mark
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mark,
I have read through the PoC document you have shared above. I am a little confused about how the RFC triggers the POST to the REST web service. Is it that the RFC is coded in such a way that it calls a URI and sends a POST request to it?
Also, I am confused about how my end to end design of the interface will be. Is it that i need to replicate this FM on the ABAP stack of PI and then do a look up on it. What will my receiver system be in that case?
Also, this give rise to a question on whether this call can be done directly from ECC? Do we really need to involve PI in the picture?
Thanks,
Maheswara.
Hi Maheswara,
Thank you for the questions. Here are my answers:
Is it that the RFC is coded in such a way that it calls a URI and sends a POST request to it?
Yes, it calls a URI/URL and then sends a POST request to it.
Also, I am confused about how my end to end design of the interface will be. Is it that i need to replicate this FM on the ABAP stack of PI and then do a look up on it. What will my receiver system be in that case?
Well remote-enabling the FM will allow you to do a lookup, but if you are concerned with a receiver just do Proxy <-> PI (receiver). In that case, the receiver would be your PI system (as a business system).
Also, this give rise to a question on whether this call can be done directly from ECC? Do we really need to involve PI in the picture?
Yes, this call can be done directly in ECC. If you use IF_HTTP_CLIENT, then it would be more flexible. The involvement of PI can be answered on the question of how many point-to-point connections you intend make. One of PI's main function is to minimize P2Ps (even eliminate it completely) and reduce the TCOs (Total Cost of Ownership) associated with it.
Regards,
Mark
One thought,
Write a UDF for HTTP GET Request and extract location from HTTP response header in your response mapping.
In another words : HTTP look up
Code can be derived from this link as per your requirement.
Using java.net.URLConnection to fire and handle HTTP requests? - Stack Overflow
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ambuj,
Thanks for sharing the HTTP Look up code. I first need to be sure if the receiver REST channel is able to accept the HTTP Header parameter that is being returned by the receiver REST system. I am no where able to see this header parameter in PI. Hence i am a liitle unsure as of now if this is being captured in PI in the first place. Will try to check this with the help of XPI inspector. Any other ways of checing the same?
Thanks,
Maheswara.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.