Return-Path: Delivered-To: apmail-camel-dev-archive@www.apache.org Received: (qmail 96557 invoked from network); 8 May 2009 14:55:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 8 May 2009 14:55:02 -0000 Received: (qmail 97808 invoked by uid 500); 8 May 2009 14:55:02 -0000 Delivered-To: apmail-camel-dev-archive@camel.apache.org Received: (qmail 97776 invoked by uid 500); 8 May 2009 14:55:02 -0000 Mailing-List: contact dev-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list dev@camel.apache.org Received: (qmail 97766 invoked by uid 99); 8 May 2009 14:55:02 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 May 2009 14:55:02 +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.198.246 as permitted sender) Received: from [209.85.198.246] (HELO rv-out-0708.google.com) (209.85.198.246) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 May 2009 14:54:50 +0000 Received: by rv-out-0708.google.com with SMTP id l33so1175433rvb.56 for ; Fri, 08 May 2009 07:54:28 -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=V+rAQ2zQhf+mxJeqxA2ywK7D1slPsAOsqd85j3SwVHI=; b=YcsS9Ek5VGi/lFJhYjnraA8xBnfLqbwYIPLMz+ADgBPG3svzqUx1MHFOD+/cf7z1pz fXyDwWZ6PlSLOTfaWKlKNE2mT6Qry3Mi4SWznlChi8JZauxx3+ePkM9eWVqpOim3AYjJ Q5thChtPTqVUhq1NPpfoLku8wCxiaK1eLhgcI= 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=MNq/ufj9wW3zZ0iscF9aBjtO5A/mGyiLTxZ0MOti7P8ovCo6Ei3pHMHxNENA53PB/i +sbY7FT2Mju4QsAlmfef7CcK8Gyof5uaACVTihvR2PcKG0E6YN5ZS3QfqzIp7/IBm2PA /oXYzflaHjo9pIfFPRE7TBrKstMFV3JSuS8mg= MIME-Version: 1.0 Received: by 10.141.197.21 with SMTP id z21mr1221541rvp.119.1241794468795; Fri, 08 May 2009 07:54:28 -0700 (PDT) In-Reply-To: References: <20090506045615.3C933238896B@eris.apache.org> <4A023FF8.2090309@gmail.com> <5380c69c0905062055p71f3ec74q1d32ce49b5b77933@mail.gmail.com> <4A03E5B6.2050904@gmail.com> Date: Fri, 8 May 2009 10:54:28 -0400 Message-ID: Subject: Re: svn commit: r772054 - in /camel/trunk/components/camel-cxf/src: main/java/org/apache/camel/component/cxf/CxfHeaderFilterStrategy.java test/java/org/apache/camel/component/cxf/CxfRawMessageRouterTest.java From: William Tam To: dev@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 Willem, I think you meant CxfHeaderHelper rather than CamelTransport. I saw your checkin. Changing the header name from "content.type" to "CamelContentType" is fine, although it is not consistent with DefaultCxfBinding where it just uses header name "Content-Type". Also, should it be "CamelCxfContentType"? BTW, there is a CamelHttpContentType in HTTP component, and one (CamelRestletMediaType) for Restlet component. They are have same semantics. Cheers, William On Fri, May 8, 2009 at 10:36 AM, William Tam wrote: > I couldn't find where CamelTransport is referencing > CamelTransportContants.CONTENT_TYPE. =A0Even if it is referenced, I > don't understand why we can have to use the constant =A0of value > "content.type". > > On Fri, May 8, 2009 at 3:56 AM, Willem Jiang wro= te: >> Hi, >> >> I just found the CamelTransportContants.CONTENT_TYPE is used by the >> CamelTransport. >> The integration test of CustomerServicesTest shows the user case. >> >> Since there is no protocol header defined in Camel-xxx component, camel >> transport need to copy the content-type between the CXF message and >> Camel message back and forth. >> >> Since the DefaultCxfBinding will not be used in CamelTranpsort, I just >> revert the change of the CXFHeaderHelper. >> >> Willem >> >> >> >> William Tam wrote: >>> On Wed, May 6, 2009 at 11:55 PM, Claus Ibsen wr= ote: >>>> On Thu, May 7, 2009 at 5:02 AM, William Tam wro= te: >>>>> On Wed, May 6, 2009 at 9:57 PM, Willem Jiang = wrote: >>>>>> Hi William, >>>>>> >>>>>> Since the JMS can't accept the header which's name has the '-' >>>>>> character, we introduce the CamelTransportContants.CONTENT_TYPE for = it. >>>>> I thought JMS could not handle dots in header names (that's why we >>>>> went from org.apache.camel convention to CamelHeaderName "case" >>>>> convention). =A0My memory may be wrong. >>>> Hi >>>> >>>> In Camel 2.0 we have added to the JMS component so it will be able to >>>> transfer Content-Type with the hyphen, as its a common header. >>>> If you use Camel on both sides then it will automatic revert it back >>>> to normal again. It replaces - with a _HYPHEN_ constant. So its >>>> transfered as Content_HYPHEN_Type. >>> >>> In 2.0, does that mean it is OK to have hyphen in header? =A0If so, we >>> could clean up CamelTransportContants.CONTENT_TYPE? >>> >>>>>> After checking the on wire message between the client and CXF consum= er, >>>>>> I found there are two lines of "content-type" in the http header. >>>>>> One is "content-type", the other is "Content-Type". >>>>> The comment in code is kinda off. >>>>> >>>>>> So I added the filter of "content-type", and keep using "content.typ= e" >>>>>> in the Camel message. >>>>>> >>>>>> Willem >>>>>> >>>>>> >>>>>> William Tam wrote: >>>>>>> Hi Willem, >>>>>>> >>>>>>> I don't think adding "content-type" to the filters is necessary. >>>>>>> 1. The header is "Content-Type" not "content-type", =A0so the chang= e >>>>>>> does not really affect anything. >>>>>>> 2. Putting that aside. =A0If we add filters for "Content-Type", it = stops >>>>>>> the propagating from Camel header to/from CXF header, which we don'= t >>>>>>> want. >>>>>>> >>>>>>> We probably should clean up the use of >>>>>>> CamelTransportContants.CONTENT_TYPE (value =3D content.type) and ju= st >>>>>>> use Message.CONTENT_TYPE (value =A0=3D Content-Type). >>>>>>> >>>>>>> In DefaultCxfBinding.java, I don't see why we need to invent a head= er >>>>>>> constant (CamelTransportContants.CONTENT_TYPE) only used by camel-c= xf >>>>>>> and have to map it back and forth. >>>>>>> >>>>>>> >>>>>>> That is, we can eliminate CamelTransportContants.CONTENT_TYPE and u= se >>>>>>> Message.CONTENT_TYPE consistently in: >>>>>>> >>>>>>> =A0 =A0 =A0 =A0 // propagate content type >>>>>>> =A0 =A0 =A0 =A0 String key =3D Message.CONTENT_TYPE; >>>>>>> =A0 =A0 =A0 =A0 Object value =3D cxfMessage.get(key); >>>>>>> =A0 =A0 =A0 =A0 if (value !=3D null && >>>>>>> !headerFilterStrategy.applyFilterToExternalHeaders(key, value, >>>>>>> exchange)) { >>>>>>> =A0 =A0 =A0 =A0 =A0 =A0 camelHeaders.put(CamelTransportConstants.CO= NTENT_TYPE, value); >>>>>>> =A0 =A0 =A0 =A0 =A0 =A0 if (LOG.isTraceEnabled()) { >>>>>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 LOG.trace("Populate header from CXF= header=3D" + key + " >>>>>>> value=3D" + value); >>>>>>> =A0 =A0 =A0 =A0 =A0 =A0 } >>>>>>> =A0 =A0 =A0 =A0 } >>>>>>> >>>>>>> ... >>>>>>> =A0 =A0 =A0 =A0 =A0 =A0 // put content type in exchange >>>>>>> =A0 =A0 =A0 =A0 =A0 =A0 if (CamelTransportConstants.CONTENT_TYPE.eq= uals(entry.getKey())) { >>>>>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 cxfExchange.put(Message.CONTENT_TYP= E, entry.getValue()); >>>>>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 continue; >>>>>>> =A0 =A0 =A0 =A0 =A0 =A0 } >>>>>>> >>>>>>> Thoughts? >>>>>>> >>>>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D >>>>>>>> --- camel/trunk/components/camel-cxf/src/main/java/org/apache/came= l/component/cxf/CxfHeaderFilterStrategy.java (original) >>>>>>>> +++ camel/trunk/components/camel-cxf/src/main/java/org/apache/came= l/component/cxf/CxfHeaderFilterStrategy.java Wed May =A06 04:56:14 2009 >>>>>>>> @@ -63,6 +63,11 @@ >>>>>>>> =A0 =A0 =A0 =A0 getOutFilter().add(Message.PROTOCOL_HEADERS); >>>>>>>> =A0 =A0 =A0 =A0 getInFilter().add(Message.PROTOCOL_HEADERS); >>>>>>>> >>>>>>>> + =A0 =A0 =A0 =A0// Since the DefaultCxfBinding deal with the cont= ent-type separately. >>>>>>>> + =A0 =A0 =A0 =A0// We need to filter this header >>>>>>>> + =A0 =A0 =A0 =A0getOutFilter().add("content-type"); >>>>>>>> + =A0 =A0 =A0 =A0getInFilter().add("content-type"); >>>>>>>> + >>>>>>>> =A0 =A0 =A0 =A0 // initialize message header filter map with defau= lt SOAP filter >>>>>>>> =A0 =A0 =A0 =A0 messageHeaderFiltersMap =3D new HashMap(); >>>>>>>> =A0 =A0 =A0 =A0 addToMessageHeaderFilterMap(new SoapMessageHeaderF= ilter()); >>>>>>>> >>>>>> >>>> >>>> >>>> -- >>>> Claus Ibsen >>>> Apache Camel Committer >>>> >>>> Open Source Integration: http://fusesource.com >>>> Blog: http://davsclaus.blogspot.com/ >>>> Twitter: http://twitter.com/davsclaus >>>> Apache Camel Reference Card: >>>> http://refcardz.dzone.com/refcardz/enterprise-integration >>>> Interview with me: >>>> http://architects.dzone.com/articles/interview-claus-ibsen-about?mz=3D= 7893-progress >>>> >>> >> >> >