camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Giger <>
Subject camel-cxf Soap-Fault not returned as 500 http error code
Date Tue, 10 Feb 2009 10:36:35 GMT

I have (again) the problem that a soap-fault is not returned as 500 code.

This worked fine with camel-cxf 1.3 but not with camel-cxf 1.5. The reason
seems to be that the cxf response-context is not (correctly?) propagated back.

In 1.3 we had the following code to propagate the responseContext back to the caller:

CxfProducer line 252:

248: Object result = cxfClient.dispatch(params, context, ex);
249: ex.setOutMessage(response);
250: invokingContext.setResponseContent(response, result);
251: // copy the response context to the response
252: response.putAll(responseContext);
253: cxfBinding.storeCxfResponse(exchange, response);

This has changed in 1.5 to 

Object result = cxfClient.dispatch(params, context, ex);
invokingContext.setResponseContent(response, result);
// copy the response context to the response
CxfBinding.storeCXfResponseContext(response, responseContext);
CxfBinding.storeCxfResponse(endpoint.getHeaderFilterStrategy(), exchange, response);

Which stores the responseContext itself as a new property in the message.

Later in the chain, AbstractHttpDestination searches a RESPONSE_CODE in the message:

Integer i = (Integer)outMessage.get(Message.RESPONSE_CODE);
            if (i != null) {
                int status = i.intValue();  
                if (HttpURLConnection.HTTP_INTERNAL_ERROR == i) {
                    Map<Object, Object> pHeaders = 
                    if (null != pHeaders && pHeaders.containsKey(PROTOCOL_HEADERS_CONTENT_TYPE))
            } else {

which it doesn't find because the RESPONSE_CODE is stored in the ResponseContext which is
again a HashMap.
In this case the access to the RESPONSE_CODE would be:


which can't be the correct solution of course.

So, what do I have to do to get my 500 back?:-)

Thanks & Greets


View raw message