on 2019 Nov 29 9:56 PM
Hi
I'm calling an API which returns the payload and the message headers. Testing in POSTMAN i can view the response headers but when implementing with Request-Reply I do not see those response headers [in trace].
API documentation for response headers:
1. Not sure if this is a common behavior and why those headers are not returned [without groovy]?
2. So, i used the below groovy to read the header response but the property is returned as null.
def Message processData(Message message){
def headers = message.getHeaders();
def gSr_token = headers.get("elements-next-page-token");
message.setHeader("gProp_token", gSr_token);
return message;
}
Any thoughts and advise on this please?
Request clarification before answering.
Hello Prabhu,
Thanks for the update it really helps our fellow community members.Please close the thread marking helpful answer ( if any ).
Regards,
Sriprasad Shivaram Bhat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Prabhu,
I think there is a threshold for header size and rest of the headers might be getting truncated because of this.Since I dont have ServiceNow account to test this Connector its very difficult to replicate your scenario ( since for rest of the elements I am getting response headers as expected ).Suggest you to raise a ticket to LOD-HCI-PI-CON with all the findings and somebody from developement team will look into it.
Regards,
Sriprasad Shivaram Bhat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi c12b61ded10b4e18beae75c3b6218d2c,
All you need is to register the custom headers, in the iflow runtime configuration section.
And you can use the groovy code.
def Message processData(Message message){
def headers = message.getHeaders();
def gSr_token = headers.get("elements-next-page-token");
message.setHeader("gProp_token", gSr_token);
message.setProperty("gProp_token", gSr_token);
return message;
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Morten,
I think he is using http or open connectors adapter. From response it looks to me like open connectors response header for service now instance.
But let Prabhu confirm based on that we can derive some solution.
Regards,
Sriprasad shivaram Bhat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Prabhu,
OData Receiver adapter do not copy all the response headers back to message.
You have to whitelist the Response headers that you wish to copy. Please refer https://blogs.sap.com/2019/01/16/sap-cloud-platform-integration-headers-whitelisting-in-odata-v2-out...
BR
Saranya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Prabhu
Are the other documented headers present after the Request Reply step? I can't really see that you are doing anything wrong, and that makes me wonder whether the header is present at all.
Are you passing query parameters that are similar to the ones you pass in Postman?
Regards,
Morten
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Morten
the query parameter "nextPage" is optional. Testing without "nextPage" or any of the request headers in postman still provides the response header(s) "elements-next-page-token" [these are custom header]
Not sure, if i had misunderstood your question, do i need to request for "elements-next-page-token" prior request-reply step via content modifier? I dont have this content modifier prior the request-reply
User | Count |
---|---|
84 | |
12 | |
9 | |
8 | |
8 | |
5 | |
4 | |
4 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.