Re: Auto-bindings to SOAPMessage?

From: Jitendra Kotamraju <Jitendra.Kotamraju_at_Sun.COM>
Date: Wed, 26 Nov 2003 14:18:18 -0800

Stream contains the SOAP envelope(not just the payload). You can create
the message in two ways.

1. InputStream is =
    MimeHeaders mimeHeaders = new MimeHeaders();
    mimeHeaders.addHeader("Content-Type", "text/xml");
    MessageFactory msgFactory = MessageFactory.newInstance();
    SOAPMessage msg = msgFactory.createMessage(mimeHeaders, is);

2. MessageFactory mfactory = MessageFactory.newInstance();
    SOAPMessage msg = mfactory.createMessage();
    SOAPPart part = msg.getSOAPPart();
    StreamSource streamSource =


Karr, David wrote:
> Ok, I can see that SAAJ gives me a more direct API for building a
> SOAPMessage. However, I'm trying to find something even more direct
> than this. I have an XML string that represents a SOAP envelope. I
> want to directly create a SOAPMessage object from that.
> Looking in the jwsdp APIs, I see that the MessageFactory class has a
> "createMessage()" method that takes an InputStream, along with some
> MimeHeaders. It's not clear to me from the javadoc exactly what the
> semantics are of the data in the stream. Is it assumed that the stream
> contains the actual SOAP envelope, or does it assume the stream contains
> the payload?
> -----Original Message-----
> From: Kevin Jones []
> Sent: Wednesday, November 26, 2003 9:53 AM
> To:
> Subject: RE: Auto-bindings to SOAPMessage?
> You can use the XML APIs directly to create a DOM, or even use the StAX
> APIs and use XMLStreamWriter. However it sounds like what you want is
> SAAJ. Check out the SAAJ specification and docs (the docs are in the
> JWSDP the spec is on,
> Kevin Jones
>>-----Original Message-----
>>From: Karr, David []
>>Sent: 26 November 2003 16:29
>>Subject: Auto-bindings to SOAPMessage?
>>At a high-level, I'm familiar with most of the specs in this
>>arena, but I haven't gotten into much code here yet. I'm
>>starting to investigate using some parts of JAX-RPC to do
>>some routing and translations of web services requests in
>>different forms. For instance, I may be taking a string
>>representing either a soap envelope or the payload for the
>>eventual envelope (which to expect is determined by init
>>params or context). I then want to create a SOAPMessage
>>object representing that. What strategies are available in
>>the jwsdp for translating the XML string into a SOAPMessage
>>object? I know of JAXB for binding XML into defined objects,
>>but is there anything for predefined bindings for XML into
>>To unsubscribe, e-mail:
>>For additional commands, e-mail:
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail: