Return-Path: Delivered-To: apmail-camel-users-archive@www.apache.org Received: (qmail 4807 invoked from network); 24 Mar 2010 12:53:38 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 24 Mar 2010 12:53:38 -0000 Received: (qmail 38323 invoked by uid 500); 24 Mar 2010 12:46:58 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 38284 invoked by uid 500); 24 Mar 2010 12:46:58 -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 38275 invoked by uid 99); 24 Mar 2010 12:46:57 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Mar 2010 12:46:57 +0000 X-ASF-Spam-Status: No, hits=-0.8 required=10.0 tests=AWL,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of willem.jiang@gmail.com designates 209.85.218.223 as permitted sender) Received: from [209.85.218.223] (HELO mail-bw0-f223.google.com) (209.85.218.223) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Mar 2010 12:46:49 +0000 Received: by bwz23 with SMTP id 23so2366034bwz.36 for ; Wed, 24 Mar 2010 05:46:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=qb3pmLa2jtxqxOsgZld1iuKhvx0OLMJaeMEH+bq+ikw=; b=SaGZV/BWYc+cJZl7m4zetydK+gQayjeF0sVBYdYqeDrakEDPQ3rhTNHXapkVk93SYy OaPA916ZGTPgglR6Uoj+HSlpWYzwUPzUNOfKc2YcUFo7ykTn1bdU9+La897Y+5oGXit6 q5sEn+hm2CnpA4XwQr+biuoRhykbzY06Ke2Pk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=RMKcXmhHQyyD29wja0viiEJJS4APhdb9TL1VPZtqdjTmPEJ7SnEXMxkWzMIy4oeZde 9QJ6rE1ag/KmNw1HD05GU6Hz6ZxQUUJFOohaQEfhuNUo+i9KNDPvVJIVEf7FvyQF0RdP Y9ETSIAwmvi6r6/YTEi/5tVl1mKic5VqGH6Qg= Received: by 10.204.24.134 with SMTP id v6mr2303385bkb.204.1269434784429; Wed, 24 Mar 2010 05:46:24 -0700 (PDT) Received: from [192.168.0.158] ([125.33.122.97]) by mx.google.com with ESMTPS id 14sm3071018bwz.6.2010.03.24.05.46.17 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 24 Mar 2010 05:46:20 -0700 (PDT) Message-ID: <4BAA0994.4060309@gmail.com> Date: Wed, 24 Mar 2010 20:46:12 +0800 From: Willem Jiang User-Agent: Thunderbird 2.0.0.24 (Macintosh/20100228) MIME-Version: 1.0 To: users@camel.apache.org Subject: Re: Unable to throw Soap Fault References: <28010828.post@talk.nabble.com> <4BA9B65E.7070402@gmail.com> <28011453.post@talk.nabble.com> <4BA9CCF7.5010105@gmail.com> <28012624.post@talk.nabble.com> In-Reply-To: <28012624.post@talk.nabble.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit I'm afraid CXF interceptor can help you to do that,as we setup some customer interceptor when the camel-cxf endpoint working in PAYLOAD dataformat. Can you try the latest Camel to see if the Error still there? BTW, is there any stack trace in the log that can help us trace the issue ? Willem HiS wrote: > Hi, > > For generalization I had written the endpoint as ("http:requestset"), but > this is actually a custom endpoint which internally uses CXF to create the > web-service endpoint. > > Its working fine when sending normal response but only when soap fault needs > to be returned does is not work. > > We can't migrate to the latest camel but wanted to fix this problem in the > current version, can I use CXF interceptors to send soap fault? > > Thanks, > Himanshu > > > willem.jiang wrote: >> Hi, >> >> Is the from("http:requestset") a CXF endpoint or other something ? >> I just went through the CxfConsumer code of camel trunk, it should be >> able to deal with the fault message that you set in the ErrorProcessor. >> >> If you can't upgrade the Camel version, I'm afraid you need to buy a >> customer support, as we don't do min patch release for Camel 2.0.0. >> >> Willem >> >> >> HiS wrote: >>> Hi Willem, >>> >>> Thanks for your response. >>> I am having the following groovy route: >>> >>> from("http:requestset") >>> .onException(Exception.class) >>> .handled(true) >>> .processRef('ErrorProcessor').end() >>> .process(new ValidateRequestProcessor()); >>> >>> Here the 'ValidateRequestProcessor' validates the request and on finding >>> missing parameter throws an exception. The exception is caught by the >>> 'ErrorProcessor' where the code for returning soap fault is written. >>> >>> We are using PAYLOAD DataFormat for camel-cxf but could not migrate to >>> Camel >>> 2.3.0 due to other dependencies. >>> >>> Is there any workaround to the issue which can be used to return the soap >>> fault (I saw examples of using setFaultBody in the route but that also >>> did >>> not seem to work) ? >>> >>> Thanks, >>> Himanshu >>> >>> >>> willem.jiang wrote: >>>> Hi, >>>> >>>> Can I have a look at your Camel route? >>>> And which camel-cxf DataFormat are you using ? >>>> If you are using PAYLOAD DataFormat, I'm afraid you need to use Latest >>>> Camel 2.3.0 SNAPSHOT. As William Tam just added a enhancement for it[1] >>>> >>>> [1]https://issues.apache.org/activemq/browse/CAMEL-2495 >>>> >>>> HiS wrote: >>>>> Hi All, >>>>> >>>>> We are using CXF 2.2.3 with Camel 2.0.0 for exposing an end-point on >>>>> Tomcat >>>>> 6.0. A requirement is that if incoming request does not have a >>>>> parameter, >>>>> soap fault needs to be thrown. >>>>> >>>>> As the Fault and Out Consolidation has happened in Camel 2.0.0, I am >>>>> creating a soap fault and setting it in the Out stream of Exchange >>>>> inside >>>>> a >>>>> processor. >>>>> >>>>> SOAPMessage msg = null; >>>>> try { >>>>> MessageFactory factory = >>>>> MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL); >>>>> msg = factory.createMessage(); >>>>> SOAPBody body = msg.getSOAPBody(); >>>>> QName qName = SOAPConstants.SOAP_SENDER_FAULT; >>>>> >>>>> SOAPFault soapFault = body.addFault(qName, "Test >>>>> Code"); >>>>> Detail detail = soapFault.addDetail(); >>>>> detail.setValue("Test Description"); >>>>> >>>>> exchange.getOut().setFault(true); >>>>> >>>>> exchange.getOut().setHeader(org.apache.cxf.message.Message.RESPONSE_CODE, >>>>> new Integer(500)); >>>>> exchange.getOut().setBody(body); >>>>> >>>>> } catch (SOAPException e) { >>>>> e.printStackTrace(); >>>>> } >>>>> >>>>> After doing this, I am not getting any exception but the soap fault is >>>>> also >>>>> not getting thrown, instead a Soap Envelope with empty Body is coming >>>>> as >>>>> output. >>>>> >>>>> Any ideas on what could be going wrong in the above? >>>>> >>>>> Thanks, >>>>> Himanshu >>>> >> >> >