2014-05-27 11:12 GMT+02:00 Adrián Roselló Rey <[email protected]>:
> 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:
>
>
>
> *@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?
Hi:
I don't know if I understand your question.
I guess that you want to extract keys and values from URI request
If it's right , I think you can use
@POST
@Consumes("*/*")
public ReturnType myMethod(@QueryParam("") ParameterBean param1)
>
> 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