diff options
Diffstat (limited to 'sca-java-2.x/branches/2.0-Beta1/modules')
2 files changed, 46 insertions, 3 deletions
diff --git a/sca-java-2.x/branches/2.0-Beta1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLDefinitionImpl.java b/sca-java-2.x/branches/2.0-Beta1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLDefinitionImpl.java index 5b3ad74229..dc3afaa641 100644 --- a/sca-java-2.x/branches/2.0-Beta1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLDefinitionImpl.java +++ b/sca-java-2.x/branches/2.0-Beta1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLDefinitionImpl.java @@ -219,7 +219,25 @@ public class WSDLDefinitionImpl implements WSDLDefinition { } } if (schemaCollection != null) { - return schemaCollection.getElementByQName(name); + XmlSchemaElement element = schemaCollection.getElementByQName(name); + if ( element != null) { + return element; + } + } + + for ( WSDLDefinition d: imported ) { + if ( d.getDefinition() == definition ) { + XmlSchemaElement element = d.getXmlSchemaElement(name); + if ( element != null ) + return element; + break; + } + } + + for ( WSDLDefinition d : imported ) { + XmlSchemaElement element = d.getXmlSchemaElement(name); + if ( element != null ) + return element; } return null; } @@ -239,7 +257,32 @@ public class WSDLDefinitionImpl implements WSDLDefinition { } } if (schemaCollection != null) { - return schemaCollection.getTypeByQName(name); + 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; } diff --git a/sca-java-2.x/branches/2.0-Beta1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLModelResolver.java b/sca-java-2.x/branches/2.0-Beta1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLModelResolver.java index 6afa43b905..0e66c41a02 100644 --- a/sca-java-2.x/branches/2.0-Beta1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLModelResolver.java +++ b/sca-java-2.x/branches/2.0-Beta1/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLModelResolver.java @@ -316,7 +316,7 @@ public class WSDLModelResolver implements ModelResolver { imp.setDefinition(d.getDefinition()); imp.setLocationURI(d.getDefinition().getDocumentBaseURI()); facade.addImport(imp); - aggregated.getXmlSchemas().addAll(d.getXmlSchemas()); + // aggregated.getXmlSchemas().addAll(d.getXmlSchemas()); aggregated.getImportedDefinitions().add(d); // Deal with extensibility elements in the imported Definitions... List<ExtensibilityElement> extElements = (List<ExtensibilityElement>) d.getDefinition().getExtensibilityElements(); |