Schema validation fails when including several schemas with same targetNamespace in the wsdl · Issue #777 · javaee/metro-jax-ws (original) (raw)

Hello,

I am using a pre-defined wsdl. In this wsdl I am including (xs:include) several
schemas all having the same targetNamespace.

However all but one of these schemas are unknown for the validator. Respectively
I get "Cannot find the declaration of element ..." exceptions, although these
elements are correctly defined in the schema.

This seems to be a bug in the ServerSchemaValidationTube. If in the source-Array
returned by getSchemaSources() the source for the wsdl-schemaFragment isn't
contained at index 0, then exactly this problem occurs. Only the schema at index
0 is then later known for the validator. There is also a comment hinting at this
behaviour...

Attached you find a modified ServerSchemaValidationTube, where the
wsdl-schemaFragmentSource will always be contained at index 0.

Environment

Operating System: All
Platform: All

Affected Versions

[2.1.7]