Class PayloadValidatingInterceptor
java.lang.Object
org.springframework.xml.transform.TransformerObjectSupport
org.springframework.ws.server.endpoint.interceptor.AbstractValidatingInterceptor
org.springframework.ws.soap.server.endpoint.interceptor.AbstractFaultCreatingValidatingInterceptor
org.springframework.ws.soap.server.endpoint.interceptor.PayloadValidatingInterceptor
- All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean
,EndpointInterceptor
Interceptor that validates the contents of
WebServiceMessage
s using a schema. Allows for both W3C XML and
RELAX NG schemas.
When the payload is invalid, this interceptor stops processing of the interceptor chain. Additionally, if the message is a SOAP request message, a SOAP Fault is created as reply. Invalid SOAP responses do not result in a fault.
The schema to validate against is set with the schema
property or schemas
property. By default, only
the request message is validated, but this behaviour can be changed using the validateRequest
and
validateResponse
properties. Responses that contains faults are not validated.
- Since:
- 1.0.0
- Author:
- Arjen Poutsma
- See Also:
-
Field Summary
Fields inherited from class org.springframework.ws.soap.server.endpoint.interceptor.AbstractFaultCreatingValidatingInterceptor
DEFAULT_DETAIL_ELEMENT_NAME, DEFAULT_FAULTSTRING_OR_REASON
Fields inherited from class org.springframework.xml.transform.TransformerObjectSupport
logger
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected Source
Returns the payload source of the given message.protected Source
getValidationResponseSource
(WebServiceMessage response) Returns the payload source of the given message.Methods inherited from class org.springframework.ws.soap.server.endpoint.interceptor.AbstractFaultCreatingValidatingInterceptor
getAddValidationErrorDetail, getDetailElementName, getFaultStringOrReason, getFaultStringOrReasonLocale, handleRequestValidationErrors, setAddValidationErrorDetail, setDetailElementName, setFaultStringOrReason, setFaultStringOrReasonLocale
Methods inherited from class org.springframework.ws.server.endpoint.interceptor.AbstractValidatingInterceptor
afterCompletion, afterPropertiesSet, getSchemaLanguage, getSchemas, 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
-
Constructor Details
-
PayloadValidatingInterceptor
public PayloadValidatingInterceptor()
-
-
Method Details
-
getValidationRequestSource
Returns the payload source of the given message.- Specified by:
getValidationRequestSource
in classAbstractValidatingInterceptor
- Parameters:
request
- the request message- Returns:
- the part of the message that is to validated, or
null
not to validate anything
-
getValidationResponseSource
Returns the payload source of the given message.- Specified by:
getValidationResponseSource
in classAbstractValidatingInterceptor
- Parameters:
response
- the response message- Returns:
- the part of the message that is to validated, or
null
not to validate anything
-