net.javacrumbs.smock.common
Interface Message


public interface Message

Represents a protocol-agnostic XML message.

Contains methods that provide access to the payload of the message. Copy of from Spring WS WebServiceMessage. We do not want to be dependent on Spring WS here, in common library.

Since:
1.0.0
Author:
Arjen Poutsma, Lukas Krecan
See Also:
SoapMessage, WebServiceMessageFactory

Method Summary
 Source getEnvelopeSource()
          Returns envelope source for SOAP message.
 Result getPayloadResult()
          Returns the contents of the message as a Result.
 Source getPayloadSource()
          Returns the contents of the message as a Source.
 void writeTo(OutputStream outputStream)
          Writes the entire message to the given output stream.
 

Method Detail

getPayloadSource

Source getPayloadSource()
Returns the contents of the message as a Source.

Depending on the implementation, this can be retrieved multiple times, or just a single time.

Returns:
the message contents

getPayloadResult

Result getPayloadResult()
Returns the contents of the message as a Result.

Calling this method removes the current payload.

Implementations that are read-only will throw an UnsupportedOperationException.

Returns:
the message contents
Throws:
UnsupportedOperationException - if the message is read-only

writeTo

void writeTo(OutputStream outputStream)
             throws IOException
Writes 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

getEnvelopeSource

Source getEnvelopeSource()
Returns envelope source for SOAP message.

Returns:


Copyright © 2011. All Rights Reserved.