[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Ksoap: Sending and receiving Elements


Hi,

I need to be able to send and receive instances of org.kxml.kdom.Element as
a body of SoapEnvelope.  As far as I can tell, this is not directly
supported by kSOAP.  I wonder if anybody has encountered a similar need and
can contribute an example.  Any suggestions for implementing it would be
greatly appreciated.

If I understand correctly, I can set a SoapEnvelope body of type Element
like this:
    Element el;
    ... // el is initialized and populated
    SoapEnvelope envelope = new SoapEnvelope();
    envelope.setBody(request.toString());  // Is this correct?

Later the returned value is processed:
    // connection is set up elsewhere
    Reader reader = new InputStreamReader(((StreamConnection)
connection).openInputStream());
    XmlParser parser = new XmlParser(reader);
    envelope.parse(parser);

Assuming the above is correct, my question is: how do I convert the
resultant envelope.getBody() to an Element?

Thanks in advance,
Daniel Feygin