I have configured a web service endpoint as below.
@POST
@Consumes({MediaType.APPLICATION_XML})
@Produces({MediaType.TEXT_PLAIN})
@Path("/post")
public String postPerson(Person pers) throws Exception{
String xml_string_posted="?";
System.out.println(<xml_string_posted>);
JAXBContext jc = JAXBContext.newInstance(Person.class);
XMLInputFactory xif = XMLInputFactory.newFactory();
XMLStreamReader xsr = xif.createXMLStreamReader(new StreamSource());
}
My Question is very simple. Whenever there is POST request submitted to this endpoint like below, how can i get the whole XML string posted below into a variable.
POST /JX-1.0/service/person/post HTTP/1.1
Host:
Content-Type: application/xml
X-Requested-With: XMLHttpRequest
<?xml version="1.0"?>
<a>
<b>&name;</b>
</a>