You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by sl...@apache.org on 2007/04/16 17:14:41 UTC

svn commit: r529283 - /incubator/tuscany/java/sca/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/interfacedef/wsdl/xml/WSDLDocumentProcessor.java

Author: slaws
Date: Mon Apr 16 08:14:41 2007
New Revision: 529283

URL: http://svn.apache.org/viewvc?view=rev&rev=529283
Log:
Set baseUri for included XSDs. Needs looking at again to check this is the right approach for XSDs that are included in XSDs which are themselves imported into the WSDL schema.

Modified:
    incubator/tuscany/java/sca/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/interfacedef/wsdl/xml/WSDLDocumentProcessor.java

Modified: incubator/tuscany/java/sca/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/interfacedef/wsdl/xml/WSDLDocumentProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/interfacedef/wsdl/xml/WSDLDocumentProcessor.java?view=diff&rev=529283&r1=529282&r2=529283
==============================================================================
--- incubator/tuscany/java/sca/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/interfacedef/wsdl/xml/WSDLDocumentProcessor.java (original)
+++ incubator/tuscany/java/sca/modules/interface-wsdl-xml/src/main/java/org/apache/tuscany/interfacedef/wsdl/xml/WSDLDocumentProcessor.java Mon Apr 16 08:14:41 2007
@@ -41,6 +41,7 @@
 import org.apache.tuscany.interfacedef.wsdl.WSDLDefinition;
 import org.apache.tuscany.interfacedef.wsdl.WSDLFactory;
 import org.apache.tuscany.interfacedef.wsdl.impl.DefaultWSDLFactory;
+import org.apache.ws.commons.schema.XmlSchemaCollection;
 import org.apache.ws.commons.schema.resolver.URIResolver;
 import org.w3c.dom.Element;
 import org.xml.sax.InputSource;
@@ -148,6 +149,9 @@
             WSDLDefinition wsdlDefinition = factory.createWSDLDefinition();
             wsdlDefinition.setDefinition(definition);
             
+            // get base uri for any relative schema includes
+
+            
             // Read inline schemas 
             Types types = definition.getTypes();
             if (types != null) {
@@ -155,6 +159,16 @@
                 for (Object ext : types.getExtensibilityElements()) {
                     if (ext instanceof Schema) {
                         Element element = ((Schema)ext).getElement();
+
+                        // TODO: fix to make includes in imported
+                        //       schema work. The XmlSchema library was crashing
+                        //       because the base uri was not set. This doesn't
+                        //       affect imports. Need to check that this
+                        //       is the right approach for XSDs included by a
+                        //       XSD which is itself imported inline in a WSDL
+                        XmlSchemaCollection schemaCollection = wsdlDefinition.getInlinedSchemas();            
+                        schemaCollection.setBaseUri(((Schema)ext).getDocumentBaseURI());
+
                         wsdlDefinition.getInlinedSchemas().read(element, element.getBaseURI());
                     }
                 }



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