I'm one of the people who asked and never got an answer, but here is my
best guess. The XML that you're transmitting comes to the soap service
in the body of the envelope, you can get to it either by unmarshalling
(stream -> object) the envelope into an object, mostlikely a
StringWriter, and then extract what you sent. It will still have the
envelope and body nodes. Or you can get the body of the envelope and
then unmarshall it (which takes a little work) into an object most
likely a StringWriter. Once you have the StringWriter it's easy. The
other option is to send the XML as an attachment to the message the in
the service you get the attachment and there it is. This assumes that
it was never an XML document.
Rich Catlett
X X wrote:
> Hi,
>
> I looked at the mail list archives and noticed this question has been
> asked several times before, however, it seems that it has never been
> fully answered.
>
> I have a written a "message-oriented" Apache SOAP service that has one
> method called foo...
>
> void foo(Envelope envelope,
> SOAPContext reqCtx,
> SOAPContext resCtx)
> {
> System.out.println("ENTER Foo");
>
> resCtx.setRootPart("I got your message",
> "text/xml");
>
> System.out.println("EXIT Foo");
> }
>
> It works just fine.
>
> Now I want to expand foo's functionality to print out the XML portion
> of the SOAP message that it receives. So, if my client side sends the
> following SOAP message...
>
> <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
> <s:Body>
> <foo xmlns="urn:Foo">
> <Stuff>
> <One>
> <AAA ID="1"></AAA>
> <BBB ID="1"></BBB>
> </One>
> <Two>
> <AAA ID="1"></AAA>
> <BBB ID="1"></BBB>
> </Two>
> </Stuff>
> </foo>
> </s:Body>
> </s:Envelope>
>
> My service will display this...
>
> <Stuff>
> <One>
> <AAA ID="1"></AAA>
> <BBB ID="1"></BBB>
> </One>
> <Two>
> <AAA ID="1"></AAA>
> <BBB ID="1"></BBB>
> </Two>
> </Stuff>
>
> My question is (which has been asked before) how do extract the XML
> from the SOAP message? Where is the XML at? In the Envelope? In the
> request SOAPContext? ???
>
> Thanks.
>
>
> _________________________________________________________________
> Get your FREE download of MSN Explorer at
> http://explorer.msn.com/intl.asp
>