Spring Web Services Framework

org.springframework.ws.client.support.interceptor
Class PayloadValidatingInterceptor

java.lang.Object
  extended by org.springframework.xml.transform.TransformerObjectSupport
      extended by org.springframework.ws.client.support.interceptor.AbstractValidatingInterceptor
          extended by org.springframework.ws.client.support.interceptor.PayloadValidatingInterceptor
All Implemented Interfaces:
InitializingBean, ClientInterceptor

public class PayloadValidatingInterceptor
extends AbstractValidatingInterceptor

Client-side interceptor that validates the contents of WebServiceMessages 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.

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.5.4
Author:
Stefan Schmidt, Arjen Poutsma
See Also:
AbstractValidatingInterceptor.setSchema(org.springframework.core.io.Resource), AbstractValidatingInterceptor.setSchemas(org.springframework.core.io.Resource[]), AbstractValidatingInterceptor.setValidateRequest(boolean), AbstractValidatingInterceptor.setValidateResponse(boolean)

Field Summary
 
Fields inherited from class org.springframework.xml.transform.TransformerObjectSupport
logger
 
Constructor Summary
PayloadValidatingInterceptor()
           
 
Method Summary
protected  Source getValidationRequestSource(WebServiceMessage request)
          Returns the part of the request message that is to be validated.
protected  Source getValidationResponseSource(WebServiceMessage response)
          Returns the part of the response message that is to be validated.
 
Methods inherited from class org.springframework.ws.client.support.interceptor.AbstractValidatingInterceptor
afterPropertiesSet, getSchemaLanguage, getSchemas, handleFault, handleRequest, handleRequestValidationErrors, handleResponse, handleResponseValidationErrors, setSchema, setSchemaLanguage, setSchemas, setValidateRequest, setValidateResponse, setXsdSchema, setXsdSchemaCollection
 
Methods inherited from class org.springframework.xml.transform.TransformerObjectSupport
createTransformer, getTransformerFactory, newTransformerFactory, setTransformerFactoryClass, transform
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PayloadValidatingInterceptor

public PayloadValidatingInterceptor()
Method Detail

getValidationRequestSource

protected Source getValidationRequestSource(WebServiceMessage request)
Returns the part of the request message that is to be validated. Default

Specified by:
getValidationRequestSource in class AbstractValidatingInterceptor
Parameters:
request - the request message
Returns:
the part of the message that is to validated, or null not to validate anything

getValidationResponseSource

protected Source getValidationResponseSource(WebServiceMessage response)
Returns the part of the response message that is to be validated.

Specified by:
getValidationResponseSource in class AbstractValidatingInterceptor
Parameters:
response - the response message
Returns:
the part of the message that is to validated, or null not to validate anything

Spring Web Services Framework

Copyright © 2005-2013 The Spring Web Services Framework. All Rights Reserved.