Class AbstractFaultCreatingValidatingInterceptor
java.lang.Object
org.springframework.xml.transform.TransformerObjectSupport
org.springframework.ws.server.endpoint.interceptor.AbstractValidatingInterceptor
org.springframework.ws.soap.server.endpoint.interceptor.AbstractFaultCreatingValidatingInterceptor
- All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean
,EndpointInterceptor
- Direct Known Subclasses:
PayloadValidatingInterceptor
public abstract class AbstractFaultCreatingValidatingInterceptor
extends AbstractValidatingInterceptor
Subclass of
AbstractValidatingInterceptor
that creates a SOAP Fault whenever the request message cannot be
validated. The contents of the SOAP Fault can be specified by setting the addValidationErrorDetail
,
faultStringOrReason
, or detailElementName
properties. Further customizing can be accomplished by
overriding handleRequestValidationErrors
.- Since:
- 1.0.0
- Author:
- Arjen Poutsma
- See Also:
-
setAddValidationErrorDetail(boolean)
setFaultStringOrReason(String)
DEFAULT_FAULTSTRING_OR_REASON
setDetailElementName(javax.xml.namespace.QName)
DEFAULT_DETAIL_ELEMENT_NAME
AbstractValidatingInterceptor.handleResponseValidationErrors(org.springframework.ws.context.MessageContext,org.xml.sax.SAXParseException[])
-
Field Summary
Modifier and TypeFieldDescriptionstatic final QName
Default SOAP Fault Detail name used when a validation errors occur on the request.static final String
Default SOAP Fault string used when a validation errors occur on the request.Fields inherited from class org.springframework.xml.transform.TransformerObjectSupport
logger
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns whether a SOAP Fault detail element should be created when a validation error occurs.Returns the fault detail element name when validation errors occur on the request.Sets the SOAPfaultstring
orReason
used when validation errors occur on the request.Returns the SOAP fault reason locale used when validation errors occur on the request.protected boolean
handleRequestValidationErrors
(MessageContext messageContext, SAXParseException[] errors) Template method that is called when the request message contains validation errors.void
setAddValidationErrorDetail
(boolean addValidationErrorDetail) Indicates whether a SOAP Fault detail element should be created when a validation error occurs.void
setDetailElementName
(QName detailElementName) Sets the fault detail element name when validation errors occur on the request.void
setFaultStringOrReason
(String faultStringOrReason) Sets the SOAPfaultstring
orReason
used when validation errors occur on the request.void
setFaultStringOrReasonLocale
(Locale faultStringOrReasonLocale) Sets the SOAP fault reason locale used when validation errors occur on the request.Methods inherited from class org.springframework.ws.server.endpoint.interceptor.AbstractValidatingInterceptor
afterCompletion, afterPropertiesSet, getSchemaLanguage, getSchemas, getValidationRequestSource, getValidationResponseSource, handleFault, handleRequest, handleResponse, handleResponseValidationErrors, setErrorHandler, setSchema, setSchemaLanguage, setSchemas, setValidateRequest, setValidateResponse, setXsdSchema, setXsdSchemaCollection
Methods inherited from class org.springframework.xml.transform.TransformerObjectSupport
createTransformer, getTransformerFactory, newTransformerFactory, setTransformerFactoryClass, transform
-
Field Details
-
DEFAULT_DETAIL_ELEMENT_NAME
Default SOAP Fault Detail name used when a validation errors occur on the request. -
DEFAULT_FAULTSTRING_OR_REASON
Default SOAP Fault string used when a validation errors occur on the request.
-
-
Constructor Details
-
AbstractFaultCreatingValidatingInterceptor
public AbstractFaultCreatingValidatingInterceptor()
-
-
Method Details
-
getAddValidationErrorDetail
public boolean getAddValidationErrorDetail()Returns whether a SOAP Fault detail element should be created when a validation error occurs. This detail element will contain the exact validation errors. It is only added when the underlying message is aSoapMessage
. Defaults totrue
.- See Also:
-
setAddValidationErrorDetail
public void setAddValidationErrorDetail(boolean addValidationErrorDetail) Indicates whether a SOAP Fault detail element should be created when a validation error occurs. This detail element will contain the exact validation errors. It is only added when the underlying message is aSoapMessage
. Defaults totrue
.- See Also:
-
getDetailElementName
Returns the fault detail element name when validation errors occur on the request. -
setDetailElementName
Sets the fault detail element name when validation errors occur on the request. Defaults toDEFAULT_DETAIL_ELEMENT_NAME
.- See Also:
-
getFaultStringOrReason
Sets the SOAPfaultstring
orReason
used when validation errors occur on the request. -
setFaultStringOrReason
Sets the SOAPfaultstring
orReason
used when validation errors occur on the request. It is only added when the underlying message is aSoapMessage
. Defaults toDEFAULT_FAULTSTRING_OR_REASON
.- See Also:
-
getFaultStringOrReasonLocale
Returns the SOAP fault reason locale used when validation errors occur on the request. -
setFaultStringOrReasonLocale
Sets the SOAP fault reason locale used when validation errors occur on the request. It is only added when the underlying message is aSoapMessage
. Defaults to English.- See Also:
-
handleRequestValidationErrors
protected boolean handleRequestValidationErrors(MessageContext messageContext, SAXParseException[] errors) throws TransformerException Template method that is called when the request message contains validation errors. This implementation logs all errors, returnsfalse
, and creates aclient or sender
SoapFault
, adding aSoapFaultDetail
with all errors if theaddValidationErrorDetail
property istrue
.- Overrides:
handleRequestValidationErrors
in classAbstractValidatingInterceptor
- Parameters:
messageContext
- the message contexterrors
- the validation errors- Returns:
true
to continue processing the request,false
(the default) otherwise- Throws:
TransformerException
-