Return-Path: Delivered-To: apmail-cxf-dev-archive@www.apache.org Received: (qmail 73373 invoked from network); 13 Apr 2010 17:31:17 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 13 Apr 2010 17:31:17 -0000 Received: (qmail 60445 invoked by uid 500); 13 Apr 2010 17:31:17 -0000 Delivered-To: apmail-cxf-dev-archive@cxf.apache.org Received: (qmail 60402 invoked by uid 500); 13 Apr 2010 17:31:17 -0000 Mailing-List: contact dev-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list dev@cxf.apache.org Received: (qmail 60393 invoked by uid 99); 13 Apr 2010 17:31:17 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Apr 2010 17:31:17 +0000 X-ASF-Spam-Status: No, hits=3.5 required=10.0 tests=AWL,FREEMAIL_FROM,FREEMAIL_REPLY,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of sberyozkin@gmail.com designates 209.85.218.223 as permitted sender) Received: from [209.85.218.223] (HELO mail-bw0-f223.google.com) (209.85.218.223) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Apr 2010 17:31:12 +0000 Received: by bwz23 with SMTP id 23so3383326bwz.6 for ; Tue, 13 Apr 2010 10:30:50 -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:received:message-id:subject:from:to:content-type; bh=qb7aGOy+vxFXIdzpvHPaktimQ92/PHjVG/Ne4w1dsiA=; b=lfPAXrWdDcwLgFiVdMoDs40LZJZmS6bDvmcV68/BRFRMV8C/ibbQE601YN+2Jtm9xo U/0QphEtcxIUBXxceS+1ecKWkrUhUOEv6Ty1pqwE2PbyB1IicAcx9dT0D1hX/wSlRuSW PwYgdjwIcFud9q/yzEm1LT5nSYN6Fw8+6HL18= 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; b=aM2ql/ICWo9tbkwRDmo/OUbPKpd3oZHouln+eRCH2nwbJIjG8Ove4dSxxcWho42S+4 KeJQBBLk+J/nwkiTJ2gW3LwzUg5E6+/klfWnnABim/+8b/CrEyxnTwQSEEkMTrVF4eQb eKBU1cKCZBULHgp6cTOOVX5L1vfxQ/3IOGIok= MIME-Version: 1.0 Received: by 10.223.126.74 with HTTP; Tue, 13 Apr 2010 10:30:49 -0700 (PDT) In-Reply-To: References: Date: Tue, 13 Apr 2010 18:30:49 +0100 Received: by 10.223.6.153 with SMTP id 25mr3453810faz.81.1271179849160; Tue, 13 Apr 2010 10:30:49 -0700 (PDT) Message-ID: Subject: Re: Question about ClientProxyImpl From: Sergey Beryozkin To: dev@cxf.apache.org Content-Type: multipart/alternative; boundary=0015174761e45ad8a70484219f4a --0015174761e45ad8a70484219f4a Content-Type: text/plain; charset=ISO-8859-1 Hi I'm not sure where a regression might've been introduced but I'll investigate. I think I have a test for proxies using query and path param beans, but no form param beans cheers, Sergey On Mon, Apr 12, 2010 at 11:54 PM, Josh Cummings wrote: > For what it is worth, we experienced the same thing. > > We originally had only one method: > > @POST > @Path("/myResource/{c}/{d}") > @Consumes({"application/x-www-form-urlencoded"}) > public E getE(@FormParam("") A a, @PathParam("") B b); > > We had client Java code and form posts using the one method. Upon > upgrading > to 2.2.7, it appears that the handleForm method gets the String name of our > object instead of the object itself. > > The workaround that we found was to split the code into two methods: > > @POST > @Path("/myResource/{c}/{d}") > @Consumes({"application/xml", "application/json"}) > public E getE(A a, @PathParam("") B b); > > @POST > @Path("/myResource/{c}/{d}") > @Consumes({"application/x-www-form-urlencoded"}) > public E getEForm(@FormParam("") A a, @PathParam("") B b); > > I'm also not certain if this is a bug. > > Thanks, > Josh > > > On Mon, Apr 12, 2010 at 11:39 AM, Jungwoo Jang >wrote: > > > > > Hello all, > > > > I apologize in advance if this is the incorrect mailing list to post this > > question to. > > > > I have a question around whether some behavior I am seeing is a bug or if > > it is functioning as designed. > > > > I am trying out the parameter bean example in the cxf jaxrs > documentation. > > Note the following has been simplified, since I am only worried about > > @FormParam types. > > @Path("/customer/{id}") > > public class CustomerService { > > > > @POST > > public Response addCustomerOrder(@FormParam("") OrderBean bean) { > > ... > > } > > } > > > > public class OrderBean { > > public void setId(Long id) {...} > > public void setWeight(int w) {...} > > } > > > > So, this works when I use a browser as the client. > > But when I use the client runtime library it does not. > > > > CustomerService service = JAXRSClientFactory.create(...); > > service.addCustomerOrder(new OrderBean(123, 150)); > > > > After debugging through the code, it seems like the > > > rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java's > > handleForm(...) method is doing something it shouldn't be doing. > > > > FormUtils.addPropertyToForm(form, p.getName(), > > params[p.getIndex()].toString()); > > > > The params[p.getIndex()] is the OrderBean that I have passed in. But > then > > this code converts it to a String and then in the > > FormUtils.addPropertyToForm method, it makes an > > InjectionUtils.extractValuesFromBean(value, "") call, where the value is > the > > toString() value of the OrderBean. > > > > So, the http request has bytes=somebytes, when I was expecting id=123 and > > weight=150. > > > > Here is the jira ticket that I believe was why this code was introduced. > https://issuesowever, > > . > apache.org/jira/browse/CXF-2389?page=com.atlassian.jira.plugin.ext.subversion%3Asubversion-commits-tabpanel > < > https://issues.apache.org/jira/browse/CXF-2389?page=com.atlassian.jira.plugin.ext.subversion%3Asubversion-commits-tabpanel > > > > > > So, is this bug? I did a search for jira tickets to see if this was > > already a known issue. If it is a bug, should I file a new jira ticket > and > > link it to the ticket mentioned above? > > > > Thanks, > > Jungwoo > > > > > > _________________________________________________________________ > > The New Busy think 9 to 5 is a cute idea. Combine multiple calendars with > > Hotmail. > > > > > http://www.windowslive.com/campaign/thenewbusy?tile=multicalendar&ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_5 > > > > > > -- > Josh Cummings > The Pi-Dye T-Shirt Shop > http://www.pidye.com > 801-556-2751 > > Learn how to be a part of the biggest redistribution of pi in the history > of > mankind at www.pidye.com > --0015174761e45ad8a70484219f4a--