org.springframework.ws.soap
Interface SoapMessage

All Superinterfaces:
WebServiceMessage
All Known Implementing Classes:
AbstractSoapMessage, SaajSoapMessage

public interface SoapMessage
extends WebServiceMessage

Represents an abstraction for SOAP messages, providing access to a SOAP Envelope. The contents of the SOAP body can be retrieved by getPayloadSource() and getPayloadResult() on WebServiceMessage, the super-interface of this interface.

Author:
Arjen Poutsma
See Also:
WebServiceMessage.getPayloadSource(), WebServiceMessage.getPayloadResult(), getEnvelope()

Method Summary
 Attachment addAttachment(java.io.File file)
          Add an attachment to the SoapMessage, taking the content from a java.io.File.
 Attachment addAttachment(org.springframework.core.io.InputStreamSource inputStreamSource, java.lang.String contentType)
          Add an attachment to the SoapMessage, taking the content from an org.springframework.core.io.InputStreamResource.
 java.util.Iterator getAttachments()
          Returns an Iterator over all Attachments that are part of this SoapMessage.
 SoapEnvelope getEnvelope()
          Returns the SoapEnvelope associated with this SoapMessage.
 java.lang.String getSoapAction()
          Get the SOAP Action for this messaage, or null if not present.
 SoapBody getSoapBody()
          Returns the SoapBody associated with this SoapMessage.
 SoapHeader getSoapHeader()
          Returns the SoapHeader associated with this SoapMessage.
 SoapVersion getVersion()
          Returns the SOAP version of this message.
 
Methods inherited from interface org.springframework.ws.WebServiceMessage
getPayloadResult, getPayloadSource, writeTo
 

Method Detail

getEnvelope

SoapEnvelope getEnvelope()
Returns the SoapEnvelope associated with this SoapMessage.


getSoapAction

java.lang.String getSoapAction()
Get the SOAP Action for this messaage, or null if not present.

Returns:
the SOAP Action.

getSoapBody

SoapBody getSoapBody()
Returns the SoapBody associated with this SoapMessage. This is a convenience method for getEnvelope().getBody().

See Also:
SoapEnvelope.getBody()

getSoapHeader

SoapHeader getSoapHeader()
Returns the SoapHeader associated with this SoapMessage. This is a convenience method for getEnvelope().getHeader().

See Also:
SoapEnvelope.getHeader()

getVersion

SoapVersion getVersion()
Returns the SOAP version of this message. This can be either SOAP 1.1 or SOAP 1.2.

Returns:
the SOAP version
See Also:
SoapVersion.SOAP_11, SoapVersion.SOAP_12

getAttachments

java.util.Iterator getAttachments()
Returns an Iterator over all Attachments that are part of this SoapMessage.

Returns:
an Iterator over all Attachments
See Also:
Attachment

addAttachment

Attachment addAttachment(java.io.File file)
                         throws AttachmentException
Add an attachment to the SoapMessage, taking the content from a java.io.File.

The content type will be determined by the name of the given content file. Do not use this for temporary files with arbitrary filenames (possibly ending in ".tmp" or the like)!

Parameters:
file - the File resource to take the content from
Returns:
the added attachment
Throws:
AttachmentException - in case of errors
See Also:
addAttachment(InputStreamSource, String)

addAttachment

Attachment addAttachment(org.springframework.core.io.InputStreamSource inputStreamSource,
                         java.lang.String contentType)
Add an attachment to the SoapMessage, taking the content from an org.springframework.core.io.InputStreamResource.

Note that the InputStream returned by the source needs to be a fresh one on each call, as underlying implementations can invoke getInputStream() multiple times.

Parameters:
inputStreamSource - the resource to take the content from (all of Spring's Resource implementations can be passed in here)
contentType - the content type to use for the element
Returns:
the added attachment
Throws:
AttachmentException - in case of errors
See Also:
addAttachment(java.io.File), Resource


Copyright © 2002-2006. All Rights Reserved.