com.bea.wli.sb.sources
Class SAAJSource

java.lang.Object
  extended by com.bea.wli.sb.sources.SAAJSource
All Implemented Interfaces:
Source

public class SAAJSource
extends Object
implements Source

An implementation of Source that is backed by a SAAJ SOAPMessage object. A SAAJSource is typically converted to and from MessageContextSource and MimeSource.

The serialization representation of this source is entirely determined by the SOAPMessage object. However, character-set encoding can be modified via the TransformOptions.CHARACTER_ENCODING options.


Field Summary
 
Fields inherited from interface com.bea.wli.sb.sources.Source
DEFAULT_CHARACTER_SET_ENCODING
 
Constructor Summary
SAAJSource(javax.xml.soap.SOAPMessage message)
           
 
Method Summary
 String getCharacterEncoding()
          Returns the character encoding of the message (do we need this?)
 InputStream getInputStream(TransformOptions options)
          Returns streaming byte-baseed representation of the Source's content.
 javax.xml.soap.SOAPMessage getSOAPMessage()
          Returns the underlying SOAPMessage.
 void writeTo(OutputStream os, TransformOptions options)
          Serializes the Source's content to a byte-based stream.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SAAJSource

public SAAJSource(javax.xml.soap.SOAPMessage message)
Method Detail

getSOAPMessage

public javax.xml.soap.SOAPMessage getSOAPMessage()
Returns the underlying SOAPMessage.

Returns:

getCharacterEncoding

public String getCharacterEncoding()
Returns the character encoding of the message (do we need this?)

Returns:

getInputStream

public InputStream getInputStream(TransformOptions options)
                           throws IOException,
                                  TransformException
Description copied from interface: Source
Returns streaming byte-baseed representation of the Source's content. The representation of that serialization is entirely up to the Source. Note that this method may involve an internal transformation, although it should not in any way change the underlying content.

Specified by:
getInputStream in interface Source
Parameters:
options - Options used to affect the serialization
Returns:
an InputStream for retrieving the serialized content
Throws:
IOException
TransformException

writeTo

public void writeTo(OutputStream os,
                    TransformOptions options)
             throws IOException,
                    TransformException
Description copied from interface: Source
Serializes the Source's content to a byte-based stream. The representation of that serialization is entirely up to the Source. The Source is forbidden from closing the provided OutputStream, although it is allowed to flush it. However, flushing the stream should be left to the caller, if possible.

Note that this method may involve an internal transformation, although it should not in any way change the underlying content.

Specified by:
writeTo in interface Source
Parameters:
os - the OutputStream to which serialized content will be written
options - TransformOptions used to affect the serialization
Throws:
IOException
TransformException