Question
Infosys
US
Last activity: 23 Mar 2016 5:08 EDT
Service SOAP: Read parameter from http header
We are implementing a Service SOAP, and one of the required input parameters can only be passed via the http header.
Is there a way to read parameters from the http header when implementing a Service SOAP, either in the request mapping or within the service acitivity?
We'd be happy for any kind of hint. Thank you
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Virtusa Ltd
AU
One option is to try Rule-Connect-Http to access the http headers.
Otherwise, you can something like below:
javax.servlet.http.HttpServletRequest req = (javax.servlet.http.HttpServletRequest) pxRequestorPage.getObject("pxHTTPServletRequest");
String YourParam = req.getHeader("YourParam");
Updated: 30 Sep 2015 4:20 EDT
Infosys
US
Hello Ankan,
we are implementing the Webservice, we are not trying to call an existing one, so I assume you mean Rule-Service-HTTP instead? That's the workaraound we are probably going for, although I'm not very happy with it.
We have tried yor Code-Snippet, but there is no 'pxHTTPServletRequest' property or object on the pxRequestor page when the service activity is executed.
Thank you anyway!
Virtusa Ltd
AU
Yes John. I meant service-http. Apologies for the typo.
Let me check if I can find any more workaround. As per my knowledge, user id and password can be tracked in the header, so it might be possible to get any other parameter, although I am not sure about this. You can raise a Pega SR to check if there is any other way.
Thanks.
Hi John,
This feature is not available in PRPC currently (at least till Pega 7.1.7), you need to customize 'invokeaxis2' activity. You might refer to the link below for more information on how this may be achieved.
http://blog.facilelogin.com/2011/02/adding-custom-http-headers-via-axis2.html
Infosys
US
Hello Krishna,
we are implementing the webservice. The parameters in the http header are sent to us and we need to find a way to read them in the Pega Service Activity. From what I understand in the link you provided, it shows how to add custom http header paramaters when calling another webservice.
Thank you anyway!
Virtusa Ltd
AU
Infosys
US
Hello Ankan,
help on the rule form says that the "Request Headers" section on the Request tab of the rule form is for reading the content of the Soap-Envelopereads the content.
Complete the Request Headers section to map data from the SOAP envelope header.
That won't give us Access to the parameters passed in the http header.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Header> <HeaderParam1>value1</HeaderParam1> <HeaderParam2>value2</HeaderParam2> <!-- and so on --> </soapenv:Header> <soapenv:Body> <log:SaveLogEntryRequest> <!-- Here our request data --> </log:SaveLogEntryRequest> </soapenv:Body> </soapenv:Envelope>
We'd be able to read the HeaderParam 1 and 2 (from the Soap-Envelope Header), but not from the protocol-Level http header.
The SR I have submitted has changed it's type from "How-To Question" to "Enhancement Request".
I'll post updates to this as answers to my original question.
Hi Jon,
What is the SR number you have generated for this?
-Adi
Virtusa Ltd
AU
Okay John. Please keep us posted here in this forum. This is an interesting challenge. Thanks.
Accenture
US
Any updates on this?
Pegasystems Inc.
US
Hi Mark Bolster
Thank you for your question. The feedback item has not yet progressed to the point that it will be included in a release.
Pegasystems Inc.
US
Thanks, Marissa!
Given the interest in FDBK-13141, I Pulsed it with links to both this discussion and Mark Bolster's question on SA-16130 (my very late reply to him), https://community.pega.com/support/support-articles/service-soap-how-extract-values-http-header.
Virtusa
LK
We also in needed of a solution for the above mentioned requirement. Any Updates on this??