Getting Raw XML From SOAPMessage in Java
Posted
by Daniel Lew
on Stack Overflow
See other posts from Stack Overflow
or by Daniel Lew
Published on 2009-02-06T22:04:00Z
Indexed on
2010/04/13
7:43 UTC
Read the original article
Hit count: 295
I've set up a SOAP WebServiceProvider in JAX-WS, but I'm having trouble figuring out how to get the raw XML from a SOAPMessage (or any Node) object. Here's a sample of the code I've got right now, and where I'm trying to grab the XML:
@WebServiceProvider(wsdlLocation="SoapService.wsdl")
@ServiceMode(value=Service.Mode.MESSAGE)
public class SoapProvider implements Provider<SOAPMessage>
{
public SOAPMessage invoke(SOAPMessage msg)
{
// How do I get the raw XML here?
}
}
Is there a simple way to get the XML of the original request? If there's a way to get the raw XML by setting up a different type of Provider (such as Source), I'd be willing to do that, too.
© Stack Overflow or respective owner