@SuppressWarnings("unchecked")
@Test
public void testJAXBRead() throws Exception {
String data = "<Book><id>127</id><name>CXF</name><state></state></Book>";
Service s = new JAXRSServiceImpl(Collections.singletonList(c), true);
DataBinding binding = new JAXBDataBinding();
binding.initialize(s);
DataBindingProvider p = new DataBindingProvider(binding);
ByteArrayInputStream is = new ByteArrayInputStream(data.getBytes());
Book book = (Book)p.readFrom((Class)Book.class, Book.class,
new Annotation[0], MediaType.APPLICATION_XML_TYPE,
new MetadataMap<String, String>(), is);