the reverse of SOAPMessage's writeTo(out) method

Discussion in 'Java' started by Qingchun Guo, Feb 28, 2004.

  1. Qingchun Guo

    Qingchun Guo Guest

    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.
    Qingchun Guo, Feb 28, 2004
    #1
    1. Advertising

  2. Qingchun Guo

    Esmond Pitt Guest

    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

    Qingchun Guo wrote:
    > 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.
    Esmond Pitt, Feb 29, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mei Qin

    writeto csv file

    Mei Qin, Jun 14, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    443
    Raterus
    Jun 15, 2004
  2. Zoury
    Replies:
    3
    Views:
    5,655
    Zoury
    Aug 4, 2005
  3. iksrazal
    Replies:
    0
    Views:
    1,368
    iksrazal
    Nov 4, 2003
  4. Luke Webber
    Replies:
    0
    Views:
    868
    Luke Webber
    Oct 13, 2005
  5. MORALBAROMETER
    Replies:
    0
    Views:
    353
    MORALBAROMETER
    Mar 2, 2007
Loading...

Share This Page