Re: How to parse SOAP response?

"Scott Nichol" <[email protected]>
Newsgroups gmane.text.xml.soap.user
Message-ID <024101c43693$64c65b30$6401a8c0@northgate>
Basically, you need to do what Call#invoke does after the st.send() call.  You will need to create a SOAPMappingRegistry instance as part of this, and initialize it for any types beyond those implicitly supported (which is the same as RPC API users already do).

Scott Nichol

Do not send e-mail directly to this e-mail address,
because it is filtered to accept only mail from
specific mail lists.
----- Original Message ----- 
From: "T.J. Hoo" <[email protected]>
To: <[email protected]>
Sent: Monday, May 10, 2004 4:18 AM
Subject: How to parse SOAP response?


Hi!

I'm writing a standalone client to construct and send a SOAP message to a
server.
The response received from the server looks like the following:

    HTTP/1./1 200 OK
    ...
    <env:Envelope...>
      ...
      <env:Body>
        <Response>
          <Status>
            <Code>0</Code>
          </Status>
        </Response>
      </env:Body>
    </env:Envelope>


and currently, the program parses the response like the following:

    SOAPTransport st = msg.getSOAPTransport ();
    BufferedReader br = st.receive ();
    String line;
    while ((line = br.readLine ()) != null) {
      if (line.indexOf("<Code>0</Code") >= 0)
   return true;
    }
    return false;


the above code looks ugly and gross, and I want to know how to convert the
SOAP response into a XML document/Envelope object so that I'm able to lookup
the XML element value easily. Is this possible?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.