Return-Path: Delivered-To: apmail-cxf-users-archive@www.apache.org Received: (qmail 51829 invoked from network); 24 Oct 2008 09:38:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 24 Oct 2008 09:38:08 -0000 Received: (qmail 18296 invoked by uid 500); 24 Oct 2008 09:38:08 -0000 Delivered-To: apmail-cxf-users-archive@cxf.apache.org Received: (qmail 18240 invoked by uid 500); 24 Oct 2008 09:38:07 -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 18226 invoked by uid 99); 24 Oct 2008 09:38:07 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Oct 2008 02:38:07 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [192.77.186.17] (HELO mx3.progress.com) (192.77.186.17) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Oct 2008 09:36:53 +0000 Received: from mx3.progress.com (127.0.0.1) by mx3.progress.com (MlfMTA v3.2r9) id h06bn00171sg for ; Fri, 24 Oct 2008 05:37:18 -0400 (envelope-from ) Received: from progress.com ([192.233.92.16]) by mx3.progress.com (SonicWALL 6.2.2.1073) with ESMTP; Fri, 24 Oct 2008 05:37:18 -0400 Received: from NTEXFE02.bedford.progress.com (ntexfe02 [10.128.10.26]) by progress.com (8.13.8/8.13.8) with ESMTP id m9O9bIxo022848 for ; Fri, 24 Oct 2008 05:37:18 -0400 (EDT) Received: from sberyoz ([10.5.2.224]) by NTEXFE02.bedford.progress.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 24 Oct 2008 05:37:17 -0400 Message-ID: <015501c935bc$1b459ac0$e002050a@IONAGLOBAL.COM> From: "Sergey Beryozkin" To: References: <490054E9.2080005@solegysystems.com> <011601c934fc$d01834a0$e002050a@IONAGLOBAL.COM> <4900581A.6010108@solegysystems.com> <014601c93505$df67a4f0$e002050a@IONAGLOBAL.COM> Subject: Re: [JAX-RS][Sub-resource locator] No operation matching request Date: Fri, 24 Oct 2008 10:37:17 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.3138 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 X-OriginalArrivalTime: 24 Oct 2008 09:37:18.0063 (UTC) FILETIME=[1B0B77F0:01C935BC] X-Mlf-Version: 6.2.2.1073 X-Mlf-UniqueId: o200810240937180230046 X-Virus-Checked: Checked by ClamAV on apache.org Anoter option is to introduce a cxf-specific extension which would allow the same method be treated as either a resource method or a subresource locator method. It won't interoperate between JAX-RS impls, but it would let users to save on creating a new method - which might be not that easy on a more controlled environments - like this is the 3rd part interface we use and we can't change it type of requirements. The choice will up to a user (enable this feature or not - disabled by default) Cheers, Sergey > Hi Gabo > > Will this work for you : > class AccountService() { > @GET > @Path("/Account/{uniqueId}") > public Account get(@PathParam("uniqueId") long uniqueId) { > return getAccount(); > } > > @Path("/Account/{uniqueId}") > public Account getAccountProperty(@PathParam("uniqueId") long uniqueId) { > return getAccount(); > } > > } > > ? > > So GET /Account/1 will be delivered to get(), while /Account/1/accountId will be handled by Account itself... > Prehaps you may need to add a trailing '/' to the subresource method, but I think it should work just fine without it. > Cheers, Sergey > > >> Hi Sergey, >> >> I just noticed that in the user's guide. My apologies with that. Just a follow-up though, is it possible to be able to receive an >> XML representation of Account in invoking AccountService.get(), while having that sub-resource locator feature? In removing the >> @GET in AccountService.get(), I am no longer able to invoke the said method. >> >> Again, my thanks! >> >> Gabo >> >> Sergey Beryozkin wrote: >>> Hi >>> >>> you have @GET on AccountService.get() so it's not seen as a subresource locator method. >>> if you push @GET down to the Account.getAccountID then it will work... >>> >>> Cheers, Sergey >>> >>> >>> >>>> Hi All, >>>> >>>> I have the following resources: >>>> >>>> //the service class: >>>> >>>> @ConsumeMime("text/xml") >>>> @ProduceMime("text/xml") >>>> public class AccountService{ >>>> @GET >>>> @Path("/Account/{uniqueId}") >>>> public Account get( >>>> @PathParam("uniqueId") >>>> long uniqueId >>>> ) { >>>> //do something here and return the Account object >>>> } >>>> } >>>> >>>> //the account class >>>> @XmlType(name="Account") >>>> @XmlAccessorType(XmlAccessType.PROPERTY) >>>> @XmlRootElement(name="Account") >>>> public class Account { >>>> private String accountID = "" >>>> >>>> @Path("accountID") >>>> public String getAccountID() { >>>> return accountID; >>>> } >>>> >>>> public void setAccountID(String accountID) { >>>> this.accountID = accountID; >>>> } >>>> } >>>> >>>> beans.xml having the following configuration for the service instance: >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> Now, accessing the method that returns an Account object works fine, i.e. access to >>>> http://localhost:8080/rest/Accounts/Account/1 responds with the xml representation of the Account object. >>>> >>>> However, I was hoping to take advantage of Sub-resource locators as mentioned in >>>> http://cwiki.apache.org/CXF20DOC/jax-rs-jsr-311.html . When I try accessing >>>> http://localhost:8080/rest/Accounts/Account/1/accountID , I end up getting a 'No operation matching request'. I'm thinking this >>>> might be caused by the fact that the said method does not take any parameters? or that I have JAX-WS annotations at class level >>>> for the Account class? >>>> >>>> Gabo Manuel >>> ------------------------------------------------------------------------ >>> >>> >>> No virus found in this incoming message. >>> Checked by AVG - http://www.avg.com Version: 8.0.175 / Virus Database: 270.8.2/1740 - Release Date: 10/22/2008 7:24 PM >>> >>> >>