cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dand...@apache.org
Subject svn commit: r522161 - in /incubator/cxf/trunk/rt: core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java
Date Sun, 25 Mar 2007 04:47:05 GMT
Author: dandiep
Date: Sat Mar 24 21:47:03 2007
New Revision: 522161

URL: http://svn.apache.org/viewvc?view=rev&rev=522161
Log:
Give each schema a new systemId so that if we have multiple schemas in the same namespace,
they don't get clobbered.

Modified:
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
    incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java?view=diff&rev=522161&r1=522160&r2=522161
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
(original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
Sat Mar 24 21:47:03 2007
@@ -280,6 +280,7 @@
     private void extractSchema(Definition def, XmlSchemaCollection schemaCol, ServiceInfo
serviceInfo) {
         Types typesElement = def.getTypes();
         if (typesElement != null) {
+            int schemaCount = 1;
             for (Object obj : typesElement.getExtensibilityElements()) {
                 org.w3c.dom.Element schemaElem = null;
                 if (obj instanceof Schema) {
@@ -299,16 +300,20 @@
                                                       "xmlns:" + prefix, ns);
                         }
                     }
+                    String systemId = def.getDocumentBaseURI() + "#types" + schemaCount;
+                    
                     schemaCol.setBaseUri(def.getDocumentBaseURI());
                     CatalogXmlSchemaURIResolver schemaResolver = 
                         new CatalogXmlSchemaURIResolver(OASISCatalogManager.getCatalog(bus));
                     schemaCol.setSchemaResolver(schemaResolver);
-                    XmlSchema xmlSchema = schemaCol.read(schemaElem);
+                    XmlSchema xmlSchema = schemaCol.read(schemaElem, systemId);
 
                     SchemaInfo schemaInfo = new SchemaInfo(serviceInfo, xmlSchema.getTargetNamespace());
                     schemaInfo.setElement(schemaElem);
                     schemaInfo.setSchema(xmlSchema);
+                    schemaInfo.setSystemId(systemId);
                     serviceInfo.addSchema(schemaInfo);
+                    schemaCount++;
                 }
             }
         }

Modified: incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java?view=diff&rev=522161&r1=522160&r2=522161
==============================================================================
--- incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java
(original)
+++ incubator/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/endpoint/dynamic/DynamicClientFactory.java
Sat Mar 24 21:47:03 2007
@@ -151,9 +151,11 @@
         ErrorListener elForRun = new InnerErrorListener(wsdlUrl);
         compiler.setErrorListener(elForRun);
 
+        int num = 1;
         for (SchemaInfo schema : schemas) {
             Element el = schema.getElement();
-            compiler.parseSchema(wsdlUrl, el);
+            compiler.parseSchema(wsdlUrl + "#types" + num, el);
+            num++;
         }
 
         S2JJAXBModel intermediateModel = compiler.bind();



Mime
View raw message