Return-Path: Delivered-To: apmail-cxf-users-archive@www.apache.org Received: (qmail 58040 invoked from network); 18 Mar 2009 21:37:40 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 18 Mar 2009 21:37:40 -0000 Received: (qmail 51291 invoked by uid 500); 18 Mar 2009 21:37:37 -0000 Delivered-To: apmail-cxf-users-archive@cxf.apache.org Received: (qmail 51258 invoked by uid 500); 18 Mar 2009 21:37:37 -0000 Mailing-List: contact users-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@cxf.apache.org Delivered-To: mailing list users@cxf.apache.org Received: (qmail 51247 invoked by uid 99); 18 Mar 2009 21:37:37 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Mar 2009 14:37:37 -0700 X-ASF-Spam-Status: No, hits=2.6 required=10.0 tests=DNS_FROM_OPENWHOIS,SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Mar 2009 21:37:28 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1Lk3Rj-0004tm-Qw for users@cxf.apache.org; Wed, 18 Mar 2009 14:37:07 -0700 Message-ID: <22589046.post@talk.nabble.com> Date: Wed, 18 Mar 2009 14:37:07 -0700 (PDT) From: Sergey Beryozkin To: users@cxf.apache.org Subject: RE: How to get HTTP header values for a REST app In-Reply-To: <22587756.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: sergey.beryozkin@iona.com References: <22584486.post@talk.nabble.com> <22585555.post@talk.nabble.com> <22587756.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org I think I might've fixed it for 2.2 - it should be case-insensitive - but I'll verify again Cheers, Sergey HG-1 wrote: > > I think I figured out the problem...case sensitivivity... > The HTTP header has upper/lower case char in the header name, but when you > use the HeaderParam annotation, you must give all lowercase. So the > following worked: > > @GET > @Path("/get/{id}") > public Response getInfo(@HeaderParam("myheaderkeyname") String keyValue, > @PathParam(value = "id") String myid) > > > > > HG-1 wrote: >> >> Here is the HTTP packet: >> >> GET /test_ws/ws/get/guid-100 HTTP/1.1 >> MyHeaderKeyName: testdata >> User-Agent: Java/1.6.0_11 >> Host: localhost:8080 >> Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2 >> Connection: keep-alive >> >> >> >> >> >> >> Sergey Beryozkin-2 wrote: >>> >>> Hi >>> >>> This should work in 2.1.4 without problems. >>> Can you post please on-the-wire representation of MyHeaderKeyName ? >>> Thanks, Sergey >>> >>> -----Original Message----- >>> From: HG-1 [mailto:hgovind@proofpoint.com] >>> Sent: 18 March 2009 17:38 >>> To: users@cxf.apache.org >>> Subject: How to get HTTP header values for a REST app >>> >>> >>> All, >>> >>> How do I get HTTP header values for a REST interface. >>> I have tried to get HTTP header values in in my REST application using >>> CXF >>> 2.1.4 and 2.1.3 without success. Here is my method declaration. >>> >>> @GET >>> @Path("/get/{id}") >>> public Response getInfo(@HeaderParam("MyHeaderKeyName") String keyValue, >>> @PathParam(value = "id") String myid) >>> >>> I also tried: >>> @GET >>> @Path("/get/{id}") >>> public Response getInfo(@HeaderParam(value="MyHeaderKeyName") String >>> keyValue, @PathParam(value = "id") String myid) >>> >>> When my method is called, keyValue is always null. >>> Any suggestion would be helpful. >>> >>> Thanks for your help. >>> HG >>> -- >>> View this message in context: >>> http://www.nabble.com/How-to-get-HTTP-header-values-for-a-REST-app-tp225 >>> 84486p22584486.html >>> Sent from the cxf-user mailing list archive at Nabble.com. >>> >>> >>> >> >> > > -- View this message in context: http://www.nabble.com/How-to-get-HTTP-header-values-for-a-REST-app-tp22584486p22589046.html Sent from the cxf-user mailing list archive at Nabble.com.