Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PayloadValidatingInterceptor cannot handle more than one schema [SWS-481] #614

Closed
gregturn opened this issue Feb 9, 2009 · 2 comments
Closed

Comments

@gregturn
Copy link
Member

gregturn commented Feb 9, 2009

Michael Duffy opened SWS-481 and commented

A WAR file has two Spring annotated web services (Foo and Bar), each with their own separate XSD files (foo.xsd and bar.xsd) describing request and response streams. Logging and validation interceptors are configured.

If the PayloadRootAnnotationMethodEndpointMapping does not use the validation interceptor, both web services accept request XML streams from a SOAP UI client and return the correct response XML. This leads me to conclude that the code and configuration for both Foo and Bar services is correct and fully operational.

If the PayloadRootAnnotationMethodEndpointMapping uses the validation interceptor, which in turn points to a CommonsXsdSchemaCollection instance, the success or failure of the web service depends on the order in which the XSD appears in the CommonsXsdSchemaCollection. If foo.xsd appears first, the Foo service client returns the correct response XML. The Bar service returns a validation error:

<spring-ws:ValidationError xmlns:spring-ws="http://springframework.org/spring-ws">cvc-elt.1: Cannot find the declaration of element 'pmt:PatternRequest'.</spring-ws:ValidationError>

If the order of the schemas is reversed in the CommonsXsdSchemaCollection, then the Bar service returns the correct response XML and the Foo service returns the validation error stream.


Affects: 1.5.4

Reference URL: http://forum.springframework.org/showthread.php?t=26685

@gregturn
Copy link
Member Author

gregturn commented Feb 9, 2009

Arjen Poutsma commented

The problem here is that the schema validation relies on the functionality available in the JDK, specifically javax.xml.validation.Schema. There are some rules when using multiple schema files with this class, see http://java.sun.com/j2se/1.5.0/docs/api/javax/xml/validation/SchemaFactory.html#newSchema(javax.xml.transform.Source[])

I admit that these rules are far from ideal, but there is very little we can do about it.

@gregturn
Copy link
Member Author

gregturn commented May 4, 2012

Arjen Poutsma commented

Closing old issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants