This topic has not yet been written. The content below is from the topic description.
Example 44.4. Unmarshalling example The RESTEasy JavaScript client API can automatically unmarshall JSON and XML: @Path("orders") public interface Orders { @XmlRootElement public static class Order { @XmlElement private String id; public Order(){} public Order(String id){ this.id = id; } } @Path("{id}/xml") @GET @Produces("application/xml") public Order getOrderXML(@PathParam("id") String id){ return new Order(id); } @Path("{id}/json") @GET @Produces("application/json") public Order getOrderJSON(@PathParam("id") String id){ return new Order(id); } } Let us look at what the preceding JAX-RS API would give us on the client side: // this returns a JSON object var orderJSON = Orders.getOrderJSON({id: "23"}); orderJSON.id == "23"; // this one returns a DOM Document whose root element is the order, with one child (id) // whose child is the text node value var orderXML = Orders.getOrderXML({id: "23"}); orderXML.documentElement.childNodes[0].childNodes[0].nodeValue == "23";