org.springframework.ws.test.client
Class ResponseCreators

java.lang.Object
  extended by org.springframework.ws.test.client.ResponseCreators

public abstract class ResponseCreators
extends java.lang.Object

Factory methods for ResponseCreator classes. Typically used to provide input for ResponseActions.andRespond(ResponseCreator).

Since:
2.0
Author:
Arjen Poutsma

Method Summary
static ResponseCreator withClientOrSenderFault(java.lang.String faultStringOrReason, java.util.Locale locale)
          Respond with a Client (SOAP 1.1) or Sender (SOAP 1.2) fault.
static ResponseCreator withError(java.lang.String errorMessage)
          Respond with an error.
static ResponseCreator withException(java.io.IOException ioException)
          Respond with an IOException.
static ResponseCreator withException(java.lang.RuntimeException ex)
          Respond with an RuntimeException.
static ResponseCreator withMustUnderstandFault(java.lang.String faultStringOrReason, java.util.Locale locale)
          Respond with a MustUnderstand fault.
static ResponseCreator withPayload(org.springframework.core.io.Resource payload)
          Respond with the given Resource XML as payload response.
static ResponseCreator withPayload(javax.xml.transform.Source payload)
          Respond with the given Source XML as payload response.
static ResponseCreator withServerOrReceiverFault(java.lang.String faultStringOrReason, java.util.Locale locale)
          Respond with a Server (SOAP 1.1) or Receiver (SOAP 1.2) fault.
static ResponseCreator withVersionMismatchFault(java.lang.String faultStringOrReason, java.util.Locale locale)
          Respond with a VersionMismatch fault.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

withPayload

public static ResponseCreator withPayload(javax.xml.transform.Source payload)
Respond with the given Source XML as payload response.

Parameters:
payload - the response payload
Returns:
the response callback

withPayload

public static ResponseCreator withPayload(org.springframework.core.io.Resource payload)
                                   throws java.io.IOException
Respond with the given Resource XML as payload response.

Parameters:
payload - the response payload
Returns:
the response callback
Throws:
java.io.IOException

withError

public static ResponseCreator withError(java.lang.String errorMessage)
Respond with an error.

Parameters:
errorMessage - the error message
Returns:
the response callback
See Also:
WebServiceConnection.hasError(), WebServiceConnection.getErrorMessage()

withException

public static ResponseCreator withException(java.io.IOException ioException)
Respond with an IOException.

Parameters:
ioException - the exception to be thrown
Returns:
the response callback

withException

public static ResponseCreator withException(java.lang.RuntimeException ex)
Respond with an RuntimeException.

Parameters:
ex - the runtime exception to be thrown
Returns:
the response callback

withMustUnderstandFault

public static ResponseCreator withMustUnderstandFault(java.lang.String faultStringOrReason,
                                                      java.util.Locale locale)
Respond with a MustUnderstand fault.

Parameters:
faultStringOrReason - the SOAP 1.1 fault string or SOAP 1.2 reason text
locale - the language of faultStringOrReason. Optional for SOAP 1.1
See Also:
SoapBody.addMustUnderstandFault(String, java.util.Locale)

withClientOrSenderFault

public static ResponseCreator withClientOrSenderFault(java.lang.String faultStringOrReason,
                                                      java.util.Locale locale)
Respond with a Client (SOAP 1.1) or Sender (SOAP 1.2) fault.

Parameters:
faultStringOrReason - the SOAP 1.1 fault string or SOAP 1.2 reason text
locale - the language of faultStringOrReason. Optional for SOAP 1.1
See Also:
SoapBody.addClientOrSenderFault(String, Locale)

withServerOrReceiverFault

public static ResponseCreator withServerOrReceiverFault(java.lang.String faultStringOrReason,
                                                        java.util.Locale locale)
Respond with a Server (SOAP 1.1) or Receiver (SOAP 1.2) fault.

Parameters:
faultStringOrReason - the SOAP 1.1 fault string or SOAP 1.2 reason text
locale - the language of faultStringOrReason. Optional for SOAP 1.1
See Also:
SoapBody.addServerOrReceiverFault(String, Locale)

withVersionMismatchFault

public static ResponseCreator withVersionMismatchFault(java.lang.String faultStringOrReason,
                                                       java.util.Locale locale)
Respond with a VersionMismatch fault.

Parameters:
faultStringOrReason - the SOAP 1.1 fault string or SOAP 1.2 reason text
locale - the language of faultStringOrReason. Optional for SOAP 1.1
See Also:
SoapBody.addVersionMismatchFault(String, Locale)


Copyright © 2011. All Rights Reserved.