You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by bd...@apache.org on 2010/10/28 06:46:30 UTC

svn commit: r1028182 - in /tuscany/sca-java-2.x/trunk/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl: impl/WSDLDefinitionImpl.java xml/WSDLModelResolver.java

Author: bdaniel
Date: Thu Oct 28 04:46:29 2010
New Revision: 1028182

URL: http://svn.apache.org/viewvc?rev=1028182&view=rev
Log:
TUSCANY-3709 Do not aggregate schema types into facade WSDL, check local inline types before other WSDL documents, and update OASIS assembly test error messages

Modified:
    tuscany/sca-java-2.x/trunk/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLDefinitionImpl.java
    tuscany/sca-java-2.x/trunk/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLModelResolver.java

Modified: tuscany/sca-java-2.x/trunk/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLDefinitionImpl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLDefinitionImpl.java?rev=1028182&r1=1028181&r2=1028182&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLDefinitionImpl.java (original)
+++ tuscany/sca-java-2.x/trunk/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLDefinitionImpl.java Thu Oct 28 04:46:29 2010
@@ -219,7 +219,25 @@ public class WSDLDefinitionImpl implemen
             }
         }
         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 implemen
             }
         }
         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;
     }

Modified: tuscany/sca-java-2.x/trunk/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLModelResolver.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLModelResolver.java?rev=1028182&r1=1028181&r2=1028182&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLModelResolver.java (original)
+++ tuscany/sca-java-2.x/trunk/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/xml/WSDLModelResolver.java Thu Oct 28 04:46:29 2010
@@ -316,7 +316,7 @@ public class WSDLModelResolver implement
                 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();