XmlSchemaCollection schemaCollection = null;
for (XSDefinition xsd : schemas) {
if (xsd.getSchemaCollection() != null) {
schemaCollection = xsd.getSchemaCollection();
}
XmlSchemaType type = xsd.getXmlSchemaType(name);
if (type != null) {
return type;
}
}
if (schemaCollection != null) {
XmlSchemaType type = schemaCollection.getTypeByQName(name);
if ( type != null ) {
return type;
}
}
// If this is an aggregated facade WSDL, the definition that this is intended to represent
// will be in the list of imports. We check for the type in this definition first before
// proceeding to any imports.
// TODO - This aggregated WSDL facade is a little strange and this isn't the most efficient
// way to handle this. For now, this resolves an issue where inline types are being
// returned from the wrong wsdl, but this could be improved.
for ( WSDLDefinition d: imported ) {
if ( d.getDefinition() == definition ) {
XmlSchemaType type = d.getXmlSchemaType(name);
if ( type != null )
return type;
break;
}
}
for ( WSDLDefinition d: imported ) {
XmlSchemaType type = d.getXmlSchemaType(name);
if ( type != null )
return type;
break;
}
return null;