Class ResponseCreators

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

public abstract class ResponseCreators extends Object
Factory methods for ResponseCreator classes. Typically used to provide input for ResponseActions.andRespond(ResponseCreator).
Since:
2.0
Author:
Arjen Poutsma
  • Method Details

    • withPayload

      public static ResponseCreator withPayload(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 IOException
      Respond with the given Resource XML as payload response.
      Parameters:
      payload - the response payload
      Returns:
      the response callback
      Throws:
      IOException
    • withError

      public static ResponseCreator withError(String errorMessage)
      Respond with an error.
      Parameters:
      errorMessage - the error message
      Returns:
      the response callback
      See Also:
    • withException

      public static ResponseCreator withException(IOException ioException)
      Respond with an IOException.
      Parameters:
      ioException - the exception to be thrown
      Returns:
      the response callback
    • withException

      public static ResponseCreator withException(RuntimeException ex)
      Respond with an RuntimeException.
      Parameters:
      ex - the runtime exception to be thrown
      Returns:
      the response callback
    • withSoapEnvelope

      public static ResponseCreator withSoapEnvelope(Source soapEnvelope)
      Respond with the given Source XML as SOAP envelope response.
      Parameters:
      soapEnvelope - the response SOAP envelope
      Returns:
      the response callback
      Since:
      2.1.1
    • withSoapEnvelope

      public static ResponseCreator withSoapEnvelope(org.springframework.core.io.Resource soapEnvelope) throws IOException
      Respond with the given Resource XML as SOAP envelope response.
      Parameters:
      soapEnvelope - the response SOAP envelope
      Returns:
      the response callback
      Throws:
      IOException
      Since:
      2.1.1
    • withMustUnderstandFault

      public static ResponseCreator withMustUnderstandFault(String faultStringOrReason, 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:
    • withClientOrSenderFault

      public static ResponseCreator withClientOrSenderFault(String faultStringOrReason, 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:
    • withServerOrReceiverFault

      public static ResponseCreator withServerOrReceiverFault(String faultStringOrReason, 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:
    • withVersionMismatchFault

      public static ResponseCreator withVersionMismatchFault(String faultStringOrReason, 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: