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://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