Return-Path: Delivered-To: apmail-camel-users-archive@www.apache.org Received: (qmail 15332 invoked from network); 7 Sep 2009 13:15:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 7 Sep 2009 13:15:56 -0000 Received: (qmail 87536 invoked by uid 500); 7 Sep 2009 13:15:56 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 87478 invoked by uid 500); 7 Sep 2009 13:15:56 -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 87468 invoked by uid 99); 7 Sep 2009 13:15:56 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Sep 2009 13:15:56 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of email.wtam@gmail.com designates 209.85.221.196 as permitted sender) Received: from [209.85.221.196] (HELO mail-qy0-f196.google.com) (209.85.221.196) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Sep 2009 13:15:45 +0000 Received: by qyk34 with SMTP id 34so1826231qyk.12 for ; Mon, 07 Sep 2009 06:15:24 -0700 (PDT) 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 :content-transfer-encoding; bh=cJzzd6htRI0bX70tsaIbi+eR7wZ+5KA4mYKQmHzI9/U=; b=eahO//VZGPsTRYRvLAO4t6B1ddVi5K+RTqIzCcq3egIMOf/FdcKTICY+oaK/1i3lln KdNBuC1UxXhK6t0v2MgR788Q0QyXC7k/pfOeRzuDfzb7099gqt0m5SlW/dwG6J+ueZi7 J/4I4JmODXThLsN+BUtejfjX1c+RKZYuZnShk= 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:content-transfer-encoding; b=DeraZhf160Wzz3vtubkOiFLTUakDHUs8ZJcV/t6mOL+loSE4F4B3C4rHB8T2vdj3rp C03WICaktQ6ejhO1czauolCh8xLnXwrUMRooHB5NZitkUtNEzOOvaXxiF6r4FHF37i+K 9poaftzqyyEfml5Ou4G7HGWwiQlOwl8h7vQrs= MIME-Version: 1.0 Received: by 10.224.103.11 with SMTP id i11mr9026787qao.233.1252329324142; Mon, 07 Sep 2009 06:15:24 -0700 (PDT) In-Reply-To: <25328913.post@talk.nabble.com> References: <25068148.post@talk.nabble.com> <25195593.post@talk.nabble.com> <25252694.post@talk.nabble.com> <25328913.post@talk.nabble.com> Date: Mon, 7 Sep 2009 09:15:24 -0400 Message-ID: Subject: Re: setting soap headers in camel cxf router From: William Tam To: users@camel.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Hi Kavita, ResponseContext map is a CXF implementation detail. CXF client puts information related to a response in that map. The map is eventually copied to the CXF response message. I took another peek at camel-cxf code, I don't expect the response context to be null in normal code path. It sounds like some exception might have happened or the Camel message is not the right message (i.e. it may not be the response message). Do you see any error messages in the log or anything suspicious? If the message is not a response message, getting the Header.HEADER_LIST from it won't give you to right headers obviously. It is a bid hard for me to see what's going on. If you could provide a little test case, I'll be glad to take a look. Thanks, William On Mon, Sep 7, 2009 at 7:21 AM, kav m wrote: > > Hi William, > > Thanks a lot for putting up the test case and also updating the CXF Wiki. > I am having a POJO based camel-cxf service endpoint [details same as triv= edi > has put in this thread] and trying to set soap headers so that those can = be > displayed in the soapUI client.I was using =A0camel-cxf 1.6.0 but after > reading your post, I am using camel-cxf 1.6.2 > > > I followed the code you have written in the wiki but on line no. 2 below = , I > get a null responseContext: > > =A0CxfMessage message =3D exchange.getIn().getBody(CxfMessage.class); //1 > =A0Map responseContext =3D > (Map)message.getMessage().get(Client.RESPONSE_CONTEXT); //2 > =A0List soapHeaders =3D > (List)responseContext.get(Header.HEADER_LIST); //3 > > Can you tell me what this responseContext Map is and why am I getting it = as > null ? > > Since a null responseContext did not allow me to proceed further with the > solution, I used the following code to ultimately obtain a List of > soapHeaders- > > =A0CxfMessage cxfMessage =3D exchange.getIn().getBody(CxfMessage.class) > =A0Message message =3D cxfMessage.getMessage(); > =A0List soapHeaders =3D (List) > message.get(Header.HEADER_LIST); > > The rest of the code I used is exactly what you have in the wiki. Still I= do > not see any headers at all in the SoapUI client. [WS-Addressing is set to > true in SoapUI] > Besides the header I also need to set a POJO in the SoapBody which should= be > displayed in SoapUI. I am doing that using the following code and it is > displaying perfectly fine. > > exchange.getOut().setBody(subscribeResponse); > > Please help me to also set the SoapHeaders in the response, so that they = are > visible in SoapUI along with the body. > > Thanks for your help. > > Regards, > Kavita > > > > > > > > William Tam wrote: >> >> Hi Trivedi, >> >> After chatting with Willem a bit, I realized that the >> InsertResponseOutHeaderProcessor should have been getting the "in" >> message as opposed to the "out" message from the exchange since the >> processor is in the pipeline. >> >> That is, >> >> =A0 =A0 =A0 =A0 =A0 =A0 CxfMessage message =3D >> exchange.getIn().getBody(CxfMessage.class); >> >> I will update the test and just want to be aware of it. >> >> Thanks, >> William >> >> On Thu, Sep 3, 2009 at 12:27 AM, William Tam wrote= : >>> Hi Trivedi, >>> >>> You can now find some samples in this test module: >>> https://svn.apache.org/repos/asf/camel/branches/camel-1.x/components/ca= mel-cxf/src/test/java/org/apache/camel/component/cxf/soap/headers/CxfMessag= eHeadersRelayTest.java. >>> =A0Its Camel context definition is here : >>> https://svn.apache.org/repos/asf/camel/branches/camel-1.x/components/ca= mel-cxf/src/test/resources/org/apache/camel/component/cxf/spring/message_he= aders_relay.xml >>> >>> The test of interest is >>> testInoutOutOfBandHeaderCXFClientRelayWithHeaderInsertion and the >>> route that the test references is: >>> >>> =A0 >>> =A0 >>> =A0 >>> =A0 >>> >>> >>> >>> Please note that the InsertResponseOutHeaderProcessor requires bug fix >>> for (https://issues.apache.org/activemq/browse/CAMEL-1983). =A0I have >>> submitted a fix the 1.x branch. =A0InsertRequestOutHeaderProcessor does >>> not require any fixes. >>> >>> Cheers, >>> William >>> >>>>>>>> Hi William, >>>>>>> >>>>>>> I am using Camel 1.x, can you provide me a sample how to set header= s >>>>>>> in >>>>>>> Exchange for POJO based CXF webservices? >>>>>>> >>>>>>> Thanks, >>>>>>> Trivedi >>>>>>> >> >> > > -- > View this message in context: http://www.nabble.com/setting-soap-headers-= in-camel-cxf-router-tp25068148p25328913.html > Sent from the Camel - Users mailing list archive at Nabble.com. > >