Description
We have a wsdl that compiles without issues with Axis2 1.4.x and 1.5.x but no longer with Axis2 1.6.x
We get following exception:
Caused by: org.apache.axis2.schema.SchemaCompilationException: The referenced element '
BandList' was not found!
This BandList element is located in 2 different xsd's. Both are in fact identical, but they have a unique namespace.
I have imported the 1.6.2 source code in eclipse and I managed to locate the code where things seem to wrong.
It is located in the org.apache.axis2.schema.SchemaCompiler.isComponetExists(...) method. This method checks if a certain element exists in an xsd. It does not however check the namespace so it will always return the first schema containing the element. But later on a check is done on the namespace which results in above error.
I'm not sure what the best way is to fix this issue. I did it by adding below code to the beginning of the method:
if (!schema.getTargetNamespace().equals(componentQName.getNamespaceURI())) {
return false;
}
This seem to have worked for me (though I'm not 100% sure as the implementation of this generated code still has to be done). At least it allowed me to generate the code without schema compilation errors.
I will attach (or at least do an attempt as it is my first time on Jira) a simplified version of our wsdl and a small java project that simulates the issue.