Class ResponseCreators
java.lang.Object
org.springframework.ws.test.client.ResponseCreators
Factory methods for
ResponseCreator
classes. Typically used to provide input for
ResponseActions.andRespond(ResponseCreator)
.- Since:
- 2.0
- Author:
- Arjen Poutsma
-
Method Summary
Modifier and TypeMethodDescriptionstatic ResponseCreator
withClientOrSenderFault
(String faultStringOrReason, Locale locale) Respond with aClient
(SOAP 1.1) orSender
(SOAP 1.2) fault.static ResponseCreator
Respond with an error.static ResponseCreator
withException
(IOException ioException) Respond with anIOException
.static ResponseCreator
Respond with anRuntimeException
.static ResponseCreator
withMustUnderstandFault
(String faultStringOrReason, Locale locale) Respond with aMustUnderstand
fault.static ResponseCreator
withPayload
(Source payload) Respond with the givenSource
XML as payload response.static ResponseCreator
withPayload
(org.springframework.core.io.Resource payload) Respond with the givenResource
XML as payload response.static ResponseCreator
withServerOrReceiverFault
(String faultStringOrReason, Locale locale) Respond with aServer
(SOAP 1.1) orReceiver
(SOAP 1.2) fault.static ResponseCreator
withSoapEnvelope
(Source soapEnvelope) Respond with the givenSource
XML as SOAP envelope response.static ResponseCreator
withSoapEnvelope
(org.springframework.core.io.Resource soapEnvelope) Respond with the givenResource
XML as SOAP envelope response.static ResponseCreator
withVersionMismatchFault
(String faultStringOrReason, Locale locale) Respond with aVersionMismatch
fault.
-
Method Details
-
withPayload
Respond with the givenSource
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 givenResource
XML as payload response.- Parameters:
payload
- the response payload- Returns:
- the response callback
- Throws:
IOException
-
withError
Respond with an error.- Parameters:
errorMessage
- the error message- Returns:
- the response callback
- See Also:
-
withException
Respond with anIOException
.- Parameters:
ioException
- the exception to be thrown- Returns:
- the response callback
-
withException
Respond with anRuntimeException
.- Parameters:
ex
- the runtime exception to be thrown- Returns:
- the response callback
-
withSoapEnvelope
Respond with the givenSource
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 givenResource
XML as SOAP envelope response.- Parameters:
soapEnvelope
- the response SOAP envelope- Returns:
- the response callback
- Throws:
IOException
- Since:
- 2.1.1
-
withMustUnderstandFault
Respond with aMustUnderstand
fault.- Parameters:
faultStringOrReason
- the SOAP 1.1 fault string or SOAP 1.2 reason textlocale
- the language of faultStringOrReason. Optional for SOAP 1.1- See Also:
-
withClientOrSenderFault
Respond with aClient
(SOAP 1.1) orSender
(SOAP 1.2) fault.- Parameters:
faultStringOrReason
- the SOAP 1.1 fault string or SOAP 1.2 reason textlocale
- the language of faultStringOrReason. Optional for SOAP 1.1- See Also:
-
withServerOrReceiverFault
Respond with aServer
(SOAP 1.1) orReceiver
(SOAP 1.2) fault.- Parameters:
faultStringOrReason
- the SOAP 1.1 fault string or SOAP 1.2 reason textlocale
- the language of faultStringOrReason. Optional for SOAP 1.1- See Also:
-
withVersionMismatchFault
Respond with aVersionMismatch
fault.- Parameters:
faultStringOrReason
- the SOAP 1.1 fault string or SOAP 1.2 reason textlocale
- the language of faultStringOrReason. Optional for SOAP 1.1- See Also:
-