You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Sergey Beryozkin <sb...@gmail.com> on 2015/06/01 21:50:42 UTC

Re: jaxrs client with beanparam service

I think we had an issue with the client not processing the beans where 
the properties (instead of their setters) were directly annotated, and 
got it fixed for 3.0.5. Moving the annotations on the setters is one 
solution, otherwise please migrate to 3.0.5

Sergey
On 26/05/15 17:46, Sonam Samdupkhangsar wrote:
> I have a jaxrs service using beanparam:
>
>         @POST
>         @Produces(MediaType.APPLICATION_JSON)
>         @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
>         @Path("/save")
>         public Object save(@BeanParam MyForm myForm);
>
>
> MyForm.java
>
> Class MyForm {
> @FormParam("firstName")
>         private String firstName;
>
>         @FormParam("middleName")
>         private String middleName;
> ...
> }
>
> My JaxRs client:
>
> List<Object> providers = new ArrayList<Object>();
>                providers.add(new JacksonJsonProvider());
>
>
> MyWebservice myWebservice = JAXRSClientFactory.create(ENDPOINT_ADDRESS,
>                             MyWebservice.class, providers);
>
> myForm.setFirstName("John");
> myForm.setMiddleName("Orlando");
>
> //calling my save method of the service with myForm data
> myWebservice.save(myForm);
>
>
> When I receive the myForm object on the service side the data inside MyForm are null for firstName and middleName.  Is there something I am missing?
>
> Thanks
> -Sonam
>
>


-- 
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com