diff options
author | bdaniel <bdaniel@13f79535-47bb-0310-9956-ffa450edef68> | 2010-10-28 05:00:40 +0000 |
---|---|---|
committer | bdaniel <bdaniel@13f79535-47bb-0310-9956-ffa450edef68> | 2010-10-28 05:00:40 +0000 |
commit | 71a29ed89b383657dcd7254474ff6d528986e996 (patch) | |
tree | d22c7cec6982c6c6f8139ceecffb97f7661c7ca6 /sca-java-2.x | |
parent | d1c4adc36afab58063b5f9dbb9a754ca875b5e3e (diff) |
TUSCANY-3709 Copy changes to Beta1 branch
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1028185 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
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(); |