Class AbstractMessageImpl

    • Field Detail

      • soapVersion

        protected final SOAPVersion soapVersion
        SOAP version of this message. Used to implement some of the methods, but nothing more than that.

        So if you aren't using those methods that use this field, this can be null.

      • NULL_LOCATOR

        protected static final LocatorImpl NULL_LOCATOR
    • Constructor Detail

      • AbstractMessageImpl

        protected AbstractMessageImpl​(SOAPVersion soapVersion)
      • AbstractMessageImpl

        protected AbstractMessageImpl​(AbstractMessageImpl that)
        Copy constructor.
    • Method Detail

      • readEnvelopeAsSource

        public Source readEnvelopeAsSource()
        Description copied from class: Message
        Consumes this message including the envelope. returns it as a Source object.
        Specified by:
        readEnvelopeAsSource in class Message
      • readPayloadAsJAXB

        public <T> T readPayloadAsJAXB​(jakarta.xml.bind.Unmarshaller unmarshaller)
                                throws jakarta.xml.bind.JAXBException
        Description copied from class: Message
        Reads the payload as a JAXB object by using the given unmarshaller. This consumes the message.
        Specified by:
        readPayloadAsJAXB in class Message
        Throws:
        jakarta.xml.bind.JAXBException - If JAXB reports an error during the processing.
      • readPayloadAsJAXB

        public <T> T readPayloadAsJAXB​(org.glassfish.jaxb.runtime.api.Bridge<T> bridge)
                                throws jakarta.xml.bind.JAXBException
        Deprecated.
        Description copied from class: Message
        Reads the payload as a JAXB object according to the given Bridge. This consumes the message.
        Specified by:
        readPayloadAsJAXB in class Message
        Returns:
        null if there's no payload.
        Throws:
        jakarta.xml.bind.JAXBException - If JAXB reports an error during the processing.
      • readPayloadAsJAXB

        public <T> T readPayloadAsJAXB​(XMLBridge<T> bridge)
                                throws jakarta.xml.bind.JAXBException
        Description copied from class: Message
        Reads the payload as a Data-Bond object This consumes the message.
        Specified by:
        readPayloadAsJAXB in class Message
        Returns:
        null if there's no payload.
        Throws:
        jakarta.xml.bind.JAXBException - If JAXB reports an error during the processing.
      • writeTo

        public void writeTo​(ContentHandler contentHandler,
                            ErrorHandler errorHandler)
                     throws SAXException
        Writes the whole envelope as SAX events.
        Specified by:
        writeTo in class Message
        Parameters:
        contentHandler - must not be nulll.
        errorHandler - must not be null. any error encountered during the SAX event production must be first reported to this error handler. Fatal errors can be then thrown as SAXParseException. SAXExceptions thrown from ErrorHandler should propagate directly through this method.
        Throws:
        SAXException
      • writePayloadTo

        protected abstract void writePayloadTo​(ContentHandler contentHandler,
                                               ErrorHandler errorHandler,
                                               boolean fragment)
                                        throws SAXException
        Writes the payload to SAX events.
        Parameters:
        fragment - if true, this method will fire SAX events without start/endDocument events, suitable for embedding this into a bigger SAX event sequence. if false, this method generaets a completely SAX event sequence on its own.
        Throws:
        SAXException
      • toSAAJ

        public Message toSAAJ​(Packet p,
                              Boolean inbound)
                       throws jakarta.xml.soap.SOAPException
        Throws:
        jakarta.xml.soap.SOAPException
      • readAsSOAPMessage

        public jakarta.xml.soap.SOAPMessage readAsSOAPMessage()
                                                       throws jakarta.xml.soap.SOAPException
        Default implementation that uses writeTo(ContentHandler, ErrorHandler)
        Specified by:
        readAsSOAPMessage in class Message
        Throws:
        jakarta.xml.soap.SOAPException - if there's any error while creating a SOAPMessage.
      • readAsSOAPMessage

        public jakarta.xml.soap.SOAPMessage readAsSOAPMessage​(Packet packet,
                                                              boolean inbound)
                                                       throws jakarta.xml.soap.SOAPException
        Description copied from class: Message
        Creates the equivalent SOAPMessage from this message. It also uses transport specific headers from Packet during the SOAPMessage construction so that SOAPMessage.getMimeHeaders() gives meaningful transport headers. This consumes the message.
        Overrides:
        readAsSOAPMessage in class Message
        Throws:
        jakarta.xml.soap.SOAPException - if there's any error while creating a SOAPMessage.