Return-Path: X-Original-To: apmail-camel-users-archive@www.apache.org Delivered-To: apmail-camel-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E1CA29351 for ; Mon, 17 Oct 2011 12:14:44 +0000 (UTC) Received: (qmail 86391 invoked by uid 500); 17 Oct 2011 12:14:44 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 86341 invoked by uid 500); 17 Oct 2011 12:14:44 -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 86333 invoked by uid 99); 17 Oct 2011 12:14:44 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Oct 2011 12:14:44 +0000 X-ASF-Spam-Status: No, hits=2.8 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of freeman.fang@gmail.com designates 209.85.216.173 as permitted sender) Received: from [209.85.216.173] (HELO mail-qy0-f173.google.com) (209.85.216.173) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Oct 2011 12:14:36 +0000 Received: by qyk10 with SMTP id 10so1196543qyk.11 for ; Mon, 17 Oct 2011 05:14:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type:mime-version:subject :date:references:x-mailer; bh=E6NagBVEODYeG0HKhlbBCbMLh+mkEddtTUFsTPvmHpU=; b=XTzrnhqGsYAZ83LOrYWHKMCa9LFRktpCiIvNUrQoSrsNvzxu5Ue2ETPJUVzBq9TDEv Y9/UI1G6NCK9H101zxAPxdzVdezV+2c5seT2n3CSf07NcFWCKzCYwpQ7dstQI0EaCxIq ef1QApX8+HfgEhQvEIsi6yHa3yspOwsJDYR/o= Received: by 10.68.33.101 with SMTP id q5mr37708904pbi.121.1318853655307; Mon, 17 Oct 2011 05:14:15 -0700 (PDT) Received: from [192.168.1.101] ([123.116.142.33]) by mx.google.com with ESMTPS id v7sm58290632pbr.10.2011.10.17.05.14.09 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 17 Oct 2011 05:14:13 -0700 (PDT) Message-Id: <1C91C105-40B9-4A02-AC8F-12EACFAFD6B6@gmail.com> From: Freeman Fang To: users@camel.apache.org In-Reply-To: Content-Type: multipart/alternative; boundary=Apple-Mail-5--903456501 Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: Camel CXF component: SOAP 1.1 & 1.2 support Date: Mon, 17 Oct 2011 20:14:03 +0800 References: <860182A1-49EE-49C9-87A3-A3552CA7D254@gmail.com> X-Mailer: Apple Mail (2.936) X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail-5--903456501 Content-Type: text/plain; charset=UTF-8; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable Hi, Thanks for the confirmation, could you please create an jira for this =20= issue, I think we need address it for camel-cxf anyway. Freeman On 2011-10-17, at =E4=B8=8B=E5=8D=888:07, Andrei Shakirin wrote: > Hi Freeman, > > Yep, interceptor fixes the problem! > > Regards, > Andrei. > > -----Original Message----- > From: Freeman Fang [mailto:freeman.fang@gmail.com] > Sent: 17 October 2011 13:28 > To: users@camel.apache.org > Subject: Re: Camel CXF component: SOAP 1.1 & 1.2 support > > Hi, > > My gut feeling is that this issue is kinda of similar with the one I =20= > encountered with servicemix-cxf-bc JBI component(which means only =20 > determine soap version from the servicemodel but ignore the real =20 > incoming message), could you do a quick test here? > You can add an outInterceptor for your camel-cxf endpoint, the =20 > interceptor should be like > > import org.apache.cxf.binding.soap.SoapMessage; > import =20 > org.apache.cxf.binding.soap.interceptor.AbstractSoapInterceptor; > import org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor; > import org.apache.cxf.interceptor.Fault; import =20 > org.apache.cxf.phase.Phase; > > public class SetSoapVersionInterceptor extends =20 > AbstractSoapInterceptor { > > public SetSoapVersionInterceptor() { > super(Phase.WRITE); > addBefore(SoapOutInterceptor.class.getName()); > } > public void handleMessage(SoapMessage message) throws Fault { > if (message.getExchange() !=3D null) { > if (message.getExchange().getInMessage() instanceof > SoapMessage) { > > ((SoapMessage > )message > ).setVersion > (((SoapMessage)message.getExchange().getInMessage()).getVersion()); > } > } > } > > } > > Tell me if this can fix it. > > Freeman > > On 2011-10-17, at =E4=B8=8B=E5=8D=886:50, Andrei Shakirin wrote: > >> Hi, >> >> I have a small issue with Camel CXF component supporting both SOAP >> bindings: 1.1 and 1.2. >> >> If I take pure CXF service and specify: >> >> @ServiceMode(value =3D Service.Mode.MESSAGE) @BindingType(value =3D >> "http://www.w3.org/2003/05/soap/bindings/HTTP/") >> >> this CXF Service accepts both kind of requests: SOAP 1.1 & SOAP 1.2 >> and expects appropriate responses: SOAP 1.1 response for SOAP 1.1 >> request and SOAP 1.2 response for SOAP 1.1 request. It works as >> expected. >> >> If I take Camel CXF component and specify the same annotations for >> the interface, I have the following behavior: >> all requests (1.1 & 1.2) is still accepted, but I can provide ONLY >> 1.2 responses and faults. >> If I try to set 1.1 response as answer for 1.1 request: >> exchange.getOut().setBody(response, StaxSource.class); the following >> exception is throwing: >> >> 11:46:27,411 | WARN | qtp25691505-91 | >> PhaseInterceptorChain | ache.cxf.comm >> on.logging.LogUtils 371 | - - | Interceptor for >> {http://com.dpdhl/cig/facade/v1 }WSFaca >> de#{http://facade.cig.dpdhl.com/}invoke has thrown exception, >> unwinding now >> org.w3c.dom.DOMException: HIERARCHY_REQUEST_ERR: An attempt was made >> to insert a node wher e it is not permitted. >> at >> com >> .sun >> .org >> .apache.xerces.internal.dom.CoreDocumentImpl.insertBefore(CoreDocume >> ntImpl.java:391)[:1.6.0_22] >> at >> com >> .sun >> .org.apache.xerces.internal.dom.NodeImpl.appendChild(NodeImpl.java: >> 235)[ >> :1.6.0_22] >> at >> com >> .sun >> .xml.messaging.saaj.soap.SOAPPartImpl.appendChild(SOAPPartImpl.java: >> 502) >> [67:org.apache.servicemix.bundles.saaj-impl:1.3.2.2] >> at >> org >> .apache >> .cxf.staxutils.W3CDOMStreamWriter.setChild(W3CDOMStreamWriter.java:11 >> 4)[132:org.apache.cxf.bundle:2.4.2] >> >> Absolutely the same exception is thrown in pure CXF provider if I =20 >> send >> wrong version of response (for example 1.1 response for 1.2 request). >> >> Question: is there any possibility to say Camel CXF component that it >> should accept SOAP 1.1 Response as answer to SOAP 1.1 Request? >> Sample code illustrating the problem can be provided if necessary. >> >> Regards, >> Andrei. >> > > --------------------------------------------- > Freeman Fang > > FuseSource > Email:ffang@fusesource.com > Web: fusesource.com > Twitter: freemanfang > Blog: http://freemanfang.blogspot.com > > > > > > > > > --------------------------------------------- Freeman Fang FuseSource Email:ffang@fusesource.com Web: fusesource.com Twitter: freemanfang Blog: http://freemanfang.blogspot.com --Apple-Mail-5--903456501--