Package org.springframework.ws.soap.saaj
Class SaajSoapMessage
java.lang.Object
org.springframework.ws.mime.AbstractMimeMessage
org.springframework.ws.soap.AbstractSoapMessage
org.springframework.ws.soap.saaj.SaajSoapMessage
- All Implemented Interfaces:
FaultAwareWebServiceMessage,MimeMessage,SoapMessage,WebServiceMessage
SAAJ-specific implementation of the
SoapMessage interface. Created via the
SaajSoapMessageFactory, wraps a SOAPMessage.- Since:
- 1.0.0
- See Also:
-
SOAPMessage
-
Constructor Summary
ConstructorsConstructorDescriptionSaajSoapMessage(jakarta.xml.soap.SOAPMessage soapMessage) Create a newSaajSoapMessagebased on the given SAAJSOAPMessage.SaajSoapMessage(jakarta.xml.soap.SOAPMessage soapMessage, boolean langAttributeOnSoap11FaultString) Create a newSaajSoapMessagebased on the given SAAJSOAPMessage.SaajSoapMessage(jakarta.xml.soap.SOAPMessage soapMessage, boolean langAttributeOnSoap11FaultString, jakarta.xml.soap.MessageFactory messageFactory) Create a newSaajSoapMessagebased on the given SAAJSOAPMessage.SaajSoapMessage(jakarta.xml.soap.SOAPMessage soapMessage, jakarta.xml.soap.MessageFactory messageFactory) Create a newSaajSoapMessagebased on the given SAAJSOAPMessage. -
Method Summary
Modifier and TypeMethodDescriptionaddAttachment(String contentId, jakarta.activation.DataHandler dataHandler) Add an attachment to the message, taking the content from aDataHandler.booleanTurns this message into a XOP package.getAttachment(String contentId) Returns theAttachmentwith the specified content Id.Returns anIteratorover allAttachmentobjects that are part of this message.Returns this message as aDocument.Returns theSoapEnvelopeassociated with this message.jakarta.xml.soap.SOAPMessageReturn the SAAJSOAPMessagethat thisSaajSoapMessageis based on.Get the SOAP Action for this message, ornullif not present.booleanIndicates whether this message is a XOP package.voidsetDocument(Document document) Sets the contents of the message to the givenDocument.voidsetSaajMessage(jakarta.xml.soap.SOAPMessage soapMessage) Sets the SAAJSOAPMessagethat thisSaajSoapMessageis based on.voidsetSoapAction(String soapAction) Sets the SOAP Action for this message.toString()voidwriteTo(OutputStream outputStream) Writes the entire message to the given output stream.Methods inherited from class org.springframework.ws.soap.AbstractSoapMessage
getFaultCode, getFaultReason, getPayloadResult, getPayloadSource, getSoapBody, getSoapHeader, getVersion, hasFaultMethods inherited from class org.springframework.ws.mime.AbstractMimeMessage
addAttachment, addAttachmentMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.ws.mime.MimeMessage
addAttachment, addAttachment
-
Constructor Details
-
SaajSoapMessage
public SaajSoapMessage(jakarta.xml.soap.SOAPMessage soapMessage) Create a newSaajSoapMessagebased on the given SAAJSOAPMessage.- Parameters:
soapMessage- the SAAJ SOAPMessage
-
SaajSoapMessage
public SaajSoapMessage(jakarta.xml.soap.SOAPMessage soapMessage, jakarta.xml.soap.MessageFactory messageFactory) Create a newSaajSoapMessagebased on the given SAAJSOAPMessage.- Parameters:
soapMessage- the SAAJ SOAPMessagemessageFactory- the SAAJ message factory
-
SaajSoapMessage
public SaajSoapMessage(jakarta.xml.soap.SOAPMessage soapMessage, boolean langAttributeOnSoap11FaultString) Create a newSaajSoapMessagebased on the given SAAJSOAPMessage.- Parameters:
soapMessage- the SAAJ SOAPMessagelangAttributeOnSoap11FaultString- whether axml:langattribute is allowed on SOAP 1.1<faultstring>elements
-
SaajSoapMessage
public SaajSoapMessage(jakarta.xml.soap.SOAPMessage soapMessage, boolean langAttributeOnSoap11FaultString, jakarta.xml.soap.MessageFactory messageFactory) Create a newSaajSoapMessagebased on the given SAAJSOAPMessage.- Parameters:
soapMessage- the SAAJ SOAPMessagelangAttributeOnSoap11FaultString- whether axml:langattribute is allowed on SOAP 1.1<faultstring>elementsmessageFactory- the message factory
-
-
Method Details
-
getSaajMessage
public jakarta.xml.soap.SOAPMessage getSaajMessage()Return the SAAJSOAPMessagethat thisSaajSoapMessageis based on. -
setSaajMessage
public void setSaajMessage(jakarta.xml.soap.SOAPMessage soapMessage) Sets the SAAJSOAPMessagethat thisSaajSoapMessageis based on. -
getEnvelope
Description copied from interface:SoapMessageReturns theSoapEnvelopeassociated with this message. -
getSoapAction
Description copied from interface:SoapMessageGet the SOAP Action for this message, ornullif not present.- Returns:
- the SOAP Action.
-
setSoapAction
Description copied from interface:SoapMessageSets the SOAP Action for this message.- Parameters:
soapAction- the SOAP Action.
-
getDocument
Description copied from interface:SoapMessageReturns this message as aDocument. Depending on the underlying implementation, this Document may be 'live' or not.- Returns:
- this soap message as a DOM document
-
setDocument
Description copied from interface:SoapMessageSets the contents of the message to the givenDocument.- Parameters:
document- the soap message as a DOM document
-
writeTo
Description copied from interface:WebServiceMessageWrites the entire message to the given output stream.If the given stream is an instance of
TransportOutputStream, the corresponding headers will be written as well.- Parameters:
outputStream- the stream to write to- Throws:
IOException- if an I/O exception occurs
-
isXopPackage
public boolean isXopPackage()Description copied from interface:MimeMessageIndicates whether this message is a XOP package.- Returns:
truewhen the constraints specified in Identifying XOP Documents are met.- See Also:
-
convertToXopPackage
public boolean convertToXopPackage()Description copied from interface:MimeMessageTurns this message into a XOP package.- Returns:
truewhen the message is a XOP package- See Also:
-
getAttachments
Description copied from interface:MimeMessageReturns anIteratorover allAttachmentobjects that are part of this message.- Returns:
- an iterator over all attachments
- Throws:
AttachmentException- in case of errors- See Also:
-
getAttachment
Description copied from interface:MimeMessageReturns theAttachmentwith the specified content Id.- Returns:
- the attachment with the specified content id; or
nullif it cannot be found
-
addAttachment
Description copied from interface:MimeMessageAdd an attachment to the message, taking the content from aDataHandler.dataHandler- the data handler to take the content from- Returns:
- the added attachment
-
toString
-