Return-Path: Delivered-To: apmail-cxf-users-archive@www.apache.org Received: (qmail 29254 invoked from network); 28 Sep 2008 17:14:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 28 Sep 2008 17:14:58 -0000 Received: (qmail 80429 invoked by uid 500); 28 Sep 2008 17:14:55 -0000 Delivered-To: apmail-cxf-users-archive@cxf.apache.org Received: (qmail 80380 invoked by uid 500); 28 Sep 2008 17:14:54 -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 80369 invoked by uid 99); 28 Sep 2008 17:14:54 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 28 Sep 2008 10:14:54 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of sergey.beryozkin@iona.com designates 12.170.54.180 as permitted sender) Received: from [12.170.54.180] (HELO amer-mx1.iona.com) (12.170.54.180) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 28 Sep 2008 17:13:54 +0000 X-IronPort-AV: E=Sophos;i="4.33,326,1220241600"; d="scan'208";a="15260791" Received: from amer-ems1.ionaglobal.com ([10.65.6.25]) by amer-mx1.iona.com with ESMTP; 28 Sep 2008 13:13:27 -0400 Received: from sergeyD820 ([10.2.9.3]) by amer-ems1.IONAGLOBAL.COM with Microsoft SMTPSVC(6.0.3790.1830); Sun, 28 Sep 2008 13:13:26 -0400 From: "Sergey Beryozkin" To: Subject: RE: Apache CXF REST url resolution issue Date: Sun, 28 Sep 2008 18:13:25 +0100 MIME-Version: 1.0 X-Mailer: Microsoft Office Outlook, Build 11.0.5510 In-Reply-To: <1b3180f80809280341x748e3a6ai47405a267e22fc27@mail.gmail.com> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962 Thread-Index: AckhVta3Z7mjfTqPTueHFp5acLrjtQANaIaA Message-ID: X-OriginalArrivalTime: 28 Sep 2008 17:13:27.0034 (UTC) FILETIME=[857B85A0:01C9218D] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi, I don't think JAX-RS allows for this but perhaps there's a space for a CXF-specific extension here. In meantime you can probably do something like this : @Context UriInfo ui; @GET @Path("/employee/{employeeId}/hello/{helloId}") public Employee getEmployee2(@PathParam("employeeId") String employeeId,@PathParam("helloId")String helloId) { if (ui.getQueryParameters().contains("hi1") { // do hi1 processing } //etc } There's also a cxf private feature : @GET @Path("/employee/{employeeId}/hello/{helloId}") public Employee getEmployee2(@PathParam("employeeId") String employeeId,@PathParam("helloId")String helloed, @QueryParam("") HiBean bean) { } So if you have HiBean class with setHi1 and setHi2 methods, then HiBean instance will have either or all of these methods called. Depending on what is provided in the query list Cheers, Sergey -----Original Message----- From: Sourashis Roy [mailto:sourashis@gmail.com] Sent: 28 September 2008 11:41 To: users@cxf.apache.org Subject: Apache CXF REST url resolution issue Hi, I am trying to use CXF for building some REST services. However I am having some problems trying to resolve the urls. It seesm that CXF only resolves the url to API call based on the path annotation and does not take into account the queryparam annotation. For example I have 2 API calls @GET @Path("/employee/{employeeId}/hello/{helloId}") public Employee getEmployee2(@PathParam("employeeId") String employeeId,@PathParam("helloId")String helloId,@QueryParam("hi2") String val) { //Do something } @GET @Path("/employee/{employeeId}/hello/{helloId}") public Employee getEmployee1(@PathParam("employeeId") String employeeId,@PathParam("helloId")String helloId,@QueryParam("hi1") String val) { //Do something } For the 2 calls the @Path annotation is the same but if you look at the @QueryParam annotation they are different (one take "hi1" and the other takes "hi2"). However, CXF doesnt seem to recognize this. It always calls the same function irrespective of whether we pass hi1 or hi2 as the query parameter. Is there some way to tell CXF to distinguish between the two urls. I need to resolve this issue pretty urgently and I will appreciate any help in this regard. Regards Sourashis ---------------------------- IONA Technologies PLC (registered in Ireland) Registered Number: 171387 Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland