Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Service Bus
11g Release 1 (11.1.1.4.0)

E15033-02


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 java.lang.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. <p/> 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
static java.lang.String MESSAGE_FACTORY
          an optional transform option used during transformations that tells the transformer to use the specified instance of MessageFactory to create instances of SAAJ messages.
static java.lang.String SOAP12_VERSION
          an optional transform option used during transformations that tells the transformer to create an instance of SOAP Message of specified SOAP protocol when transforming from some Source to SAAJSource <p/> The meaning of the flag is as follows: if set to true - SOAP1.2 protocol version of SOAP Message will be created if set to false - - SOAP1.1 protocol version of SOAP Message will be created if not set - the caller does not know which version If not specified, the source payload will be (partially) parsed in order to determine which SOAP version it uses

 

Fields inherited from interface com.bea.wli.sb.sources.Source
DEFAULT_CHARACTER_SET_ENCODING

 

Constructor Summary
SAAJSource(javax.xml.soap.SOAPMessage message)
           

 

Method Summary
 java.lang.String getCharacterEncoding()
          Returns the character encoding of the message (do we need this?)
 java.io.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(java.io.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

 

Field Detail

MESSAGE_FACTORY

public static final java.lang.String MESSAGE_FACTORY
an optional transform option used during transformations that tells the transformer to use the specified instance of MessageFactory to create instances of SAAJ messages. Be careful when using this option to pass an instance of Message Factory that suppoorts desired SOAP protocol. <p/> e.g.
 MessageFactory msgFactory = isSoap12 ?
    MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL) :
    MessageFactory.newInstance(SOAPConstants.SOAP_1_1_PROTOCOL);
 (or something like 
  MessageFactory msgFactory = isSoap12 ?
   new oracle.j2ee.ws.saaj.soap.MessageFactoryImpl("soap1.2") :
   new oracle.j2ee.ws.saaj.soap.MessageFactoryImpl("soap1.1");
 )
 options.put(SAAJSource.MESSAGE_FACTORY, msgFactory);
 SAAJSource saaj = ...getTransformer().transform(source, SAAJSource.class, options);
 
If not specified, the default platform SAAJ factory will be used.
See Also:
Constant Field Values

SOAP12_VERSION

public static final java.lang.String SOAP12_VERSION
an optional transform option used during transformations that tells the transformer to create an instance of SOAP Message of specified SOAP protocol when transforming from some Source to SAAJSource <p/> The meaning of the flag is as follows:

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 java.lang.String getCharacterEncoding()
Returns the character encoding of the message (do we need this?)
Returns:

getInputStream

public java.io.InputStream getInputStream(TransformOptions options)
                                   throws java.io.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:
java.io.IOException
TransformException

writeTo

public void writeTo(java.io.OutputStream os,
                    TransformOptions options)
             throws java.io.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. <p/> 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:
java.io.IOException
TransformException

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Service Bus
11g Release 1 (11.1.1.4.0)

E15033-02


Copyright © 2008, 2010, Oracle. All rights reserved.