cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r795160 - /cxf/trunk/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/tools/XMLBeansToolingDataBinding.java
Date Fri, 17 Jul 2009 17:35:14 GMT
Author: dkulp
Date: Fri Jul 17 17:35:14 2009
New Revision: 795160

URL: http://svn.apache.org/viewvc?rev=795160&view=rev
Log:
Fix an issue with xmlbeans where a wsdl:import of a schema (instead of
a schema import) would not generate types.

Modified:
    cxf/trunk/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/tools/XMLBeansToolingDataBinding.java

Modified: cxf/trunk/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/tools/XMLBeansToolingDataBinding.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/tools/XMLBeansToolingDataBinding.java?rev=795160&r1=795159&r2=795160&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/tools/XMLBeansToolingDataBinding.java
(original)
+++ cxf/trunk/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/tools/XMLBeansToolingDataBinding.java
Fri Jul 17 17:35:14 2009
@@ -66,6 +66,7 @@
 import org.apache.xmlbeans.impl.schema.StscState;
 import org.apache.xmlbeans.impl.tool.CodeGenUtil;
 import org.apache.xmlbeans.impl.util.FilerImpl;
+import org.apache.xmlbeans.impl.xb.substwsdl.TImport;
 import org.apache.xmlbeans.impl.xb.xmlconfig.ConfigDocument;
 import org.apache.xmlbeans.impl.xb.xmlconfig.Extensionconfig;
 import org.apache.xmlbeans.impl.xb.xsdschema.SchemaDocument;
@@ -267,9 +268,22 @@
             XmlObject urldoc = loader.parse(url, null, options);
 
             if (urldoc instanceof org.apache.xmlbeans.impl.xb.substwsdl.DefinitionsDocument)
{
+                org.apache.xmlbeans.impl.xb.substwsdl.DefinitionsDocument wsdldoc = 
+                    (org.apache.xmlbeans.impl.xb.substwsdl.DefinitionsDocument)urldoc;
+                
                 addWsdlSchemas(url.toString(),
-                               (org.apache.xmlbeans.impl.xb.substwsdl.DefinitionsDocument)urldoc,
+                               wsdldoc,
                                errorListener, scontentlist);
+                
+                for (TImport imp : wsdldoc.getDefinitions().getImportArray()) {
+                    if (imp.getLocation().toLowerCase().endsWith(".xsd")) {
+                        URL url1 = new URL(url, imp.getLocation());
+                        XmlObject urldoc2 = loader.parse(url1, null, options);
+                        addSchema(url1.toString(), (SchemaDocument)urldoc2, errorListener,
false,
+                                  scontentlist);
+                    }
+                }
+
             } else if (urldoc instanceof SchemaDocument) {
                 addSchema(url.toString(), (SchemaDocument)urldoc, errorListener, false,
                           scontentlist);
@@ -411,6 +425,7 @@
         StscState.addInfo(errorListener, "Loading wsdl file " + name);
         XmlOptions opts = new XmlOptions().setErrorListener(errorListener);
         XmlObject[] types = wsdldoc.getDefinitions().getTypesArray();
+        
         int count = 0;
         for (int j = 0; j < types.length; j++) {
             XmlObject[] schemas = types[j]



Mime
View raw message