System.getProperty("javax.xml.validation.SchemaFactory:" + XMLConstants.W3C_XML_SCHEMA_NS_URI, "");
System.setProperty("javax.xml.validation.SchemaFactory:" + XMLConstants.W3C_XML_SCHEMA_NS_URI,
"org.apache.xerces.jaxp.validation.XMLSchemaFactory");
try {
PayloadValidatingInterceptor interceptor = new PayloadValidatingInterceptor();
interceptor.setSchema(new ClassPathResource(SCHEMA2, PayloadValidatingInterceptorTest.class));
interceptor.afterPropertiesSet();
MessageFactory messageFactory = MessageFactory.newInstance();
SOAPMessage saajMessage =
SaajUtils.loadMessage(new ClassPathResource(VALID_SOAP_MESSAGE, getClass()), messageFactory);
context = new DefaultMessageContext(new SaajSoapMessage(saajMessage),
new SaajSoapMessageFactory(messageFactory));
boolean result = interceptor.handleRequest(context, null);
Assert.assertTrue("Invalid response from interceptor", result);