Package com.sun.xml.messaging.saaj.soap
Class MessageImpl
java.lang.Object
jakarta.xml.soap.SOAPMessage
com.sun.xml.messaging.saaj.soap.MessageImpl
- All Implemented Interfaces:
SOAPConstants
- Direct Known Subclasses:
Message1_1Impl,Message1_2Impl
The message implementation for SOAP messages with
attachments. Messages for specific profiles will likely extend this
MessageImpl class and add more value for that particular profile.
- Author:
- Anil Vijendran (akv@eng.sun.com), Rajiv Mordani (rajiv.mordani@sun.com), Manveen Kaur (manveen.kaur@sun.com)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanTrue if the Accept header of this message includes application/fastinfosetprotected FinalArrayList<AttachmentPart>protected booleanstatic final Stringstatic final Stringprotected ContentTypeprotected static final intprotected MimeHeadersprotected booleanTrue if this part is encoded using Fast Infoset.static final Stringprotected intprotected byte[]protected static final intprotected static final intprotected static final intprotected MimeMultipartprotected MimeMultipartprotected static final intstatic final Stringprotected booleanprotected static final intprotected static final intprotected SOAPPartImplprotected static final intFields inherited from class jakarta.xml.soap.SOAPMessage
CHARACTER_SET_ENCODING, WRITE_XML_DECLARATIONFields inherited from interface jakarta.xml.soap.SOAPConstants
DEFAULT_SOAP_PROTOCOL, DYNAMIC_SOAP_PROTOCOL, SOAP_1_1_CONTENT_TYPE, SOAP_1_1_PROTOCOL, SOAP_1_2_CONTENT_TYPE, SOAP_1_2_PROTOCOL, SOAP_DATAENCODINGUNKNOWN_FAULT, SOAP_ENV_PREFIX, SOAP_MUSTUNDERSTAND_FAULT, SOAP_RECEIVER_FAULT, SOAP_SENDER_FAULT, SOAP_VERSIONMISMATCH_FAULT, URI_NS_SOAP_1_1_ENVELOPE, URI_NS_SOAP_1_2_ENCODING, URI_NS_SOAP_1_2_ENVELOPE, URI_NS_SOAP_ENCODING, URI_NS_SOAP_ENVELOPE, URI_SOAP_1_2_ROLE_NEXT, URI_SOAP_1_2_ROLE_NONE, URI_SOAP_1_2_ROLE_ULTIMATE_RECEIVER, URI_SOAP_ACTOR_NEXT -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstruct a new message.protectedMessageImpl(boolean isFastInfoset, boolean acceptFastInfoset) Construct a new message.protectedMessageImpl(MimeHeaders headers, ContentType contentType, int stat, InputStream in) Construct a message from an input stream.protectedMessageImpl(MimeHeaders headers, ContentType ct, int stat, XMLStreamReader reader) protectedMessageImpl(MimeHeaders headers, InputStream in) Construct a message from an input stream.protectedMessageImpl(SOAPMessage msg) Shallow copy. -
Method Summary
Modifier and TypeMethodDescriptionbooleanvoidaddAttachmentPart(AttachmentPart attachment) intgetAttachment(SOAPElement element) getAttachments(MimeHeaders headers) protected abstract Stringprotected abstract StringgetProperty(String property) abstract SOAPPartprotected abstract booleanisCorrectSoapVersion(int contentTypeId) booleanbooleanprotected static booleanisSoap1_1Content(int stat) protected static booleanisSoap1_2Content(int stat) Check whether it is SOAP 1.2 content.voidvoidremoveAttachments(MimeHeaders headers) voidbooleanvoidvoidsetBaseType(String type) voidsetCharset(String charset) voidsetContentDescription(String description) voidsetContentType(String type) voidsetIsFastInfoset(boolean value) voidsetLazyAttachments(boolean flag) voidsetProperty(String property, Object value) voidwriteTo(OutputStream out) Methods inherited from class jakarta.xml.soap.SOAPMessage
createAttachmentPart, createAttachmentPart
-
Field Details
-
CONTENT_ID
- See Also:
-
CONTENT_LOCATION
- See Also:
-
PLAIN_XML_FLAG
protected static final int PLAIN_XML_FLAG- See Also:
-
MIME_MULTIPART_FLAG
protected static final int MIME_MULTIPART_FLAG- See Also:
-
SOAP1_1_FLAG
protected static final int SOAP1_1_FLAG- See Also:
-
SOAP1_2_FLAG
protected static final int SOAP1_2_FLAG- See Also:
-
MIME_MULTIPART_XOP_SOAP1_1_FLAG
protected static final int MIME_MULTIPART_XOP_SOAP1_1_FLAG- See Also:
-
MIME_MULTIPART_XOP_SOAP1_2_FLAG
protected static final int MIME_MULTIPART_XOP_SOAP1_2_FLAG- See Also:
-
XOP_FLAG
protected static final int XOP_FLAG- See Also:
-
FI_ENCODED_FLAG
protected static final int FI_ENCODED_FLAG- See Also:
-
headers
-
contentType
-
soapPartImpl
-
attachments
-
saved
protected boolean saved -
messageBytes
protected byte[] messageBytes -
messageByteCount
protected int messageByteCount -
properties
-
multiPart
-
attachmentsInitialized
protected boolean attachmentsInitialized -
isFastInfoset
protected boolean isFastInfosetTrue if this part is encoded using Fast Infoset. MIME -> application/fastinfoset -
acceptFastInfoset
protected boolean acceptFastInfosetTrue if the Accept header of this message includes application/fastinfoset -
mmp
-
LAZY_SOAP_BODY_PARSING
- See Also:
-
SAAJ_MIME_SOAP_BODY_PART_SIZE_LIMIT
- See Also:
-
-
Constructor Details
-
MessageImpl
protected MessageImpl()Construct a new message. This will be invoked before message sends. -
MessageImpl
protected MessageImpl(boolean isFastInfoset, boolean acceptFastInfoset) Construct a new message. This will be invoked before message sends.- Parameters:
isFastInfoset- whether it is fast infosetacceptFastInfoset- whether to accept fast infoset
-
MessageImpl
Shallow copy.- Parameters:
msg- SoapMessage
-
MessageImpl
Construct a message from an input stream. When messages are received, there's two parts -- the transport headers and the message content in a transport specific stream.- Parameters:
headers- MimeHeadersin- InputStream- Throws:
SOAPExceptionImpl- in case of I/O error
-
MessageImpl
protected MessageImpl(MimeHeaders headers, ContentType contentType, int stat, InputStream in) throws SOAPExceptionImpl Construct a message from an input stream. When messages are received, there's two parts -- the transport headers and the message content in a transport specific stream.- Parameters:
headers- headerscontentType- The parsed content type header from the headers variable. This is redundant parameter, but it avoids reparsing this header again.stat- The result ofidentifyContentType(ContentType)over the contentType parameter. This redundant parameter, but it avoids recomputing this information again.in- input stream- Throws:
SOAPExceptionImpl- in case of an error
-
MessageImpl
protected MessageImpl(MimeHeaders headers, ContentType ct, int stat, XMLStreamReader reader) throws SOAPExceptionImpl - Throws:
SOAPExceptionImpl
-
-
Method Details
-
isSoap1_1Content
protected static boolean isSoap1_1Content(int stat) - Parameters:
stat- the mask value obtained fromidentifyContentType(ContentType)- Returns:
- true if SOAP 1.1 Content
-
isSoap1_2Content
protected static boolean isSoap1_2Content(int stat) Check whether it is SOAP 1.2 content.- Parameters:
stat- the mask value obtained fromidentifyContentType(ContentType)- Returns:
- true if it is SOAP 1.2 content
-
isFastInfoset
public boolean isFastInfoset() -
acceptFastInfoset
public boolean acceptFastInfoset() -
setIsFastInfoset
public void setIsFastInfoset(boolean value) -
isLazySoapBodyParsing
public boolean isLazySoapBodyParsing() -
getProperty
- Overrides:
getPropertyin classSOAPMessage
-
setProperty
- Overrides:
setPropertyin classSOAPMessage
-
isCorrectSoapVersion
protected abstract boolean isCorrectSoapVersion(int contentTypeId) -
getExpectedContentType
-
getExpectedAcceptHeader
-
getMimeHeaders
- Specified by:
getMimeHeadersin classSOAPMessage
-
getContentType
-
setContentType
-
getBaseType
-
setBaseType
-
getAction
-
setAction
-
getCharset
-
setCharset
-
saveRequired
public boolean saveRequired()- Specified by:
saveRequiredin classSOAPMessage
-
getContentDescription
- Specified by:
getContentDescriptionin classSOAPMessage
-
setContentDescription
- Specified by:
setContentDescriptionin classSOAPMessage
-
getSOAPPart
- Specified by:
getSOAPPartin classSOAPMessage
-
removeAllAttachments
public void removeAllAttachments()- Specified by:
removeAllAttachmentsin classSOAPMessage
-
countAttachments
public int countAttachments()- Specified by:
countAttachmentsin classSOAPMessage
-
addAttachmentPart
- Specified by:
addAttachmentPartin classSOAPMessage
-
getAttachments
- Specified by:
getAttachmentsin classSOAPMessage
-
getAttachments
- Specified by:
getAttachmentsin classSOAPMessage
-
removeAttachments
- Specified by:
removeAttachmentsin classSOAPMessage
-
createAttachmentPart
- Specified by:
createAttachmentPartin classSOAPMessage
-
getAttachment
- Specified by:
getAttachmentin classSOAPMessage- Throws:
SOAPException
-
saveChanges
- Specified by:
saveChangesin classSOAPMessage- Throws:
SOAPException
-
writeTo
- Specified by:
writeToin classSOAPMessage- Throws:
SOAPExceptionIOException
-
getSOAPBody
- Overrides:
getSOAPBodyin classSOAPMessage- Throws:
SOAPException
-
getSOAPHeader
- Overrides:
getSOAPHeaderin classSOAPMessage- Throws:
SOAPException
-
setLazyAttachments
public void setLazyAttachments(boolean flag)
-