Hi,
    The xml will be in the request SoapContext. You can save the SoapContext
into a string and then if you know the root of the xml(ie in eg <stuff>),
parse the string from that point and get the remaining part of the xml. Or
you could unmarshall the whole xml to get teh desired values and then again
marshall them into xml for like in Addressbook example of Apache Soap. See
the serializers and deserializers for more clarity.

Thanks,
Jyothi

-----Original Message-----
From: X X [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 06, 2001 2:27 AM
To: [EMAIL PROTECTED]
Subject: Extracting XML from SOAP message (again)


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

Reply via email to