I have been doing lots of googling lately trying to find a decent documentation/tutorial to consume XML in JAVA RestFUL implementation of webservice. My requirements are simple
Which means that i need XML in raw. I don't need any JAXB binding or any objection conversation. Can someone point me to some decent tutorial or post something here
@POST
@Consumes(MediaType.APPLICATION_XML)
public void consumeXML (/*something here- duno what*/){
//something here as well
}
thanks
I would recommend specifying an InputStream as the method parameter.
@POST
@Consumes(MediaType.APPLICATION_XML)
public void consumeXML ( InputStream xml ){
//do something with the XML string
}
Then the InputStream can be processed using any number of technologies: DOM, SAX, StAX, JAXB, etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With