users@jersey.java.net

Re: [Jersey] Consuming XML using Jersey

From: Pavel Bucek <Pavel.Bucek_at_Sun.COM>
Date: Fri, 05 Mar 2010 09:04:33 +0100

Hello,

You can use JAXB to automatically parse incoming XML message; look at
jaxb [1] sample for more details.

Regards,

Pavel


[1]
https://jersey.dev.java.net/source/browse/jersey/trunk/jersey/samples/jaxb/

emile wrote:
> Hi,
>
> I have the following method -
>
> @POST
> @Consumes(MediaType.APPLICATION_XML)
> @Produces(MediaType.APPLICATION_XML)
> public String getObjectAsXML()
>
> the method obtains a request along with an XML object and returns the object
> from a repository as an XML object. Not sure how to parse the incoming XML
> to set the object properties. Any pointers on this would be helpful.
>