Return-Path: Delivered-To: apmail-camel-users-archive@www.apache.org Received: (qmail 41208 invoked from network); 10 Feb 2009 13:35:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Feb 2009 13:35:18 -0000 Received: (qmail 89801 invoked by uid 500); 10 Feb 2009 13:35:17 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 89780 invoked by uid 500); 10 Feb 2009 13:35:17 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 89769 invoked by uid 99); 10 Feb 2009 13:35:17 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Feb 2009 05:35:17 -0800 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of willem.jiang@gmail.com designates 209.85.198.245 as permitted sender) Received: from [209.85.198.245] (HELO rv-out-0708.google.com) (209.85.198.245) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Feb 2009 13:35:09 +0000 Received: by rv-out-0708.google.com with SMTP id c5so2621933rvf.56 for ; Tue, 10 Feb 2009 05:34:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=DStmTX61ezzzc0bV7i82Nkrw8uVNmFvyGdUo003lJ5E=; b=cZ6NyQ3SqbOpaUIFLH6Hsksqww3AWE8Rb5sQ+iZci2Dja3a/TadG9pNtVLql3jR/Vo 04RnZh8faJjn/740XhLMdA3oE7OY97nS94QLFwgVgW6J3MpQbVswR5dtAv/I1gjJNLRn v93QY1K0KmnF4A/Ef9Af67DCiprhrce0S/dZ8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=YaD1wnBLNK9q/IYY4HoNjTVCaZ0RUJF51Rqk9vAj7U9KlYjsjBs22qEGs+YFC32i6v G1zdPp16AIQNaBQ4xAh3AgqI7cjfTVSKuNMLij06zZRBdEtBkTfXm11EColS13df64Xf ZwfC5RKZg/vW1ephBQh5bxrArsyE4qw58IWYg= MIME-Version: 1.0 Received: by 10.141.29.8 with SMTP id g8mr2163555rvj.283.1234272888208; Tue, 10 Feb 2009 05:34:48 -0800 (PST) In-Reply-To: <20090210113635.48215fa6@rigi.itserve.ch> References: <20090210113635.48215fa6@rigi.itserve.ch> Date: Tue, 10 Feb 2009 21:34:48 +0800 Message-ID: Subject: Re: camel-cxf Soap-Fault not returned as 500 http error code From: Willem Jiang To: users@camel.apache.org Content-Type: multipart/alternative; boundary=000e0cd179e20ebc3d0462908d02 X-Virus-Checked: Checked by ClamAV on apache.org --000e0cd179e20ebc3d0462908d02 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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 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 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 > > > > --000e0cd179e20ebc3d0462908d02--