0

Can anyone please explain hot to implement RESTful service and post data in an xml and cnsume the xml at the service and map it to a java bean class? It would be better if an example can be posted. I have tried it using a json object using this http://www.mkyong.com/webservices/jax-rs/restful-java-client-with-resteasy-client-framework/ but not able to do it with an xml

Sushant
  • 173
  • 1
  • 4
  • 15

2 Answers2

0

Add to your REST methods:

@Consumes("application/xml") and @Produces("application/xml"). Your method would consume/produce XML.

Piotr Kochański
  • 21,862
  • 7
  • 70
  • 77
0

The same site that you tried the json example also provides a RESTEasy + JAXB example. Hope this helps.

Lan
  • 6,470
  • 3
  • 26
  • 37