if(nestedDesc != null) {
TypesElement typesElem = nestedDesc.getTypesElement();
if(typesElem != null) {
Schema[] schemas = typesElem.getSchemas(schema.getNamespace());
for(int j=0; j<schemas.length; j++) {
Schema s = (Schema)schemas[i];
XmlSchema x = s.getSchemaDefinition();
if(x != null) {
schemaDef = x;
break;
}
}
}
}
}
}
if(schemaDef == null) {
//Check if any WSDL includes contain a schema with this namespace.
//TODO there may be multiple schemas that this namespace import could resolve to. This is a temporary solution pending WODEN- post M7.
IncludeElement[] includes = desc.getIncludeElements();
for(int i=0; i<includes.length; i++) {
IncludeElement includeElem = (IncludeElement) includes[i];
DescriptionElement nestedDesc = includeElem.getDescriptionElement();
if(nestedDesc != null) {
TypesElement typesElem = nestedDesc.getTypesElement();
if(typesElem != null) {
Schema[] schemas = typesElem.getSchemas(schema.getNamespace());
for(int j=0; j<schemas.length; j++) {
Schema s = (Schema)schemas[i];
XmlSchema x = s.getSchemaDefinition();
if(x != null) {
schemaDef = x;
break;
}
}