You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@ws.apache.org by Jim Hazen <ji...@myplay.com> on 2001/05/11 22:09:33 UTC

Why is it so hard to create SOAP container objects, and use network objects?

Guys,

Why does soap make it so difficult to translate between various container
objects?

Specifically it should be pretty easy to go from:

Call -> Envelope
Envelope -> Call

As it is now, there is no easy way to modify or add attributes to a call's
envelope.  You can extract an envelope from a call, and modify it, but then it's
hard to get it back into a call.  There is Call.extractFromEnvelope(), but you
need a ServerManager for this, something a client side app doesn't have!!

You could send an envelope yourself using a SOAPHTTPConnection, however when
you're done, you can't get back a useful reponse!  You can get back the
BufferedReader and look at the headers and XML.  There is a way to get an
Envelope from an InputStream, however SOAPHTTPConnections don't return
InputStreams, they only return Readers.  Java does not currently support a
ReaderInputStream.  This is a compete catch 22 and a PITA.  If you really wanted
to, you might be able to use a SOAPHTTPConnection and read that into a String.
Then use a StringBufferInputStream to read the result and contruct an envelope.
But StringBufferInputStream is deprecated.  You could convert the String to a
byte[] and then use a ByteArrayInputStream.  I think this might actually work,
but look at the amount of trouble it took, just to be able to add an attribute
to an Envelope and send it.

Please SOAP developers add more utility methods, and don't have container
objects require things like a ServerManager.

Thanks,
Jim




---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org