Class AxiomSoapMessage
java.lang.Object
org.springframework.ws.mime.AbstractMimeMessage
org.springframework.ws.soap.AbstractSoapMessage
org.springframework.ws.soap.axiom.AxiomSoapMessage
- All Implemented Interfaces:
FaultAwareWebServiceMessage
,MimeMessage
,SoapMessage
,StreamingWebServiceMessage
,WebServiceMessage
AXIOM-specific implementation of the
SoapMessage
interface. Created via the
AxiomSoapMessageFactory
, wraps a SOAPMessage
.- Since:
- 1.0.0
- See Also:
-
SOAPMessage
-
Constructor Summary
ConstructorsConstructorDescriptionAxiomSoapMessage
(org.apache.axiom.soap.SOAPFactory soapFactory) Create a new, emptyAxiomSoapMessage
.AxiomSoapMessage
(org.apache.axiom.soap.SOAPFactory soapFactory, boolean payloadCaching, boolean langAttributeOnSoap11FaultString) Create a new, emptyAxiomSoapMessage
.AxiomSoapMessage
(org.apache.axiom.soap.SOAPMessage soapMessage, String soapAction, boolean payloadCaching, boolean langAttributeOnSoap11FaultString) Create a newAxiomSoapMessage
based on the given AXIOMSOAPMessage
.AxiomSoapMessage
(org.apache.axiom.soap.SOAPMessage soapMessage, org.apache.axiom.attachments.Attachments attachments, String soapAction, boolean payloadCaching, boolean langAttributeOnSoap11FaultString) Create a newAxiomSoapMessage
based on the given AXIOMSOAPMessage
and attachments. -
Method Summary
Modifier and TypeMethodDescriptionaddAttachment
(String contentId, jakarta.activation.DataHandler dataHandler) Add an attachment to the message, taking the content from aDataHandler
.boolean
Turns this message into a XOP package.protected String
determineContentType
(org.apache.axiom.om.OMOutputFormat outputFormat, SoapVersion soapVersion) Determine the "Content-Type" header to use.getAttachment
(String contentId) Returns theAttachment
with the specified content Id.Returns anIterator
over allAttachment
objects that are part of this message.final org.apache.axiom.soap.SOAPMessage
Return the AXIOMSOAPMessage
that thisAxiomSoapMessage
is based on.Returns this message as aDocument
.Returns theSoapEnvelope
associated with this message.Get the SOAP Action for this message, ornull
if not present.boolean
Indicates whether this message is a XOP package.final void
setAxiomMessage
(org.apache.axiom.soap.SOAPMessage axiomMessage) Sets the AXIOMSOAPMessage
that thisAxiomSoapMessage
is based on.void
setDocument
(Document document) Sets the contents of the message to the givenDocument
.void
setOutputFormat
(org.apache.axiom.om.OMOutputFormat outputFormat) Sets theOMOutputFormat
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.toString()
void
writeTo
(OutputStream outputStream) Writes the entire message to the given output stream.protected void
writeTo
(OutputStream outputStream, org.apache.axiom.om.OMOutputFormat outputFormat) Writes the entire message to the given output stream using the givenOMOutputFormat
.Methods inherited from class org.springframework.ws.soap.AbstractSoapMessage
getFaultCode, 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.mime.MimeMessage
addAttachment, addAttachment
Methods inherited from interface org.springframework.ws.WebServiceMessage
getPayloadResult, getPayloadSource
-
Constructor Details
-
AxiomSoapMessage
public AxiomSoapMessage(org.apache.axiom.soap.SOAPFactory soapFactory) Create a new, emptyAxiomSoapMessage
.- Parameters:
soapFactory
- the AXIOM SOAPFactory
-
AxiomSoapMessage
public AxiomSoapMessage(org.apache.axiom.soap.SOAPFactory soapFactory, boolean payloadCaching, boolean langAttributeOnSoap11FaultString) Create a new, emptyAxiomSoapMessage
.- Parameters:
soapFactory
- the AXIOM SOAPFactory
-
AxiomSoapMessage
public AxiomSoapMessage(org.apache.axiom.soap.SOAPMessage soapMessage, String soapAction, boolean payloadCaching, boolean langAttributeOnSoap11FaultString) Create a newAxiomSoapMessage
based on the given AXIOMSOAPMessage
.- Parameters:
soapMessage
- the AXIOM SOAPMessagesoapAction
- the value of the SOAP Action headerpayloadCaching
- whether the contents of the SOAP body should be cached or not
-
AxiomSoapMessage
public AxiomSoapMessage(org.apache.axiom.soap.SOAPMessage soapMessage, org.apache.axiom.attachments.Attachments attachments, String soapAction, boolean payloadCaching, boolean langAttributeOnSoap11FaultString) Create a newAxiomSoapMessage
based on the given AXIOMSOAPMessage
and attachments.- Parameters:
soapMessage
- the AXIOM SOAPMessageattachments
- the attachmentssoapAction
- the value of the SOAP Action headerpayloadCaching
- whether the contents of the SOAP body should be cached or not
-
-
Method Details
-
getAxiomMessage
public final org.apache.axiom.soap.SOAPMessage getAxiomMessage()Return the AXIOMSOAPMessage
that thisAxiomSoapMessage
is based on. -
setAxiomMessage
public final void setAxiomMessage(org.apache.axiom.soap.SOAPMessage axiomMessage) Sets the AXIOMSOAPMessage
that thisAxiomSoapMessage
is based on.Calling this method also clears the SOAP Action property.
-
setOutputFormat
public void setOutputFormat(org.apache.axiom.om.OMOutputFormat outputFormat) Sets theOMOutputFormat
to be used when writing the message.- See Also:
-
setStreamingPayload
Description copied from interface:StreamingWebServiceMessage
Sets the streaming payload for this message.- Specified by:
setStreamingPayload
in interfaceStreamingWebServiceMessage
- Parameters:
payload
- the streaming payload
-
getEnvelope
Description copied from interface:SoapMessage
Returns theSoapEnvelope
associated with this message.- Specified by:
getEnvelope
in interfaceSoapMessage
-
getSoapAction
Description copied from interface:SoapMessage
Get the SOAP Action for this message, ornull
if not present.- Specified by:
getSoapAction
in interfaceSoapMessage
- Returns:
- the SOAP Action.
-
setSoapAction
Description copied from interface:SoapMessage
Sets the SOAP Action for this message.- Specified by:
setSoapAction
in interfaceSoapMessage
- Parameters:
soapAction
- the SOAP Action.
-
getDocument
Description copied from interface:SoapMessage
Returns this message as aDocument
. Depending on the underlying implementation, this Document may be 'live' or not.- Specified by:
getDocument
in interfaceSoapMessage
- Returns:
- this soap message as a DOM document
-
setDocument
Description copied from interface:SoapMessage
Sets the contents of the message to the givenDocument
.- Specified by:
setDocument
in interfaceSoapMessage
- 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 interfaceMimeMessage
- Returns:
true
when the constraints specified in Identifying XOP Documents are met.- See Also:
-
convertToXopPackage
public boolean convertToXopPackage()Description copied from interface:MimeMessage
Turns this message into a XOP package.- Specified by:
convertToXopPackage
in interfaceMimeMessage
- Returns:
true
when the message is a XOP package- See Also:
-
getAttachment
Description copied from interface:MimeMessage
Returns theAttachment
with the specified content Id.- Specified by:
getAttachment
in interfaceMimeMessage
- Returns:
- the attachment with the specified content id; or
null
if it cannot be found
-
getAttachments
Description copied from interface:MimeMessage
Returns anIterator
over allAttachment
objects that are part of this message.- Specified by:
getAttachments
in interfaceMimeMessage
- Returns:
- an iterator over all attachments
- See Also:
-
addAttachment
Description copied from interface:MimeMessage
Add an attachment to the message, taking the content from aDataHandler
.- Specified by:
addAttachment
in interfaceMimeMessage
dataHandler
- the data handler to take the content from- Returns:
- the added attachment
-
writeTo
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 interfaceWebServiceMessage
- Parameters:
outputStream
- the stream to write to- Throws:
IOException
- if an I/O exception occurs
-
writeTo
protected void writeTo(OutputStream outputStream, org.apache.axiom.om.OMOutputFormat outputFormat) throws IOException, XMLStreamException Writes the entire message to the given output stream using the givenOMOutputFormat
.- Parameters:
outputStream
- the stream to write tooutputFormat
- theOMOutputFormat
- Throws:
IOException
XMLStreamException
- Since:
- 4.1.0
-
determineContentType
protected String determineContentType(org.apache.axiom.om.OMOutputFormat outputFormat, SoapVersion soapVersion) Determine the "Content-Type" header to use.- Parameters:
outputFormat
- theOMOutputFormat
soapVersion
- theSoapVersion
- Returns:
- the content-type to use
- Since:
- 4.1.0
-
toString
-