public class AxiomSoapMessage extends AbstractSoapMessage implements StreamingWebServiceMessage
SoapMessage
interface. Created via the AxiomSoapMessageFactory
,
wraps a SOAPMessage
.SOAPMessage
Constructor and Description |
---|
AxiomSoapMessage(org.apache.axiom.soap.SOAPFactory soapFactory)
Create a new, empty
AxiomSoapMessage . |
AxiomSoapMessage(org.apache.axiom.soap.SOAPFactory soapFactory,
boolean payloadCaching,
boolean langAttributeOnSoap11FaultString)
Create a new, empty
AxiomSoapMessage . |
AxiomSoapMessage(org.apache.axiom.soap.SOAPMessage soapMessage,
org.apache.axiom.attachments.Attachments attachments,
String soapAction,
boolean payloadCaching,
boolean langAttributeOnSoap11FaultString)
Create a new
AxiomSoapMessage based on the given AXIOM SOAPMessage and attachments. |
AxiomSoapMessage(org.apache.axiom.soap.SOAPMessage soapMessage,
String soapAction,
boolean payloadCaching,
boolean langAttributeOnSoap11FaultString)
Create a new
AxiomSoapMessage based on the given AXIOM 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. |
org.apache.axiom.soap.SOAPMessage |
getAxiomMessage()
Return the AXIOM
SOAPMessage that this AxiomSoapMessage is based on. |
Document |
getDocument()
Returns this message as a
Document . |
SoapEnvelope |
getEnvelope()
Returns the
SoapEnvelope associated with this SoapMessage . |
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 |
setAxiomMessage(org.apache.axiom.soap.SOAPMessage axiomMessage)
Sets the AXIOM
SOAPMessage that this AxiomSoapMessage is based on. |
void |
setDocument(Document document)
Sets the contents of the message to the given
Document . |
void |
setOutputFormat(org.apache.axiom.om.OMOutputFormat outputFormat)
Sets the
OMOutputFormat to be used when writing the message. |
void |
setSoapAction(String soapAction)
Sets the SOAP Action for this message.
|
void |
setStreamingPayload(StreamingPayload payload)
Sets the streaming payload 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
getPayloadResult, getPayloadSource
addAttachment, addAttachment
public AxiomSoapMessage(org.apache.axiom.soap.SOAPFactory soapFactory)
AxiomSoapMessage
.soapFactory
- the AXIOM SOAPFactorypublic AxiomSoapMessage(org.apache.axiom.soap.SOAPFactory soapFactory, boolean payloadCaching, boolean langAttributeOnSoap11FaultString)
AxiomSoapMessage
.soapFactory
- the AXIOM SOAPFactorypublic AxiomSoapMessage(org.apache.axiom.soap.SOAPMessage soapMessage, String soapAction, boolean payloadCaching, boolean langAttributeOnSoap11FaultString)
AxiomSoapMessage
based on the given AXIOM SOAPMessage
.soapMessage
- the AXIOM SOAPMessagesoapAction
- the value of the SOAP Action headerpayloadCaching
- whether the contents of the SOAP body should be cached or notpublic AxiomSoapMessage(org.apache.axiom.soap.SOAPMessage soapMessage, org.apache.axiom.attachments.Attachments attachments, String soapAction, boolean payloadCaching, boolean langAttributeOnSoap11FaultString)
AxiomSoapMessage
based on the given AXIOM SOAPMessage
and attachments.soapMessage
- the AXIOM SOAPMessageattachments
- the attachmentssoapAction
- the value of the SOAP Action headerpayloadCaching
- whether the contents of the SOAP body should be cached or notpublic final org.apache.axiom.soap.SOAPMessage getAxiomMessage()
SOAPMessage
that this AxiomSoapMessage
is based on.public final void setAxiomMessage(org.apache.axiom.soap.SOAPMessage axiomMessage)
SOAPMessage
that this AxiomSoapMessage
is based on.
Calling this method also clears the SOAP Action property.
public void setOutputFormat(org.apache.axiom.om.OMOutputFormat outputFormat)
OMOutputFormat
to be used when writing the message.writeTo(java.io.OutputStream)
public void setStreamingPayload(StreamingPayload payload)
StreamingWebServiceMessage
setStreamingPayload
in interface StreamingWebServiceMessage
payload
- the streaming payloadpublic SoapEnvelope getEnvelope()
SoapMessage
SoapEnvelope
associated with this SoapMessage
.getEnvelope
in interface SoapMessage
public String getSoapAction()
SoapMessage
null
if not present.getSoapAction
in interface SoapMessage
public void setSoapAction(String soapAction)
SoapMessage
setSoapAction
in interface SoapMessage
soapAction
- the SOAP Action.public Document getDocument()
SoapMessage
Document
.
Depending on the underlying implementation, this Document may be 'live' or not.getDocument
in interface SoapMessage
public void setDocument(Document document)
SoapMessage
Document
.setDocument
in interface SoapMessage
document
- the soap message as a DOM documentpublic boolean isXopPackage()
MimeMessage
isXopPackage
in interface MimeMessage
true
when the constraints specified in Identifying
XOP Documents are met.public boolean convertToXopPackage()
MimeMessage
convertToXopPackage
in interface MimeMessage
true
when the message is a XOP packagepublic Attachment getAttachment(String contentId)
MimeMessage
Attachment
with the specified content Id.getAttachment
in interface MimeMessage
null
if it cannot be foundpublic Iterator<Attachment> getAttachments()
MimeMessage
Iterator
over all Attachment
objects that are part of this message.getAttachments
in interface MimeMessage
Attachment
public Attachment addAttachment(String contentId, DataHandler dataHandler)
MimeMessage
DataHandler
.addAttachment
in interface MimeMessage
dataHandler
- the data handler to take the content frompublic void writeTo(OutputStream outputStream) throws IOException
WebServiceMessage
If the given stream is an instance of TransportOutputStream
, the corresponding headers will be written as well.
writeTo
in interface WebServiceMessage
outputStream
- the stream to write toIOException
- if an I/O exception occursCopyright © 2020 Pivotal Software. All rights reserved.