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 ResponseCreatorwithClientOrSenderFault(String faultStringOrReason, Locale locale) Respond with aClient(SOAP 1.1) orSender(SOAP 1.2) fault.static ResponseCreatorRespond with an error.static ResponseCreatorwithException(IOException ioException) Respond with anIOException.static ResponseCreatorRespond with anRuntimeException.static ResponseCreatorwithMustUnderstandFault(String faultStringOrReason, Locale locale) Respond with aMustUnderstandfault.static ResponseCreatorwithPayload(Source payload) Respond with the givenSourceXML as payload response.static ResponseCreatorwithPayload(org.springframework.core.io.Resource payload) Respond with the givenResourceXML as payload response.static ResponseCreatorwithServerOrReceiverFault(String faultStringOrReason, Locale locale) Respond with aServer(SOAP 1.1) orReceiver(SOAP 1.2) fault.static ResponseCreatorwithSoapEnvelope(Source soapEnvelope) Respond with the givenSourceXML as SOAP envelope response.static ResponseCreatorwithSoapEnvelope(org.springframework.core.io.Resource soapEnvelope) Respond with the givenResourceXML as SOAP envelope response.static ResponseCreatorwithVersionMismatchFault(String faultStringOrReason, Locale locale) Respond with aVersionMismatchfault.
-
Method Details
-
withPayload
Respond with the givenSourceXML 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 givenResourceXML 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 givenSourceXML 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 givenResourceXML as SOAP envelope response.- Parameters:
soapEnvelope- the response SOAP envelope- Returns:
- the response callback
- Throws:
IOException- Since:
- 2.1.1
-
withMustUnderstandFault
Respond with aMustUnderstandfault.- 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 aVersionMismatchfault.- 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:
-