I have a project that exposes several SOAP endpoints. I want to use PayloadValiditatingInterceptor provided by Spring WS to validate only a particular end-point. However, my current implementation is applying validation to each and every SOAP endpoint.
The source code is as follows:
@Bean(name = "requestMessage")
public SimpleXsdSchema requestMessage()
{
return new SimpleXsdSchema(new ClassPathResource("com/schemas/2_0/requestMessage.xsd"));
}
@Override
public void addInterceptors(List<EndpointInterceptor> interceptors)
{
PayloadValidatingInterceptor validatingInterceptor = new PayloadValidatingInterceptor();
validatingInterceptor.setValidateRequest(true);
validatingInterceptor.setXsdSchema(requestMessage());
interceptors.add(validatingInterceptor);
}