on 04-15-2015 4:21 PM
Hello All,
I below scenario synchronous call from Portal as shown below
Portal ----> SAP PI ---> ECC . I am using Rest Adapter as I have JSON to XML conversion and vice versa.
The problem here is that when the portal team run the request via internet explorer there is no issue, but it fails in chrome as chrome expects these two parameters additionally.
"Access-Control-Allow-Origin" = "*"
"Access-Control-Allow-Headers" = "Authorization"
Is there a way to handle this in PI, as in to alter the header response while sending back to Portal ?
I am little new to Rest, can't figure out.
Thanks in advance for your help!!
Pragya
Hi Pragya
Are you using SAP's REST adapter? If yes, then I don't think this feature is available yet.
What you are referring to as parameters are actually HTTP headers.
The latest SP for PI/PO (as mentioned below) only supports setting custom HTTP headers on REST receiver channel.
Setting custom HTTP header for responses via the sender channel is available on Advantco's REST adapter, but I'm not sure which one you are using.
Rgds
Eng Swee
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Eng Swee,
Thanks for the reply. I am not using Advancto. Since Authorization and Origin are actual Headers is there a way I can see what is actually getting populated in my response ?
Also, can I specify this header explicitly via some adapter modules like we can do in Axis ?
Thanks,
Pragya
Hi Pragya
I don't think you would be able to see the HTTP headers in the Message Monitor.
Maybe you can try using XPI inspector to see if you can view HTTP headers of the response.
Another alternative would be to use a REST client to test out the REST adapter. You can try the free Chrome extension below - it is similar like SOAPUI. The REST client would show the response HTTP headers.
Advanced REST client - Chrome Web Store
I've never used the Axis adapters, so I won't be able to comment on that.
Rgds
Eng Swee
Hi Eng,
Thank you so much, I tried testing via Advanced Rest client, but this header is not populated.
I have one last question, that If I write an adapter module to over-write the HTTP Response Header will that work ?
I want to be sure before starting with it as we are running low on time.
Thanks,
Pragya
Hi Pragya
Unfortunately, I haven't done any adapter module development that deals with the HTTP headers so I can't give you a definitive answer. I can only say that I've never come across any API in the PI Java library that allows access to the HTTP headers. You can try to check out the JavaDocs to see if there are any.
Rgds
Eng Swee
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.