public abstract class ResponseCreators extends Object
ResponseCreator
classes. Typically used to provide input for ResponseActions.andRespond(ResponseCreator)
.Modifier and Type | Method and Description |
---|---|
static ResponseCreator |
withClientOrSenderFault(String faultStringOrReason,
Locale locale)
Respond with a
Client (SOAP 1.1) or Sender (SOAP 1.2) fault. |
static ResponseCreator |
withError(String errorMessage)
Respond with an error.
|
static ResponseCreator |
withException(IOException ioException)
Respond with an
IOException . |
static ResponseCreator |
withException(RuntimeException ex)
Respond with an
RuntimeException . |
static ResponseCreator |
withMustUnderstandFault(String faultStringOrReason,
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(Source payload)
Respond with the given
Source XML as payload response. |
static ResponseCreator |
withServerOrReceiverFault(String faultStringOrReason,
Locale locale)
Respond with a
Server (SOAP 1.1) or Receiver (SOAP 1.2) fault. |
static ResponseCreator |
withSoapEnvelope(org.springframework.core.io.Resource soapEnvelope)
Respond with the given
Resource XML as SOAP envelope response. |
static ResponseCreator |
withSoapEnvelope(Source soapEnvelope)
Respond with the given
Source XML as SOAP envelope response. |
static ResponseCreator |
withVersionMismatchFault(String faultStringOrReason,
Locale locale)
Respond with a
VersionMismatch fault. |
public static ResponseCreator withPayload(Source payload)
Source
XML as payload response.payload
- the response payloadpublic static ResponseCreator withPayload(org.springframework.core.io.Resource payload) throws IOException
Resource
XML as payload response.payload
- the response payloadIOException
public static ResponseCreator withError(String errorMessage)
errorMessage
- the error messageWebServiceConnection.hasError()
,
WebServiceConnection.getErrorMessage()
public static ResponseCreator withException(IOException ioException)
IOException
.ioException
- the exception to be thrownpublic static ResponseCreator withException(RuntimeException ex)
RuntimeException
.ex
- the runtime exception to be thrownpublic static ResponseCreator withSoapEnvelope(Source soapEnvelope)
Source
XML as SOAP envelope response.soapEnvelope
- the response SOAP envelopepublic static ResponseCreator withSoapEnvelope(org.springframework.core.io.Resource soapEnvelope) throws IOException
Resource
XML as SOAP envelope response.soapEnvelope
- the response SOAP envelopeIOException
public static ResponseCreator withMustUnderstandFault(String faultStringOrReason, Locale locale)
MustUnderstand
fault.faultStringOrReason
- the SOAP 1.1 fault string or SOAP 1.2 reason textlocale
- the language of faultStringOrReason. Optional for SOAP 1.1SoapBody.addMustUnderstandFault(String, java.util.Locale)
public static ResponseCreator withClientOrSenderFault(String faultStringOrReason, Locale locale)
Client
(SOAP 1.1) or Sender
(SOAP 1.2) fault.faultStringOrReason
- the SOAP 1.1 fault string or SOAP 1.2 reason textlocale
- the language of faultStringOrReason. Optional for SOAP 1.1SoapBody.addClientOrSenderFault(String, Locale)
public static ResponseCreator withServerOrReceiverFault(String faultStringOrReason, Locale locale)
Server
(SOAP 1.1) or Receiver
(SOAP 1.2) fault.faultStringOrReason
- the SOAP 1.1 fault string or SOAP 1.2 reason textlocale
- the language of faultStringOrReason. Optional for SOAP 1.1SoapBody.addServerOrReceiverFault(String, Locale)
public static ResponseCreator withVersionMismatchFault(String faultStringOrReason, Locale locale)
VersionMismatch
fault.faultStringOrReason
- the SOAP 1.1 fault string or SOAP 1.2 reason textlocale
- the language of faultStringOrReason. Optional for SOAP 1.1SoapBody.addVersionMismatchFault(String, Locale)
Copyright © 2018 Pivotal Software. All rights reserved.