public class SaajSoapMessage extends AbstractSoapMessage
SoapMessage
interface. Created via the SaajSoapMessageFactory
,
wraps a SOAPMessage
.SOAPMessage
Constructor and Description |
---|
SaajSoapMessage(SOAPMessage soapMessage)
Create a new
SaajSoapMessage based on the given SAAJ SOAPMessage . |
SaajSoapMessage(SOAPMessage soapMessage,
boolean langAttributeOnSoap11FaultString)
Create a new
SaajSoapMessage based on the given SAAJ SOAPMessage . |
SaajSoapMessage(SOAPMessage soapMessage,
boolean langAttributeOnSoap11FaultString,
MessageFactory messageFactory)
Create a new
SaajSoapMessage based on the given SAAJ SOAPMessage . |
SaajSoapMessage(SOAPMessage soapMessage,
MessageFactory messageFactory)
Create a new
SaajSoapMessage based on the given SAAJ SOAPMessage . |
Modifier and Type | Method and Description |
---|---|
Attachment |
addAttachment(String contentId,
DataHandler dataHandler)
Add an attachment to the message, taking the content from a
DataHandler . |
boolean |
convertToXopPackage()
Turns this message into a XOP package.
|
Attachment |
getAttachment(String contentId)
Returns the
Attachment with the specified content Id. |
Iterator<Attachment> |
getAttachments()
Returns an
Iterator over all Attachment objects that are part of this message. |
Document |
getDocument()
Returns this message as a
Document . |
SoapEnvelope |
getEnvelope()
Returns the
SoapEnvelope associated with this SoapMessage . |
SOAPMessage |
getSaajMessage()
Return the SAAJ
SOAPMessage that this SaajSoapMessage is based on. |
String |
getSoapAction()
Get the SOAP Action for this message, or
null if not present. |
boolean |
isXopPackage()
Indicates whether this message is a XOP package.
|
void |
setDocument(Document document)
Sets the contents of the message to the given
Document . |
void |
setSaajMessage(SOAPMessage soapMessage)
Sets the SAAJ
SOAPMessage that this SaajSoapMessage is based on. |
void |
setSoapAction(String soapAction)
Sets the SOAP Action for this message.
|
String |
toString() |
void |
writeTo(OutputStream outputStream)
Writes the entire message to the given output stream.
|
getFaultCode, getFaultReason, getPayloadResult, getPayloadSource, getSoapBody, getSoapHeader, getVersion, hasFault
addAttachment, addAttachment
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addAttachment, addAttachment
public SaajSoapMessage(SOAPMessage soapMessage)
SaajSoapMessage
based on the given SAAJ SOAPMessage
.soapMessage
- the SAAJ SOAPMessagepublic SaajSoapMessage(SOAPMessage soapMessage, MessageFactory messageFactory)
SaajSoapMessage
based on the given SAAJ SOAPMessage
.soapMessage
- the SAAJ SOAPMessagemessageFactory
- the SAAJ message factorypublic SaajSoapMessage(SOAPMessage soapMessage, boolean langAttributeOnSoap11FaultString)
SaajSoapMessage
based on the given SAAJ SOAPMessage
.soapMessage
- the SAAJ SOAPMessagelangAttributeOnSoap11FaultString
- whether a xml:lang
attribute is allowed on SOAP 1.1 <faultstring>
elementspublic SaajSoapMessage(SOAPMessage soapMessage, boolean langAttributeOnSoap11FaultString, MessageFactory messageFactory)
SaajSoapMessage
based on the given SAAJ SOAPMessage
.soapMessage
- the SAAJ SOAPMessagelangAttributeOnSoap11FaultString
- whether a xml:lang
attribute is allowed on SOAP 1.1 <faultstring>
elementsmessageFactory
- the message factorypublic SOAPMessage getSaajMessage()
SOAPMessage
that this SaajSoapMessage
is based on.public void setSaajMessage(SOAPMessage soapMessage)
SOAPMessage
that this SaajSoapMessage
is based on.public SoapEnvelope getEnvelope()
SoapMessage
SoapEnvelope
associated with this SoapMessage
.public String getSoapAction()
SoapMessage
null
if not present.public void setSoapAction(String soapAction)
SoapMessage
soapAction
- the SOAP Action.public Document getDocument()
SoapMessage
Document
.
Depending on the underlying implementation, this Document may be 'live' or not.public void setDocument(Document document)
SoapMessage
Document
.document
- the soap message as a DOM documentpublic void writeTo(OutputStream outputStream) throws IOException
WebServiceMessage
If the given stream is an instance of TransportOutputStream
, the corresponding headers will be written as well.
outputStream
- the stream to write toIOException
- if an I/O exception occurspublic boolean isXopPackage()
MimeMessage
true
when the constraints specified in Identifying
XOP Documents are met.public boolean convertToXopPackage()
MimeMessage
true
when the message is a XOP packagepublic Iterator<Attachment> getAttachments() throws AttachmentException
MimeMessage
Iterator
over all Attachment
objects that are part of this message.AttachmentException
- in case of errorsAttachment
public Attachment getAttachment(String contentId)
MimeMessage
Attachment
with the specified content Id.null
if it cannot be foundpublic Attachment addAttachment(String contentId, DataHandler dataHandler)
MimeMessage
DataHandler
.dataHandler
- the data handler to take the content fromCopyright © 2020 Pivotal Software. All rights reserved.