I’m developing in a Spring project using Sping-WS (2.1).
Using the PayloadValidatingInterceptor the messages we’re sending via Spring Mock or soapUI are rated invalid.
We checked the XSD several times and we’re sure, the data and the schema are correct.
I implemented two test cases inside our SpringJUnit4ClassRunner using the springframework.xml-validator engine and javax.xml.validation classes to validate the payload outside of the WS against the schema. There they’re valid.
Does anybody knows a reason why the validation inside the WS behaves different to the manual validation?
I’ve had some problems with the
PayloadValidatingInterceptoras well. I created a simple alternative, based on what I read here. Sometimes the interceptor will not work as expected – making itStringReader-based instead ofString-based solved my problems. Perhaps this will help solving your issue as well!To detail the solution given there, you can replace the interceptor with a proxy class like this:
and use it like