cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Josh Cummings <>
Subject Re: Question about ClientProxyImpl
Date Mon, 12 Apr 2010 22:54:59 GMT
For what it is worth, we experienced the same thing.

We originally had only one method:

    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:

    @Consumes({"application/xml", "application/json"})
    public E getE(A a, @PathParam("") B b);

    public E getEForm(@FormParam("") A a, @PathParam("") B b);

I'm also not certain if this is a bug.


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/'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,
> 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.

Josh Cummings
The Pi-Dye T-Shirt Shop

Learn how to be a part of the biggest redistribution of pi in the history of
mankind at

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message