[SWS-932] Not enough namespace context during XSD validation when using AxiomSoapMessageFactory Created: 08/Jan/16 Updated: 09/Feb/16 Resolved: 09/Feb/16
|Project:||Spring Web Services|
|Reporter:||Dennis Walter||Assignee:||Greg Turnquist|
|Remaining Estimate:||Not Specified|
|Time Spent:||Not Specified|
|Original Estimate:||Not Specified|
|Pull Request URL:||https://github.com/spring-projects/spring-ws/pull/59|
XSD request validation using AxiomSoapMessageFactory and PayloadValidatingInterceptor fails with an UndeclaredPrefix validation error, because Axiom does not have full access to the namespace declarations made on the SOAP Envelope level.
As suggested in http://stackoverflow.com/questions/34633662/xsd-validation-fails-with-undeclaredprefix-when-using-axiomsoapmessagefactory-in, a possible fix is to use OMContainer#getXMLStreamReader(boolean, OMXMLStreamReaderConfiguration) and set the preserveNamespaceContext property to true in the OMXMLStreamReaderConfiguration object (in CachingPayload#getStreamReader(OMElement)).
I tested this, and it fixes the problem. Patch is attached, as well as a small sample project exposing the erroneous behaviour.
Request that fails:
Response is a SOAP fault with detail
Request that works, with namespace decl in payload:
|Comment by Greg Turnquist [ 19/Jan/16 ]|
Evaluating if this fits in the scope of our 2.3 release.