Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
Unknown
Description
I have a client-side LogicalHandler that adds some HTTP headers and am noticing it causes the existing SOAPAction HTTP header (already added automatically by the JAX-WS runtime) to be removed.
My handler code looks like this:
public boolean handleMessage(LogicalMessageContext context) { Boolean outbound = (Boolean) context.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY); if (outbound) { Map<String, List<String>> headers = (Map<String, List<String>>) context.get(MessageContext.HTTP_REQUEST_HEADERS); if (headers == null) { headers = new HashMap<String, List<String>>(); context.put(MessageContext.HTTP_REQUEST_HEADERS, headers); } for (Map.Entry<String, String> entry : Tracer.getEntries().entrySet()) { headers.put(entry.getKey(), Collections.singletonList(entry.getValue())); } } return true; }
I had a quick look at the code and noticed the LogicalMessageContextImpl#get(Object) always returns null on the client side (isRequestor() = true).
So my handler will create a new header map and put it on the context, which is internally mapped to key "org.apache.cxf.message.Message.PROTOCOL_HEADERS" here.