public class PayloadValidatingInterceptor extends AbstractFaultCreatingValidatingInterceptor
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.
AbstractValidatingInterceptor.setSchema(org.springframework.core.io.Resource)
,
AbstractValidatingInterceptor.setSchemas(org.springframework.core.io.Resource[])
,
AbstractValidatingInterceptor.setValidateRequest(boolean)
,
AbstractValidatingInterceptor.setValidateResponse(boolean)
DEFAULT_DETAIL_ELEMENT_NAME, DEFAULT_FAULTSTRING_OR_REASON
logger
Constructor and Description |
---|
PayloadValidatingInterceptor() |
Modifier and Type | Method and Description |
---|---|
protected Source |
getValidationRequestSource(WebServiceMessage request)
Returns the payload source of the given message.
|
protected Source |
getValidationResponseSource(WebServiceMessage response)
Returns the payload source of the given message.
|
getAddValidationErrorDetail, getDetailElementName, getFaultStringOrReason, getFaultStringOrReasonLocale, handleRequestValidationErrors, setAddValidationErrorDetail, setDetailElementName, setFaultStringOrReason, setFaultStringOrReasonLocale
afterCompletion, afterPropertiesSet, getSchemaLanguage, getSchemas, handleFault, handleRequest, handleResponse, handleResponseValidationErrors, setErrorHandler, setSchema, setSchemaLanguage, setSchemas, setValidateRequest, setValidateResponse, setXsdSchema, setXsdSchemaCollection
createTransformer, getTransformerFactory, newTransformerFactory, setTransformerFactoryClass, transform
protected Source getValidationRequestSource(WebServiceMessage request)
getValidationRequestSource
in class AbstractValidatingInterceptor
request
- the request messagenull
not to validate anythingprotected Source getValidationResponseSource(WebServiceMessage response)
getValidationResponseSource
in class AbstractValidatingInterceptor
response
- the response messagenull
not to validate anythingCopyright © 2020 Pivotal Software. All rights reserved.