cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jungwoo Jang <>
Subject Question about ClientProxyImpl
Date Mon, 12 Apr 2010 17:39:53 GMT

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.
public class CustomerService {

    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.

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?

The New Busy think 9 to 5 is a cute idea. Combine multiple calendars with Hotmail.
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message