Spring Web Services Framework

org.springframework.ws.soap.axiom
Class AxiomSoapMessage

java.lang.Object
  extended by org.springframework.ws.mime.AbstractMimeMessage
      extended by org.springframework.ws.soap.AbstractSoapMessage
          extended by org.springframework.ws.soap.axiom.AxiomSoapMessage
All Implemented Interfaces:
FaultAwareWebServiceMessage, MimeMessage, SoapMessage, StreamingWebServiceMessage, WebServiceMessage

public class AxiomSoapMessage
extends AbstractSoapMessage
implements StreamingWebServiceMessage

AXIOM-specific implementation of the SoapMessage interface. Created via the AxiomSoapMessageFactory, wraps a SOAPMessage.

Since:
1.0.0
Author:
Arjen Poutsma
See Also:
SOAPMessage

Constructor Summary
AxiomSoapMessage(SOAPFactory soapFactory)
          Create a new, empty AxiomSoapMessage.
AxiomSoapMessage(SOAPFactory soapFactory, boolean payloadCaching, boolean langAttributeOnSoap11FaultString)
          Create a new, empty AxiomSoapMessage.
AxiomSoapMessage(SOAPMessage soapMessage, Attachments attachments, String soapAction, boolean payloadCaching, boolean langAttributeOnSoap11FaultString)
          Create a new AxiomSoapMessage based on the given AXIOM SOAPMessage and attachments.
AxiomSoapMessage(SOAPMessage soapMessage, String soapAction, boolean payloadCaching, boolean langAttributeOnSoap11FaultString)
          Create a new AxiomSoapMessage based on the given AXIOM SOAPMessage.
 
Method Summary
 Attachment addAttachment(String contentId, DataHandler dataHandler)
          Add an attachment to the message, taking the content from a DataHandler.
 boolean convertToXopPackage()
          Turns this message into a XOP package.
 Attachment getAttachment(String contentId)
          Returns the Attachment with the specified content Id.
 Iterator<Attachment> getAttachments()
          Returns an Iterator over all Attachment objects that are part of this message.
 SOAPMessage getAxiomMessage()
          Return the AXIOM SOAPMessage that this AxiomSoapMessage is based on.
 Document getDocument()
          Returns this message as a Document.
 SoapEnvelope getEnvelope()
          Returns the SoapEnvelope associated with this SoapMessage.
 String getSoapAction()
          Get the SOAP Action for this message, or null if not present.
 boolean isXopPackage()
          Indicates whether this message is a XOP package.
 void setAxiomMessage(SOAPMessage axiomMessage)
          Sets the AXIOM SOAPMessage that this AxiomSoapMessage is based on.
 void setDocument(Document document)
          Sets the contents of the message to the given Document.
 void setOutputFormat(OMOutputFormat outputFormat)
          Sets the OMOutputFormat to be used when writing the message.
 void setSoapAction(String soapAction)
          Sets the SOAP Action for this message.
 void setStreamingPayload(StreamingPayload payload)
          Sets the streaming payload for this message.
 String toString()
           
 void writeTo(OutputStream outputStream)
          Writes the entire message to the given output stream.
 
Methods inherited from class org.springframework.ws.soap.AbstractSoapMessage
getFaultReason, getPayloadResult, getPayloadSource, getSoapBody, getSoapHeader, getVersion, hasFault
 
Methods inherited from class org.springframework.ws.mime.AbstractMimeMessage
addAttachment, addAttachment
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.springframework.ws.WebServiceMessage
getPayloadResult, getPayloadSource
 
Methods inherited from interface org.springframework.ws.mime.MimeMessage
addAttachment, addAttachment
 

Constructor Detail

AxiomSoapMessage

public AxiomSoapMessage(SOAPFactory soapFactory)
Create a new, empty AxiomSoapMessage.

Parameters:
soapFactory - the AXIOM SOAPFactory

AxiomSoapMessage

public AxiomSoapMessage(SOAPFactory soapFactory,
                        boolean payloadCaching,
                        boolean langAttributeOnSoap11FaultString)
Create a new, empty AxiomSoapMessage.

Parameters:
soapFactory - the AXIOM SOAPFactory

AxiomSoapMessage

public AxiomSoapMessage(SOAPMessage soapMessage,
                        String soapAction,
                        boolean payloadCaching,
                        boolean langAttributeOnSoap11FaultString)
Create a new AxiomSoapMessage based on the given AXIOM SOAPMessage.

Parameters:
soapMessage - the AXIOM SOAPMessage
soapAction - the value of the SOAP Action header
payloadCaching - whether the contents of the SOAP body should be cached or not

