Class MessageFactoryImpl

java.lang.Object
jakarta.xml.soap.MessageFactory
com.sun.xml.messaging.saaj.soap.MessageFactoryImpl
Direct Known Subclasses:
SOAPMessageFactory1_1Impl, SOAPMessageFactory1_2Impl, SOAPMessageFactoryDynamicImpl

public class MessageFactoryImpl extends MessageFactory
A factory for creating SOAP messages. Converted to a placeholder for common functionality between SOAP implementations.
  • Field Details

    • listener

      protected OutputStream listener
    • lazyAttachments

      protected boolean lazyAttachments
  • Constructor Details

    • MessageFactoryImpl

      public MessageFactoryImpl()
  • Method Details

    • listen

      public OutputStream listen(OutputStream newListener)
    • createMessage

      public SOAPMessage createMessage() throws SOAPException
      Description copied from class: MessageFactory
      Creates a new SOAPMessage object with the default SOAPPart, SOAPEnvelope, SOAPBody, and SOAPHeader objects. Profile-specific message factories can choose to prepopulate the SOAPMessage object with profile-specific headers.

      Content can be added to this message's SOAPPart object, and the message can be sent "as is" when a message containing only a SOAP part is sufficient. Otherwise, the SOAPMessage object needs to create one or more AttachmentPart objects and add them to itself. Any content that is not in XML format must be in an AttachmentPart object.

      Specified by:
      createMessage in class MessageFactory
      Returns:
      a new SOAPMessage object
      Throws:
      SOAPException - if a SOAP error occurs
    • createMessage

      public SOAPMessage createMessage(String protocol) throws SOAPException
      Throws:
      SOAPException
    • createMessage

      public SOAPMessage createMessage(boolean isFastInfoset, boolean acceptFastInfoset) throws SOAPException
      Throws:
      SOAPException
    • createMessage

      public SOAPMessage createMessage(MimeHeaders headers, XMLStreamReader reader) throws SOAPException, IOException
      Throws:
      SOAPException
      IOException
    • createMessage

      public SOAPMessage createMessage(MimeHeaders headers, InputStream in) throws SOAPException, IOException
      Description copied from class: MessageFactory
      Internalizes the contents of the given InputStream object into a new SOAPMessage object and returns the SOAPMessage object.
      Specified by:
      createMessage in class MessageFactory
      Parameters:
      headers - the transport-specific headers passed to the message in a transport-independent fashion for creation of the message
      in - the InputStream object that contains the data for a message
      Returns:
      a new SOAPMessage object containing the data from the given InputStream object
      Throws:
      SOAPException - may be thrown if the message is invalid
      IOException - if there is a problem in reading data from the input stream
    • getContentType

      protected static final String getContentType(MimeHeaders headers)
    • setLazyAttachmentOptimization

      public void setLazyAttachmentOptimization(boolean flag)