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?

Reply via email to