GitHub user facundovs opened a pull request:
https://github.com/apache/cxf/pull/308
CXF-7489: Stax2Validation doesn't support schema imports.
Using the Stax2Validation for validating a wsdl, a NPE is being thown.
After some analysis I could find that the targetNamespace is being used as
key to save schemas to process (please see this[ code
line](https://github.com/apache/cxf/blob/master/core/src/main/java/org/apache/cxf/staxutils/validation/Stax2ValidationUtils.java#L153))
However, a WSDL can have the following format in the <wsdl:types> element:
```
<wsdl:types>
<xsd:schema>
<xsd:import namespace="http://www.foo.org"
schemaLocation="foo.xsd"/>
<xsd:import namespace="http://www.bar.org"
schemaLocation="bar.xsd"/>
</xsd:schema>
</wsdl:types>
```
As you can see in these cases, the targetNamespace is not present in the
schema element that is only used for importing external schemas.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/facundovs/cxf CXF-7489
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/cxf/pull/308.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #308
----
commit 3f23269e61cf31f33e3e88e93cdaffaca6792efe
Author: facundov <[email protected]>
Date: 2017-08-29T14:32:53Z
CXF-7489: Stax2Validation doesn't support schema imports.
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---