Affirmative, it worked! Thank you all guys
2014-05-27 20:33 GMT+02:00 Jose María Zaragoza <[email protected]>: > 2014-05-27 17:45 GMT+02:00 Craig McClanahan <[email protected]>: > > The curl command you are using sends data the same way a form post does > in > > HTML, so the media type you want is: > > > > @Consumes(MediaType.APPLICATION_FORM_URLENCODED) > > > > Craig > > > > > > > > On Tue, May 27, 2014 at 2:12 AM, Adrián Roselló Rey < > > [email protected]> wrote: > > > >> Hi all! > >> > >> I'm using JAXRSClientFactoryBean to create REST clients for my > application. > >> I'm building the interface that will be used as resource class for > >> JAXRSClientFactoryBean to provide the client. > >> > >> The server always produces and consumes "application/xml" MediaType, so > >> I'm adding following annotations to the methods: > > > Right. > Then, you can use FormParam instead of QueryForm > > > >> > >> > >> > >> > *@Produces(MediaType.APPLICATION_XML)@Consumes(MediaType.APPLICATION_XML) * > >> *public ReturnType myMethod(ParameterType param1)* > >> > >> > >> My data types are serialized and deserialized by JAXB perfectly. > >> > >> Now I have to send a POST method with the following structure: > >> > >> curl -v -X POST "http://server/service.xml" -d > 'param1=1234¶m2=24523' > >> > >> > >> As you could see, the body of the message is no longer an XML, and its > >> structure is like the query parameters one. > >> > >> My question is, is there annotation I can use in my method so its > >> parameters are serialized in this format? > >> > >> Thanks a lot! > >> > >> All the best, > >> > >> Adrián Rosello Rey > >> > >> > >> > >> -- > >> > >> > >> > >> > >> * Adrián Roselló Rey Distributed Applications and Networks Area (DANA) > >> i2CAT Foundation, Barcelona, Spain* > >> T: +34 93 553 25 49 > >> http://dana.i2cat.net > >> > -- * Adrián Roselló Rey Distributed Applications and Networks Area (DANA) i2CAT Foundation, Barcelona, Spain* T: +34 93 553 25 49 http://dana.i2cat.net