AxiomSoapMessage

public AxiomSoapMessage(SOAPMessage soapMessage,
                        Attachments attachments,
                        String soapAction,
                        boolean payloadCaching,
                        boolean langAttributeOnSoap11FaultString)
Create a new AxiomSoapMessage based on the given AXIOM SOAPMessage and attachments.

Parameters:
soapMessage - the AXIOM SOAPMessage
attachments - the attachments
soapAction - the value of the SOAP Action header
payloadCaching - whether the contents of the SOAP body should be cached or not
Method Detail

getAxiomMessage

public final SOAPMessage getAxiomMessage()
Return the AXIOM SOAPMessage that this AxiomSoapMessage is based on.


setAxiomMessage

public final void setAxiomMessage(SOAPMessage axiomMessage)
Sets the AXIOM SOAPMessage that this AxiomSoapMessage is based on.

Calling this method also clears the SOAP Action property.


setOutputFormat

public void setOutputFormat(OMOutputFormat outputFormat)
Sets the OMOutputFormat to be used when writing the message.

See Also:
writeTo(java.io.OutputStream)

setStreamingPayload

public void setStreamingPayload(StreamingPayload payload)
Description copied from interface: StreamingWebServiceMessage
Sets the streaming payload for this message.

Specified by:
setStreamingPayload in interface StreamingWebServiceMessage
Parameters:
payload - the streaming payload

getEnvelope

public SoapEnvelope getEnvelope()
Description copied from interface: SoapMessage
Returns the SoapEnvelope associated with this SoapMessage.

Specified by:
getEnvelope in interface SoapMessage

getSoapAction

public String getSoapAction()
Description copied from interface: SoapMessage
Get the SOAP Action for this message, or null if not present.

Specified by:
getSoapAction in interface SoapMessage
Returns:
the SOAP Action.

setSoapAction

public void setSoapAction(String soapAction)
Description copied from interface: SoapMessage
Sets the SOAP Action for this message.

Specified by:
setSoapAction in interface SoapMessage
Parameters:
soapAction - the SOAP Action.

getDocument

public Document getDocument()
Description copied from interface: SoapMessage
Returns this message as a Document. Depending on the underlying implementation, this Document may be 'live' or not.

Specified by:
getDocument in interface SoapMessage
Returns:
this soap message as a DOM document

setDocument

public void setDocument(Document document)
Description copied from interface: SoapMessage
Sets the contents of the message to the given Document.

Specified by:
setDocument in interface SoapMessage
Parameters:
document - the soap message as a DOM document

isXopPackage

public boolean isXopPackage()
Description copied from interface: MimeMessage
Indicates whether this message is a XOP package.

Specified by:
isXopPackage in interface MimeMessage
Returns:
true when the constraints specified in Identifying XOP Documents are met.
See Also:
XOP Packages

convertToXopPackage

public boolean convertToXopPackage()
Description copied from interface: MimeMessage
Turns this message into a XOP package.

Specified by:
convertToXopPackage in interface MimeMessage
Returns:
true when the message is a XOP package
See Also:
XOP Packages

getAttachment

public Attachment getAttachment(String contentId)
Description copied from interface: MimeMessage
Returns the Attachment with the specified content Id.

Specified by:
getAttachment in interface MimeMessage
Returns:
the attachment with the specified content id; or null if it cannot be found

getAttachments

public Iterator<Attachment> getAttachments()
Description copied from interface: MimeMessage
Returns an Iterator over all Attachment objects that are part of this message.

Specified by:
getAttachments in interface MimeMessage
Returns:
an iterator over all attachments
See Also:
Attachment

addAttachment

public Attachment addAttachment(String contentId,
                                DataHandler dataHandler)
Description copied from interface: MimeMessage
Add an attachment to the message, taking the content from a DataHandler.

Specified by:
addAttachment in interface MimeMessage
dataHandler - the data handler to take the content from
Returns:
the added attachment

writeTo

public void writeTo(OutputStream outputStream)
             throws IOException
Description copied from interface: WebServiceMessage
Writes the entire message to the given output stream.

If the given stream is an instance of TransportOutputStream, the corresponding headers will be written as well.

Specified by:
writeTo in interface WebServiceMessage
Parameters:
outputStream - the stream to write to
Throws:
IOException - if an I/O exception occurs

toString

public String toString()
Overrides:
toString in class Object

Spring Web Services Framework

Copyright © 2005-2013 The Spring Web Services Framework. All Rights Reserved.