java.lang.Object
com.sun.xml.ws.api.message.Message
com.sun.xml.ws.message.AbstractMessageImpl
- Direct Known Subclasses:
DOMMessage
,EmptyMessageImpl
,JAXBDispatchMessage
,JAXBMessage
,PayloadStreamReaderMessage
,StreamMessage
,XMLMessage.UnknownContent
,XMLMessage.XMLMultiPart
Partial
Message
implementation.
This class implements some of the Message
methods.
The idea is that those implementations may be non-optimal but
it may save effort in implementing Message
and reduce
the code size.
Message
classes that are used more commonly should
examine carefully which method can be implemented faster,
and override them accordingly.
- Author:
- Kohsuke Kawaguchi
-
Field Summary
Modifier and TypeFieldDescriptionprotected TagInfoset
protected static final List<TagInfoset>
protected static final AttributesImpl
protected TagInfoset
protected TagInfoset
protected static final LocatorImpl
protected final SOAPVersion
SOAP version of this message.Fields inherited from class com.sun.xml.ws.api.message.Message
attachmentSet
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractMessageImpl
(SOAPVersion soapVersion) protected
Copy constructor. -
Method Summary
Modifier and TypeMethodDescriptionjakarta.xml.soap.SOAPMessage
Default implementation that useswriteTo(ContentHandler, ErrorHandler)
jakarta.xml.soap.SOAPMessage
readAsSOAPMessage
(Packet packet, boolean inbound) Creates the equivalentSOAPMessage
from this message.Consumes this message including the envelope.<T> T
readPayloadAsJAXB
(XMLBridge<T> bridge) Reads the payload as a Data-Bond object This consumes the message.<T> T
readPayloadAsJAXB
(jakarta.xml.bind.Unmarshaller unmarshaller) Reads the payload as a JAXB object by using the given unmarshaller.protected abstract void
writePayloadTo
(ContentHandler contentHandler, ErrorHandler errorHandler, boolean fragment) Writes the payload to SAX events.void
Default implementation that relies onMessage.writePayloadTo(XMLStreamWriter)
void
writeTo
(ContentHandler contentHandler, ErrorHandler errorHandler) Writes the whole envelope as SAX events.void
Methods inherited from class com.sun.xml.ws.api.message.Message
addSOAPMimeHeaders, assertOneWay, consume, copy, copyFrom, generateMessageID, getAttachments, getFirstDetailEntryName, getHeaders, getID, getID, getMethod, getOperation, getOperation, getPayloadLocalPart, getPayloadNamespaceURI, getTransportHeaders, getTransportHeaders, hasAttachments, hasHeaders, hasPayload, isFault, isOneWay, readPayload, readPayloadAsSource, setMessageMedadata, writePayloadTo
-
Field Details
-
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.
-
envelopeTag
-
headerTag
-
bodyTag
-
EMPTY_ATTS
-
NULL_LOCATOR
-
DEFAULT_TAGS
-
-
Constructor Details
-
AbstractMessageImpl
-
AbstractMessageImpl
Copy constructor.
-
-
Method Details
-
getSOAPVersion
- Overrides:
getSOAPVersion
in classMessage
-
readEnvelopeAsSource
Description copied from class:Message
Consumes this message including the envelope. returns it as aSource
object.- Specified by:
readEnvelopeAsSource
in classMessage
-
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 classMessage
- Throws:
jakarta.xml.bind.JAXBException
- If JAXB reports an error during the processing.
-
readPayloadAsJAXB
Description copied from class:Message
Reads the payload as a Data-Bond object This consumes the message.- Specified by:
readPayloadAsJAXB
in classMessage
- Returns:
- null if there's no payload.
- Throws:
jakarta.xml.bind.JAXBException
- If JAXB reports an error during the processing.
-
writeToBodyStart
- Throws:
XMLStreamException
-
writeTo
Default implementation that relies onMessage.writePayloadTo(XMLStreamWriter)
- Specified by:
writeTo
in classMessage
- Throws:
XMLStreamException
- If theXMLStreamWriter
reports an error, or some other errors happen during the processing.
-
writeTo
Writes the whole envelope as SAX events.- Specified by:
writeTo
in classMessage
- 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 asSAXParseException
.SAXException
s thrown fromErrorHandler
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
- Throws:
jakarta.xml.soap.SOAPException
-
readAsSOAPMessage
public jakarta.xml.soap.SOAPMessage readAsSOAPMessage() throws jakarta.xml.soap.SOAPExceptionDefault implementation that useswriteTo(ContentHandler, ErrorHandler)
- Specified by:
readAsSOAPMessage
in classMessage
- Throws:
jakarta.xml.soap.SOAPException
- if there's any error while creating aSOAPMessage
.
-
readAsSOAPMessage
public jakarta.xml.soap.SOAPMessage readAsSOAPMessage(Packet packet, boolean inbound) throws jakarta.xml.soap.SOAPException Description copied from class:Message
Creates the equivalentSOAPMessage
from this message. It also uses transport specific headers from Packet during the SOAPMessage construction so thatSOAPMessage.getMimeHeaders()
gives meaningful transport headers. This consumes the message.- Overrides:
readAsSOAPMessage
in classMessage
- Throws:
jakarta.xml.soap.SOAPException
- if there's any error while creating aSOAPMessage
.
-