camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem Jiang <willem.ji...@gmail.com>
Subject Re: camel-cxf Soap-Fault not returned as 500 http error code
Date Thu, 12 Feb 2009 02:45:13 GMT
Hi Marc

Since there are lots of bug fixing and improvements, we change the
release version of camel 1.x branch from 1.5.1 to 1.6.
Hadrian is working on the release of camel 1.6 this week. If everything
is fine , you can download the kit next week.

Before that , you can try the CAMEL-2.0-SNAPSHOT here[1]

[1]http://people.apache.org/repo/m2-snapshot-repository/org/apache/camel/apache-camel/

Willem

Marc Giger wrote:
> Hi Willem,
> 
> On Wed, 11 Feb 2009 23:27:10 +0800
> Willem Jiang <willem.jiang@gmail.com> wrote:
> 
>> Hi Marc,
>>
>> I did a quick fix for the CAMEL-1330 on camel 1.x branch and it will
>> be be a part of the coming up camel 1.6.
>> Since we refactored the camel-cxf module in camel trunk, so the trunk
>> code is ok for the CAMEL-1330.
> 
> Thank you. I will try it out.
> Do you have an idea when camel 1.6 will be released?
> Will there be a 1.5.1 release as announced on
> http://camel.apache.org/download.html ?
> 
> Greets
> 
> Marc
> 
> 
>> Willem
>>
>> Willem Jiang wrote:
>>> Hi Marc,
>>>
>>> I just fill a JIRA[1] for it, and will look into it tomorrow.
>>>
>>> [1]https://issues.apache.org/activemq/browse/CAMEL-1330
>>>
>>> Willem
>>>
>>> On Tue, Feb 10, 2009 at 6:36 PM, Marc Giger <gigerstyle@gmx.ch>
>>> wrote:
>>>
>>>     Hi,
>>>
>>>     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);
>>>     ex.setOutMessage(response);
>>>     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 =
>>>                          
>>>      CastUtils.cast((Map)outMessage.get(Message.PROTOCOL_HEADERS));
>>>                        if (null != pHeaders &&
>>>     pHeaders.containsKey(PROTOCOL_HEADERS_CONTENT_TYPE)) {
>>>                            pHeaders.remove(PROTOCOL_HEADERS_CONTENT_TYPE);
>>>                        }
>>>                    }
>>>                    response.setStatus(status);
>>>                } else {
>>>                    response.setStatus(HttpURLConnection.HTTP_OK);
>>>                }
>>>
>>>     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:
>>>
>>>     ((HashMap)outMessage.get("ResonseContext")).get(Message.RESPONSE_CODE)
>>>
>>>     which can't be the correct solution of course.
>>>
>>>     So, what do I have to do to get my 500 back?:-)
>>>
>>>     Thanks & Greets
>>>
>>>     Marc
>>>
>>>
>>>
>>>
> 


Mime
View raw message