Class 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
See Also:
  • SOAPMessage
  • Constructor Details

    • AxiomSoapMessage

      public AxiomSoapMessage(org.apache.axiom.soap.SOAPFactory soapFactory)
      Create a new, empty AxiomSoapMessage.
      Parameters:
      soapFactory - the AXIOM SOAPFactory
    • AxiomSoapMessage

      public AxiomSoapMessage(org.apache.axiom.soap.SOAPFactory soapFactory, boolean payloadCaching, boolean langAttributeOnSoap11FaultString)
      Create a new, empty AxiomSoapMessage.
      Parameters:
      soapFactory - the AXIOM SOAPFactory
    • AxiomSoapMessage

      public AxiomSoapMessage(org.apache.axiom.soap.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(org.apache.axiom.soap.SOAPMessage soapMessage, org.apache.axiom.attachments.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 Details

    • getAxiomMessage

      public final org.apache.axiom.soap.SOAPMessage getAxiomMessage()
      Return the AXIOM SOAPMessage that this AxiomSoapMessage is based on.
    • setAxiomMessage

      public final void setAxiomMessage(org.apache.axiom.soap.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(org.apache.axiom.om.OMOutputFormat outputFormat)
      Sets the OMOutputFormat to be used when writing the message.
      See Also:
    • 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 message.
      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:
    • 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:
    • 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:
    • addAttachment

      public Attachment addAttachment(String contentId, jakarta.activation.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
    • 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 given OMOutputFormat.
      Parameters:
      outputStream - the stream to write to
      outputFormat - the OMOutputFormat
      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 - the OMOutputFormat
      soapVersion - the SoapVersion
      Returns:
      the content-type to use
      Since:
      4.1.0
    • toString

      public String toString()
      Overrides:
      toString in class Object