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 newAxiomSoapMessagebased 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 newAxiomSoapMessagebased on the given AXIOMSOAPMessageand attachments. -
Method Summary
Modifier and TypeMethodDescriptionaddAttachment(String contentId, jakarta.activation.DataHandler dataHandler) Add an attachment to the message, taking the content from aDataHandler.booleanTurns this message into a XOP package.protected StringdetermineContentType(org.apache.axiom.om.OMOutputFormat outputFormat, SoapVersion soapVersion) Determine the "Content-Type" header to use.getAttachment(String contentId) Returns theAttachmentwith the specified content Id.Returns anIteratorover allAttachmentobjects that are part of this message.final org.apache.axiom.soap.SOAPMessageReturn the AXIOMSOAPMessagethat thisAxiomSoapMessageis based on.Returns this message as aDocument.Returns theSoapEnvelopeassociated with this message.Get the SOAP Action for this message, ornullif not present.booleanIndicates whether this message is a XOP package.final voidsetAxiomMessage(org.apache.axiom.soap.SOAPMessage axiomMessage) Sets the AXIOMSOAPMessagethat thisAxiomSoapMessageis based on.voidsetDocument(Document document) Sets the contents of the message to the givenDocument.voidsetOutputFormat(org.apache.axiom.om.OMOutputFormat outputFormat) Sets theOMOutputFormatto be used when writing the message.voidsetSoapAction(String soapAction) Sets the SOAP Action for this message.voidsetStreamingPayload(StreamingPayload payload) Sets the streaming payload for this message.toString()voidwriteTo(OutputStream outputStream) Writes the entire message to the given output stream.protected voidwriteTo(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, hasFaultMethods inherited from class org.springframework.ws.mime.AbstractMimeMessage
addAttachment, addAttachmentMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.ws.mime.MimeMessage
addAttachment, addAttachmentMethods 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 newAxiomSoapMessagebased 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 newAxiomSoapMessagebased on the given AXIOMSOAPMessageand 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 AXIOMSOAPMessagethat thisAxiomSoapMessageis based on. -
setAxiomMessage
public final void setAxiomMessage(org.apache.axiom.soap.SOAPMessage axiomMessage) Sets the AXIOMSOAPMessagethat thisAxiomSoapMessageis based on.Calling this method also clears the SOAP Action property.
-
setOutputFormat
public void setOutputFormat(org.apache.axiom.om.OMOutputFormat outputFormat) Sets theOMOutputFormatto be used when writing the message.- See Also:
-
setStreamingPayload
Description copied from interface:StreamingWebServiceMessageSets the streaming payload for this message.- Specified by:
setStreamingPayloadin interfaceStreamingWebServiceMessage- Parameters:
payload- the streaming payload
-
getEnvelope
Description copied from interface:SoapMessageReturns theSoapEnvelopeassociated with this message.- Specified by:
getEnvelopein interfaceSoapMessage
-
getSoapAction
Description copied from interface:SoapMessageGet the SOAP Action for this message, ornullif not present.- Specified by:
getSoapActionin interfaceSoapMessage- Returns:
- the SOAP Action.
-
setSoapAction
Description copied from interface:SoapMessageSets the SOAP Action for this message.- Specified by:
setSoapActionin interfaceSoapMessage- Parameters:
soapAction- the SOAP Action.
-
getDocument
Description copied from interface:SoapMessageReturns this message as aDocument. Depending on the underlying implementation, this Document may be 'live' or not.- Specified by:
getDocumentin interfaceSoapMessage- Returns:
- this soap message as a DOM document
-
setDocument
Description copied from interface:SoapMessageSets the contents of the message to the givenDocument.- Specified by:
setDocumentin interfaceSoapMessage- Parameters:
document- the soap message as a DOM document
-
isXopPackage
public boolean isXopPackage()Description copied from interface:MimeMessageIndicates whether this message is a XOP package.- Specified by:
isXopPackagein interfaceMimeMessage- Returns:
truewhen the constraints specified in Identifying XOP Documents are met.- See Also:
-
convertToXopPackage
public boolean convertToXopPackage()Description copied from interface:MimeMessageTurns this message into a XOP package.- Specified by:
convertToXopPackagein interfaceMimeMessage- Returns:
truewhen the message is a XOP package- See Also:
-
getAttachment
Description copied from interface:MimeMessageReturns theAttachmentwith the specified content Id.- Specified by:
getAttachmentin interfaceMimeMessage- Returns:
- the attachment with the specified content id; or
nullif it cannot be found
-
getAttachments
Description copied from interface:MimeMessageReturns anIteratorover allAttachmentobjects that are part of this message.- Specified by:
getAttachmentsin interfaceMimeMessage- Returns:
- an iterator over all attachments
- See Also:
-
addAttachment
Description copied from interface:MimeMessageAdd an attachment to the message, taking the content from aDataHandler.- Specified by:
addAttachmentin interfaceMimeMessagedataHandler- the data handler to take the content from- Returns:
- the added attachment
-
writeTo
Description copied from interface:WebServiceMessageWrites 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:
writeToin 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:
IOExceptionXMLStreamException- 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- theOMOutputFormatsoapVersion- theSoapVersion- Returns:
- the content-type to use
- Since:
- 4.1.0
-
toString
-