@KAILASHC as already indicated in your closed support ticket INC-C7839 At this time, we do not have any out-of-the-box solutions to capture the response HTTP headers.
We notified you that we submitted a feedback request under FDBK-124654.
As you were already informed there is a workaround solution that involves overriding the invokeAxis2 method. Here’s how you can implement this approach:
- Create a custom activity that extends the standard connect-soap functionality
- Override the invokeAxis2 method to capture HTTP headers before they’re processed
- Store these headers in properties that you can access after the service call
Here’s a code snippet that shows the general approach (you’ll need to adapt this for reading headers rather than setting them):
Options options = new Options();
java.util.List list = new java.util.ArrayList();
com.pega.apache.commons.httpclient.Header header = new com.pega.apache.commons.httpclient.Header();
// For reading headers, you'd need to access them after the service call
// The response object will contain the HTTP headers
client.setOptions(options);
// After executing the service call, you can extract headers like this:
// This is conceptual and would need to be adapted to your specific implementation
org.apache.axis2.context.MessageContext responseMessageContext = client.getMessageContext();
Object httpHeadersObj = responseMessageContext.getProperty(org.apache.axis2.transport.http.HTTPConstants.HTTP_HEADERS);
if (httpHeadersObj instanceof java.util.List) {
java.util.List httpHeaders = (java.util.List)httpHeadersObj;
// Process headers as needed
}
Alternative approaches you might consider:
- Use Connect-REST instead: If possible, REST connectors offer more direct access to HTTP headers through their response structure.
- Use Java Steps in Activity: If the SOAP call is made from within an activity, you could replace the connector with direct Java code that gives you complete control over the HTTP request and response.
- Proxy Service: Create an intermediary service that captures all HTTP headers and includes them in the response payload.
References:
Requirement to add endpointURL in HTTP header of Connect SOAP
How to add HTTP header to Connect-SOAP
Need to send Custom HTTP Header in Connect Soap request