You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by aj...@apache.org on 2006/03/15 07:32:29 UTC

svn commit: r385981 - /webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/WSDLValidatorExtension.java

Author: ajith
Date: Tue Mar 14 22:32:27 2006
New Revision: 385981

URL: http://svn.apache.org/viewcvs?rev=385981&view=rev
Log:
Fixing a minor bug. Our previous code checked for a single schema import (which should've been multiple imports).

Modified:
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/WSDLValidatorExtension.java

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/WSDLValidatorExtension.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/WSDLValidatorExtension.java?rev=385981&r1=385980&r2=385981&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/WSDLValidatorExtension.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/WSDLValidatorExtension.java Tue Mar 14 22:32:27 2006
@@ -46,13 +46,16 @@
             if (ExtensionConstants.SCHEMA.equals(element.getType())) {
                 Schema schema = (Schema) element;
                 Element schemaElement = schema.getElement();
-                //first check whether the schema include only a single import statement.
-                //As per the nature of WSDL if the schema has a single import ONLY, then the
+                //first check whether the schema include import statements.
+                //As per the nature of WSDL if the schema has imports ONLY, then the
                 //schema element need not contain a target namespace.
                 NodeList importNodeList = schemaElement.getElementsByTagNameNS(schemaElement.getNamespaceURI(), "import");
                 NodeList allNodes = schemaElement.getElementsByTagName("*");
+
                 //checking the number of child elements and the number of import elements should get us what we need
-                if (importNodeList.getLength() == 1 && allNodes.getLength() == 1) {
+                //if these match, that means we have only import statements
+
+                if (importNodeList.getLength()== allNodes.getLength()) {
                     return;
                 }