You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by am...@apache.org on 2007/03/15 07:40:43 UTC

svn commit: r518497 - in /webservices/axis2/trunk/java/modules: adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java adb-codegen/src/org/apache/axis2/schema/writer/JavaBeanWriter.java kernel/src/org/apache/axis2/util/URLProcessor.java

Author: amilas
Date: Wed Mar 14 23:40:42 2007
New Revision: 518497

URL: http://svn.apache.org/viewvc?view=rev&rev=518497
Log:
fixed the issue AXIS2-1512

Modified:
    webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java
    webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/writer/JavaBeanWriter.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/URLProcessor.java

Modified: webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java?view=diff&rev=518497&r1=518496&r2=518497
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java (original)
+++ webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java Wed Mar 14 23:40:42 2007
@@ -1851,34 +1851,61 @@
             if (refElement == null) {
                 // The referenced element seems to come from an imported
                 // schema.
-                XmlSchemaObjectCollection includes = schema.getIncludes();
-                if (includes != null) {
-                    Iterator tempIterator = includes.getIterator();
-                    while (tempIterator.hasNext()) {
-                        Object o = tempIterator.next();
-                        XmlSchema inclSchema = null;
-                        if (o instanceof XmlSchemaImport) {
-                            inclSchema = ((XmlSchemaImport) o).getSchema();
-                            if (inclSchema == null) {
-                                inclSchema = (XmlSchema) loadedSchemaMap.get(((XmlSchemaImport) o).getNamespace());
-                            }
+                refElement = getReferenceElementFromSchema(schema, referencedQName);
+            }
+        }
+
+        return refElement;
+    }
+
+    private XmlSchemaElement getReferenceElementFromSchema(
+            XmlSchema schema,
+            QName referencedQName) {
+        XmlSchemaElement refElement = null;
+        XmlSchemaObjectCollection includes = schema.getIncludes();
+        if (includes != null) {
+            Iterator tempIterator = includes.getIterator();
+            while (tempIterator.hasNext()) {
+                Object o = tempIterator.next();
+                XmlSchema inclSchema = null;
+
+                if (o instanceof XmlSchemaInclude) {
+                    inclSchema = ((XmlSchemaInclude) o).getSchema();
+                    if (inclSchema != null) {
+                        // first check in the scheam
+                        refElement = inclSchema.getElementByName(referencedQName);
+                        if (refElement == null) {
+                            // try to find the element in an inner schema
+                            refElement = getReferenceElementFromSchema(inclSchema, referencedQName);
                         }
-                        if (o instanceof XmlSchemaInclude) {
-                            inclSchema = ((XmlSchemaInclude) o).getSchema();
+                        if (refElement != null) {
+                            // we have found the element so exit from while loop;
+                            break;
                         }
-                        // get the element from the included schema
-                        if (inclSchema != null) {
-                            refElement = inclSchema.getElementByName(referencedQName);
+                    }
+                }
+
+                if (o instanceof XmlSchemaImport) {
+                    inclSchema = ((XmlSchemaImport) o).getSchema();
+                    if (inclSchema == null) {
+                        inclSchema = (XmlSchema) loadedSchemaMap.get(((XmlSchemaImport) o).getNamespace());
+                    }
+                    if (inclSchema != null) {
+                        // first check in the scheam
+                        refElement = inclSchema.getElementByName(referencedQName);
+                        if (refElement == null) {
+                            // try to find the element in an inner schema
+                            refElement = getReferenceElementFromSchema(inclSchema, referencedQName);
                         }
                         if (refElement != null) {
-                            // we found the referenced element an can break the loop
+                            // we have found the element so exit from while loop;
                             break;
                         }
                     }
                 }
+
             }
         }
-
         return refElement;
     }
 

Modified: webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/writer/JavaBeanWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/writer/JavaBeanWriter.java?view=diff&rev=518497&r1=518496&r2=518497
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/writer/JavaBeanWriter.java (original)
+++ webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/writer/JavaBeanWriter.java Wed Mar 14 23:40:42 2007
@@ -210,6 +210,7 @@
 
             return process(qName, metainf, typeMap, true);
         } catch (Exception e) {
+            e.printStackTrace();
             throw new SchemaCompilationException(e);
         }
 

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/URLProcessor.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/URLProcessor.java?view=diff&rev=518497&r1=518496&r2=518497
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/URLProcessor.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/util/URLProcessor.java Wed Mar 14 23:40:42 2007
@@ -52,7 +52,7 @@
                     hostname = hostname.substring(0, hostname.indexOf("/"));
                 }
             } else {
-                hostname = namespace;
+                hostname = namespace.replace("/",".");
             }
         }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org