the reverse of SOAPMessage's writeTo(out) method

Q

Qingchun Guo

Java's "SOAPMessage" class has a "writeTo" method, which writes a
SOAPMessage object into an outputStream, like this:

SOAPMessage mySoapMessage = ...;
mySoapMessage.writeTo(OutputStream out);

What if I want to do the reverse? That is, suppose I have an
inputStream which contains a SOAPMessage object, how do I read the
data from this inputStream and construct a SOAPMessage object? Is
there a "readFrom" method that works in the following way?

SOAPMessage mySoapMessage = SOAPMessage.readFrom(InputStream in)

Thanks.
 
E

Esmond Pitt

There are two possibilities:

(1) SOAPPart implements org.w3c.dom.Document, so you can use any DOM API
on it.

(2) Use a transform:

SOAPPart.setContent(javax.xml.transform.Source source).

EJP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top