geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r160134 - in geronimo/trunk: assemblies/j2ee-server/ etc/ itests/naming/common/ modules/assembly/ modules/axis-builder/ modules/axis-builder/src/java/org/apache/geronimo/axis/builder/ modules/axis-builder/src/test/org/apache/geronimo/axis/builder/ modules/axis/src/etc/META-INF/ modules/jetty-builder/
Date Tue, 05 Apr 2005 06:20:19 GMT
Author: djencks
Date: Mon Apr  4 23:20:16 2005
New Revision: 160134

URL: http://svn.apache.org/viewcvs?view=rev&rev=160134
Log:
switch to wsdl4j from sourceforge/ibm, and fix some imported schema analysis problems

Added:
    geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/SchemaInfoBuilder.java
Modified:
    geronimo/trunk/assemblies/j2ee-server/project.xml
    geronimo/trunk/etc/project.properties
    geronimo/trunk/itests/naming/common/project.xml
    geronimo/trunk/modules/assembly/project.xml
    geronimo/trunk/modules/axis-builder/project.xml
    geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisBuilder.java
    geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisServiceBuilder.java
    geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/WSDescriptorParser.java
    geronimo/trunk/modules/axis-builder/src/test/org/apache/geronimo/axis/builder/ParsingTest.java
    geronimo/trunk/modules/axis-builder/src/test/org/apache/geronimo/axis/builder/ServiceReferenceTest.java
    geronimo/trunk/modules/axis/src/etc/META-INF/geronimo-service.xml
    geronimo/trunk/modules/jetty-builder/project.xml

Modified: geronimo/trunk/assemblies/j2ee-server/project.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/assemblies/j2ee-server/project.xml?view=diff&r1=160133&r2=160134
==============================================================================
--- geronimo/trunk/assemblies/j2ee-server/project.xml (original)
+++ geronimo/trunk/assemblies/j2ee-server/project.xml Mon Apr  4 23:20:16 2005
@@ -507,9 +507,9 @@
         </dependency>
 
         <dependency>
-            <groupId>axis</groupId>
-            <artifactId>axis-wsdl4j</artifactId>
-            <version>${axis_wsdl4j_version}</version>
+            <groupId>wsdl4j</groupId>
+            <artifactId>wsdl4j</artifactId>
+            <version>${wsdl4j_version}</version>
             <properties>
                 <geronimo.assemble>repository</geronimo.assemble>
             </properties>

Modified: geronimo/trunk/etc/project.properties
URL: http://svn.apache.org/viewcvs/geronimo/trunk/etc/project.properties?view=diff&r1=160133&r2=160134
==============================================================================
--- geronimo/trunk/etc/project.properties (original)
+++ geronimo/trunk/etc/project.properties Mon Apr  4 23:20:16 2005
@@ -102,7 +102,7 @@
 axis_version=PATCH3
 axis_jaxrpc_version=1.2-RC3
 axis_saaj_version=1.2-RC3
-axis_wsdl4j_version=1.2-RC3
+#axis_wsdl4j_version=1.2-RC3
 axis_commons_discovery_version=SNAPSHOT
 avalon_framework_version=4.1.4
 avalon_logkit_version=1.2.2
@@ -160,6 +160,7 @@
 stax_api_version=1.0
 tomcat_version=5.5.7
 velocity_version=1.4
+wsdl4j_version=1.5
 xerces_version=2.6.2
 xfire_version=20050202
 xml_apis_version=1.0.b2
@@ -167,9 +168,8 @@
 xml_parser_apis_version=2.2.1
 xmlbeans_version=1.0-DEV
 xmlpull_version=1.1.3.4d_b4_min
-xstream_version=1.0.2
 xpp3_version=1.1.3.3
-wsdl4j_version=1.4
+xstream_version=1.0.2
 
 #####################################################
 # Site Colors

Modified: geronimo/trunk/itests/naming/common/project.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/itests/naming/common/project.xml?view=diff&r1=160133&r2=160134
==============================================================================
--- geronimo/trunk/itests/naming/common/project.xml (original)
+++ geronimo/trunk/itests/naming/common/project.xml Mon Apr  4 23:20:16 2005
@@ -1,14 +1,14 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- 
+<!--
 /*
  * Copyright 2001-2005 The Apache Software Foundation.
- * 
+ *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -97,9 +97,9 @@
             <version>${axis_saaj_version}</version>
         </dependency>
         <dependency>
-            <groupId>axis</groupId>
-            <artifactId>axis-wsdl4j</artifactId>
-            <version>${axis_wsdl4j_version}</version>
+            <groupId>wsdl4j</groupId>
+            <artifactId>wsdl4j</artifactId>
+            <version>${wsdl4j_version}</version>
         </dependency>
 
         <dependency>

Modified: geronimo/trunk/modules/assembly/project.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/assembly/project.xml?view=diff&r1=160133&r2=160134
==============================================================================
--- geronimo/trunk/modules/assembly/project.xml (original)
+++ geronimo/trunk/modules/assembly/project.xml Mon Apr  4 23:20:16 2005
@@ -52,7 +52,7 @@
                 <repository>true</repository>
             </properties>
         </dependency>
-        
+
         <dependency>
             <groupId>geronimo-spec</groupId>
             <artifactId>geronimo-spec-corba</artifactId>
@@ -63,7 +63,7 @@
                 <repository>true</repository>
             </properties>
         </dependency>
-        
+
         <dependency>
             <groupId>geronimo</groupId>
             <artifactId>geronimo-deployment-plugin</artifactId>
@@ -71,7 +71,7 @@
             <type>plugin</type>
         </dependency>
 
-        
+
         <!-- Used for preprocessing our plans -->
         <dependency>
             <groupId>commons-jelly</groupId>
@@ -950,7 +950,7 @@
             <version>${pom.currentVersion}</version>
             <type>war</type>
         </dependency>
-        
+
         <!-- JavaMail -->
         <dependency>
             <groupId>geronimo</groupId>
@@ -1020,15 +1020,6 @@
             <groupId>axis</groupId>
             <artifactId>axis-saaj</artifactId>
             <version>${axis_saaj_version}</version>
-            <properties>
-                <repository>true</repository>
-            </properties>
-        </dependency>
-
-        <dependency>
-            <groupId>axis</groupId>
-            <artifactId>axis-wsdl4j</artifactId>
-            <version>${axis_wsdl4j_version}</version>
             <properties>
                 <repository>true</repository>
             </properties>

Modified: geronimo/trunk/modules/axis-builder/project.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis-builder/project.xml?view=diff&r1=160133&r2=160134
==============================================================================
--- geronimo/trunk/modules/axis-builder/project.xml (original)
+++ geronimo/trunk/modules/axis-builder/project.xml Mon Apr  4 23:20:16 2005
@@ -6,16 +6,16 @@
     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at
-  
+
        http://www.apache.org/licenses/LICENSE-2.0
-  
+
     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
 -->
-  
+
 <!-- $Rev: 46019 $ $Date: 2004-09-14 02:56:06 -0700 (Tue, 14 Sep 2004) $ -->
 
 <project>
@@ -231,9 +231,9 @@
         </dependency>
 
         <dependency>
-            <groupId>axis</groupId>
-            <artifactId>axis-wsdl4j</artifactId>
-            <version>${axis_wsdl4j_version}</version>
+            <groupId>wsdl4j</groupId>
+            <artifactId>wsdl4j</artifactId>
+            <version>${wsdl4j_version}</version>
         </dependency>
 
     </dependencies>

Modified: geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisBuilder.java?view=diff&r1=160133&r2=160134
==============================================================================
--- geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisBuilder.java (original)
+++ geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisBuilder.java Mon Apr  4 23:20:16 2005
@@ -233,9 +233,11 @@
         }
 
         Map exceptionMap = WSDescriptorParser.getExceptionMap(mapping);
-        Map schemaTypeKeyToSchemaTypeMap = WSDescriptorParser.buildSchemaTypeKeyToSchemaTypeMap(definition);
-        Map complexTypeMap = WSDescriptorParser.getComplexTypesInWsdl(schemaTypeKeyToSchemaTypeMap);
-        Map elementMap = WSDescriptorParser.getElementToTypeMap(schemaTypeKeyToSchemaTypeMap);
+        JarFile moduleFile = module.getModuleFile();
+        SchemaInfoBuilder schemaInfoBuilder = new SchemaInfoBuilder(moduleFile, definition);
+        Map schemaTypeKeyToSchemaTypeMap = schemaInfoBuilder.getSchemaTypeKeyToSchemaTypeMap();
+        Map complexTypeMap = schemaInfoBuilder.getComplexTypesInWsdl();
+        Map elementMap = schemaInfoBuilder.getElementToTypeMap();
 
         Map wsdlPortMap = service.getPorts();
         for (Iterator iterator = wsdlPortMap.entrySet().iterator(); iterator.hasNext();) {

Modified: geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisServiceBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisServiceBuilder.java?view=diff&r1=160133&r2=160134
==============================================================================
--- geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisServiceBuilder.java (original)
+++ geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisServiceBuilder.java Mon Apr  4 23:20:16 2005
@@ -148,9 +148,10 @@
         }
 
         Map exceptionMap = WSDescriptorParser.getExceptionMap(portInfo.getJavaWsdlMapping());
-        Map schemaTypeKeyToSchemaTypeMap = WSDescriptorParser.buildSchemaTypeKeyToSchemaTypeMap(portInfo.getDefinition());
-        Map complexTypeMap = WSDescriptorParser.getComplexTypesInWsdl(schemaTypeKeyToSchemaTypeMap);
-        Map elementMap = WSDescriptorParser.getElementToTypeMap(schemaTypeKeyToSchemaTypeMap);
+        SchemaInfoBuilder schemaInfoBuilder = new SchemaInfoBuilder(null, portInfo.getDefinition());
+        Map schemaTypeKeyToSchemaTypeMap = schemaInfoBuilder.getSchemaTypeKeyToSchemaTypeMap();
+        Map complexTypeMap = schemaInfoBuilder.getComplexTypesInWsdl();
+        Map elementMap = schemaInfoBuilder.getElementToTypeMap();
 
         JavaServiceDesc serviceDesc = new JavaServiceDesc();
 

Added: geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/SchemaInfoBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/SchemaInfoBuilder.java?view=auto&rev=160134
==============================================================================
--- geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/SchemaInfoBuilder.java (added)
+++ geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/SchemaInfoBuilder.java Mon Apr  4 23:20:16 2005
@@ -0,0 +1,415 @@
+/**
+ *
+ * Copyright 2003-2004 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.axis.builder;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Stack;
+import java.util.zip.ZipEntry;
+import java.util.jar.JarFile;
+import javax.wsdl.Definition;
+import javax.wsdl.Import;
+import javax.wsdl.Types;
+import javax.wsdl.extensions.UnknownExtensibilityElement;
+import javax.wsdl.extensions.schema.Schema;
+import javax.xml.namespace.QName;
+
+import org.apache.geronimo.common.DeploymentException;
+import org.apache.geronimo.schema.SchemaConversionUtils;
+import org.apache.xmlbeans.SchemaField;
+import org.apache.xmlbeans.SchemaGlobalElement;
+import org.apache.xmlbeans.SchemaParticle;
+import org.apache.xmlbeans.SchemaType;
+import org.apache.xmlbeans.SchemaTypeSystem;
+import org.apache.xmlbeans.XmlBeans;
+import org.apache.xmlbeans.XmlCursor;
+import org.apache.xmlbeans.XmlException;
+import org.apache.xmlbeans.XmlObject;
+import org.apache.xmlbeans.XmlOptions;
+import org.apache.xmlbeans.XmlError;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.w3c.dom.Element;
+import org.xml.sax.EntityResolver;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
+/**
+ * @version $Rev:  $ $Date:  $
+ */
+public class SchemaInfoBuilder {
+    private static final Log log = LogFactory.getLog(SchemaInfoBuilder.class);
+    private static final SchemaTypeSystem basicTypeSystem;
+
+    static {
+        URL url = WSDescriptorParser.class.getClassLoader().getResource("soap_encoding_1_1.xsd");
+        if (url == null) {
+            throw new RuntimeException("Could not locate soap encoding schema");
+        }
+        Collection errors = new ArrayList();
+        XmlOptions xmlOptions = new XmlOptions();
+        xmlOptions.setErrorListener(errors);
+        try {
+            XmlObject xmlObject = SchemaConversionUtils.parse(url);
+            basicTypeSystem = XmlBeans.compileXsd(new XmlObject[]{xmlObject}, XmlBeans.getBuiltinTypeSystem(), xmlOptions);
+            if (errors.size() > 0) {
+                throw new RuntimeException("Could not compile schema type system: errors: " + errors);
+            }
+        } catch (XmlException e) {
+            throw new RuntimeException("Could not compile schema type system", e);
+        } catch (IOException e) {
+            throw new RuntimeException("Could not compile schema type system", e);
+        }
+    }
+
+    private final JarFile moduleFile;
+    private final Stack uris = new Stack();
+    private final Map schemaTypeKeyToSchemaTypeMap;
+
+    public SchemaInfoBuilder(JarFile moduleFile, Definition definition) throws DeploymentException {
+        this.moduleFile = moduleFile;
+        try {
+            URI uri = new URI(definition.getDocumentBaseURI());
+            uris.push(uri);
+        } catch (URISyntaxException e) {
+            throw new DeploymentException("Could not locate definition", e);
+        }
+        SchemaTypeSystem schemaTypeSystem = compileSchemaTypeSystem(definition);
+        schemaTypeKeyToSchemaTypeMap = buildSchemaTypeKeyToSchemaTypeMap(schemaTypeSystem);
+    }
+
+    SchemaInfoBuilder(JarFile moduleFile, URI uri, SchemaTypeSystem schemaTypeSystem) {
+        this.moduleFile = moduleFile;
+        uris.push(uri);
+        schemaTypeKeyToSchemaTypeMap = buildSchemaTypeKeyToSchemaTypeMap(schemaTypeSystem);
+    }
+
+    public Map getSchemaTypeKeyToSchemaTypeMap() {
+        return schemaTypeKeyToSchemaTypeMap;
+    }
+
+    private static final String[] errorNames = {
+        "Error", "Warning", "Info"
+    };
+
+    public SchemaTypeSystem compileSchemaTypeSystem(Definition definition) throws DeploymentException {
+        List schemaList = new ArrayList();
+        addImportsFromDefinition(definition, schemaList);
+//        System.out.println("Schemas: " + schemaList);
+        Collection errors = new ArrayList();
+        XmlOptions xmlOptions = new XmlOptions();
+        xmlOptions.setErrorListener(errors);
+        xmlOptions.setEntityResolver(new JarEntityResolver());
+        XmlObject[] schemas = (XmlObject[]) schemaList.toArray(new XmlObject[schemaList.size()]);
+        try {
+            SchemaTypeSystem schemaTypeSystem = XmlBeans.compileXsd(schemas, basicTypeSystem, xmlOptions);
+            if (errors.size() > 0) {
+                boolean wasError = false;
+                for (Iterator iterator = errors.iterator(); iterator.hasNext();) {
+                    XmlError xmlError = (XmlError) iterator.next();
+                    log.info("Severity: " + errorNames[xmlError.getSeverity()] + ", message: " + xmlError);
+                    if (xmlError.getSeverity() == XmlError.SEVERITY_ERROR) {
+                        wasError = true;
+                    }
+                }
+                if (wasError) {
+                    throw new DeploymentException("Could not compile schema type system, see log for errors");
+                }
+            }
+            return schemaTypeSystem;
+        } catch (XmlException e) {
+            throw new DeploymentException("Could not compile schema type system", e);
+        }
+    }
+
+    private void addImportsFromDefinition(Definition definition, List schemaList) throws DeploymentException {
+        Map namespaceMap = definition.getNamespaces();
+        Types types = definition.getTypes();
+        if (types != null) {
+            List schemas = types.getExtensibilityElements();
+            for (Iterator iterator = schemas.iterator(); iterator.hasNext();) {
+                Object o = iterator.next();
+                if (o instanceof Schema) {
+                    Schema unknownExtensibilityElement = (Schema) o;
+                    QName elementType = unknownExtensibilityElement.getElementType();
+                    if (new QName("http://www.w3.org/2001/XMLSchema", "schema").equals(elementType)) {
+                        Element element = unknownExtensibilityElement.getElement();
+                        addSchemaElement(element, namespaceMap, schemaList);
+                    }
+                } else if (o instanceof UnknownExtensibilityElement) {
+                    //This is allegedly obsolete as of axis-wsdl4j-1.2-RC3.jar which includes the Schema extension above.
+                    //The change notes imply that imported schemas should end up in Schema elements.  They don't, so this is still needed.
+                    UnknownExtensibilityElement unknownExtensibilityElement = (UnknownExtensibilityElement) o;
+                    Element element = unknownExtensibilityElement.getElement();
+                    String elementNamespace = element.getNamespaceURI();
+                    String elementLocalName = element.getNodeName();
+                    if ("http://www.w3.org/2001/XMLSchema".equals(elementNamespace) && "schema".equals(elementLocalName)) {
+                        addSchemaElement(element, namespaceMap, schemaList);
+                    }
+                }
+            }
+        }
+        Map imports = definition.getImports();
+        if (imports != null) {
+            for (Iterator iterator = imports.entrySet().iterator(); iterator.hasNext();) {
+                Map.Entry entry = (Map.Entry) iterator.next();
+                String namespaceURI = (String) entry.getKey();
+                List importList = (List) entry.getValue();
+                for (Iterator iterator1 = importList.iterator(); iterator1.hasNext();) {
+                    Import anImport = (Import) iterator1.next();
+                    //according to the 1.1 jwsdl mr shcema imports are supposed to show up here,
+                    //but according to the 1.0 spec there is supposed to be no Definition.
+                    Definition definition1 = anImport.getDefinition();
+                    if (definition1 != null) {
+                        try {
+                            URI uri = new URI(definition1.getDocumentBaseURI());
+                            uris.push(uri);
+                        } catch (URISyntaxException e) {
+                            throw new DeploymentException("Could not locate definition", e);
+                        }
+                        try {
+                            addImportsFromDefinition(definition1, schemaList);
+                        } finally {
+                            uris.pop();
+                        }
+                    } else {
+                        log.warn("Missing definition in import for namespace " + namespaceURI);
+                    }
+                }
+            }
+        }
+    }
+
+    private void addSchemaElement(Element element, Map namespaceMap, List schemaList) throws DeploymentException {
+        try {
+            XmlObject xmlObject = SchemaConversionUtils.parse(element);
+            XmlCursor cursor = xmlObject.newCursor();
+            try {
+                cursor.toFirstContentToken();
+                for (Iterator namespaces = namespaceMap.entrySet().iterator(); namespaces.hasNext();) {
+                    Map.Entry entry = (Map.Entry) namespaces.next();
+                    cursor.insertNamespace((String) entry.getKey(), (String) entry.getValue());
+                }
+            } finally {
+                cursor.dispose();
+            }
+            schemaList.add(xmlObject);
+        } catch (XmlException e) {
+            throw new DeploymentException("Could not parse schema element", e);
+        }
+    }
+
+    /**
+     * builds a map of SchemaTypeKey containing jaxrpc-style fake QName and context info to xmlbeans SchemaType object.
+     *
+     * @param schemaTypeSystem
+     * @return
+     */
+    public Map buildSchemaTypeKeyToSchemaTypeMap(SchemaTypeSystem schemaTypeSystem) {
+        Map qnameMap = new HashMap();
+        SchemaType[] globalTypes = schemaTypeSystem.globalTypes();
+        for (int i = 0; i < globalTypes.length; i++) {
+            SchemaType globalType = globalTypes[i];
+            QName typeQName = globalType.getName();
+            addSchemaType(typeQName, globalType, false, qnameMap);
+        }
+        SchemaGlobalElement[] globalElements = schemaTypeSystem.globalElements();
+        for (int i = 0; i < globalElements.length; i++) {
+            SchemaGlobalElement globalElement = globalElements[i];
+            addElement(globalElement, null, qnameMap);
+        }
+        return qnameMap;
+    }
+
+    private void addElement(SchemaField element, SchemaTypeKey key, Map qnameMap) {
+        //TODO is this null if element is a ref?
+        QName elementName = element.getName();
+        String elementNamespace = elementName.getNamespaceURI();
+        if (elementNamespace == null || elementNamespace.equals("")) {
+            elementNamespace = key.getqName().getNamespaceURI();
+        }
+        String elementQNameLocalName;
+        SchemaTypeKey elementKey = null;
+        if (key == null) {
+            //top level. rule 2.a,
+            elementQNameLocalName = elementName.getLocalPart();
+            elementKey = new SchemaTypeKey(elementName, true, false, false);
+        } else {
+            //not top level. rule 2.b, key will be for enclosing Type.
+            QName enclosingTypeQName = key.getqName();
+            String enclosingTypeLocalName = enclosingTypeQName.getLocalPart();
+            elementQNameLocalName = enclosingTypeLocalName + ">" + elementName.getLocalPart();
+            QName subElementName = new QName(elementNamespace, elementQNameLocalName);
+            elementKey = new SchemaTypeKey(subElementName, true, false, true);
+        }
+        SchemaType schemaType = element.getType();
+        qnameMap.put(elementKey, schemaType);
+//        new Exception("Adding: " + elementKey.getqName().getLocalPart()).printStackTrace();
+        //check if it's an array. maxOccurs is null if unbounded
+        //element should always be a SchemaParticle... this is a workaround for XMLBEANS-137
+        if (element instanceof SchemaParticle) {
+            addArrayForms((SchemaParticle) element, elementKey.getqName(), qnameMap, schemaType);
+        } else {
+            log.warn("element is not a schemaParticle! " + element);
+        }
+        //now, name for type.  Rule 1.b, type inside an element
+        String typeQNameLocalPart = ">" + elementQNameLocalName;
+        QName typeQName = new QName(elementNamespace, typeQNameLocalPart);
+        boolean isAnonymous = true;
+        addSchemaType(typeQName, schemaType, isAnonymous, qnameMap);
+    }
+
+    private void addSchemaType(QName typeQName, SchemaType schemaType, boolean anonymous, Map qnameMap) {
+        SchemaTypeKey typeKey = new SchemaTypeKey(typeQName, false, schemaType.isSimpleType(), anonymous);
+        qnameMap.put(typeKey, schemaType);
+//        new Exception("Adding: " + typeKey.getqName().getLocalPart()).printStackTrace();
+        //TODO xmlbeans recommends using summary info from getElementProperties and getAttributeProperties instead of traversing the content model by hand.
+        SchemaParticle schemaParticle = schemaType.getContentModel();
+        if (schemaParticle != null) {
+            addSchemaParticle(schemaParticle, typeKey, qnameMap);
+        }
+    }
+
+
+    private void addSchemaParticle(SchemaParticle schemaParticle, SchemaTypeKey key, Map qnameMap) {
+        if (schemaParticle.getParticleType() == SchemaParticle.ELEMENT) {
+            SchemaType elementType = schemaParticle.getType();
+            SchemaField element = elementType.getContainerField();
+            //element will be null if the type is defined elsewhere, such as a built in type.
+            if (element != null) {
+                addElement(element, key, qnameMap);
+            } else {
+                QName keyQName = key.getqName();
+                //TODO I can't distinguish between 3.a and 3.b, so generate names both ways.
+                //3.b
+                String localPart = schemaParticle.getName().getLocalPart();
+                QName elementName = new QName(keyQName.getNamespaceURI(), localPart);
+                addArrayForms(schemaParticle, elementName, qnameMap, elementType);
+                //3.a
+                localPart = keyQName.getLocalPart() + ">" + schemaParticle.getName().getLocalPart();
+                elementName = new QName(keyQName.getNamespaceURI(), localPart);
+                addArrayForms(schemaParticle, elementName, qnameMap, elementType);
+            }
+        } else {
+            SchemaParticle[] children = schemaParticle.getParticleChildren();
+            for (int i = 0; i < children.length; i++) {
+                SchemaParticle child = children[i];
+                addSchemaParticle(child, key, qnameMap);
+            }
+        }
+    }
+
+    private void addArrayForms(SchemaParticle schemaParticle, QName keyName, Map qnameMap, SchemaType elementType) {
+        //it may be a ref or a built in type.  If it's an array (maxOccurs >1) form a type for it.
+        if (schemaParticle.getIntMaxOccurs() > 1) {
+            String maxOccurs = schemaParticle.getMaxOccurs() == null ? "unbounded" : "" + schemaParticle.getIntMaxOccurs();
+            int minOccurs = schemaParticle.getIntMinOccurs();
+            QName elementName = schemaParticle.getName();
+            String arrayQNameLocalName = keyName.getLocalPart() + "[" + minOccurs + "," + maxOccurs + "]";
+            String elementNamespace = elementName.getNamespaceURI();
+            if (elementNamespace == null || elementNamespace.equals("")) {
+                elementNamespace = keyName.getNamespaceURI();
+            }
+            QName arrayName = new QName(elementNamespace, arrayQNameLocalName);
+            SchemaTypeKey arrayKey = new SchemaTypeKey(arrayName, false, false, true);
+            //TODO not clear we want the schemaType as the value
+            qnameMap.put(arrayKey, elementType);
+//            new Exception("Adding: " + arrayKey.getqName().getLocalPart()).printStackTrace();
+            if (minOccurs == 1) {
+                arrayQNameLocalName = keyName.getLocalPart() + "[," + maxOccurs + "]";
+                arrayName = new QName(elementNamespace, arrayQNameLocalName);
+                arrayKey = new SchemaTypeKey(arrayName, false, false, true);
+                //TODO not clear we want the schemaType as the value
+                qnameMap.put(arrayKey, elementType);
+            }
+        }
+    }
+
+    /**
+     * Find all the complex types in the previously constructed schema analysis.
+     * Put them in a map from complex type QName to schema fragment.
+     *
+     * @return
+     */
+    public Map getComplexTypesInWsdl() {
+        Map complexTypeMap = new HashMap();
+        for (Iterator iterator = schemaTypeKeyToSchemaTypeMap.entrySet().iterator(); iterator.hasNext();) {
+            Map.Entry entry = (Map.Entry) iterator.next();
+            SchemaTypeKey key = (SchemaTypeKey) entry.getKey();
+            if (!key.isSimpleType() && !key.isAnonymous()) {
+                QName qName = key.getqName();
+                SchemaType schemaType = (SchemaType) entry.getValue();
+                complexTypeMap.put(qName, schemaType);
+            }
+        }
+        return complexTypeMap;
+    }
+
+    public Map getElementToTypeMap() {
+        Map elementToTypeMap = new HashMap();
+        for (Iterator iterator = schemaTypeKeyToSchemaTypeMap.entrySet().iterator(); iterator.hasNext();) {
+            Map.Entry entry = (Map.Entry) iterator.next();
+            SchemaTypeKey key = (SchemaTypeKey) entry.getKey();
+            if (key.isElement()) {
+                QName elementQName = key.getqName();
+                SchemaType schemaType = (SchemaType) entry.getValue();
+                QName typeQName = schemaType.getName();
+                elementToTypeMap.put(elementQName, typeQName);
+            }
+        }
+        return elementToTypeMap;
+    }
+
+    private class JarEntityResolver implements EntityResolver {
+
+        private final static String PROJECT_URL_PREFIX = "project://local/";
+        public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
+            //seems like this must be a bug in xmlbeans...
+            if (systemId.indexOf(PROJECT_URL_PREFIX) > -1) {
+                systemId = systemId.substring(PROJECT_URL_PREFIX.length());
+            }
+            URI location = ((URI) uris.peek()).resolve(systemId);
+//            System.out.println("SystemId: " + systemId + ", location: " + location);
+            InputStream wsdlInputStream = null;
+            try {
+                ZipEntry entry = moduleFile.getEntry(location.toString());
+                System.out.println("entry: " + entry.getName());
+                wsdlInputStream = moduleFile.getInputStream(entry);
+//                byte[] buf = new byte[1024];
+//                int i;
+//                while ((i = wsdlInputStream.read(buf)) > 0 ) {
+//                    System.out.write(buf, 0, i);
+//                }
+//                wsdlInputStream.close();
+//                wsdlInputStream = moduleFile.getInputStream(entry);
+            } catch (IOException e) {
+                throw new RuntimeException("Could not open stream to wsdl file", e);
+            }
+            return new InputSource(wsdlInputStream);
+        }
+    }
+
+}

Modified: geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/WSDescriptorParser.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/WSDescriptorParser.java?view=diff&r1=160133&r2=160134
==============================================================================
--- geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/WSDescriptorParser.java (original)
+++ geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/WSDescriptorParser.java Mon Apr  4 23:20:16 2005
@@ -25,7 +25,6 @@
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.net.URL;
-import java.util.ArrayList;
 import java.util.Calendar;
 import java.util.Collection;
 import java.util.HashMap;
@@ -34,15 +33,11 @@
 import java.util.Map;
 import java.util.jar.JarFile;
 import javax.wsdl.Definition;
-import javax.wsdl.Import;
 import javax.wsdl.Operation;
 import javax.wsdl.Port;
 import javax.wsdl.Service;
-import javax.wsdl.Types;
 import javax.wsdl.WSDLException;
 import javax.wsdl.extensions.ExtensibilityElement;
-import javax.wsdl.extensions.UnknownExtensibilityElement;
-import javax.wsdl.extensions.schema.Schema;
 import javax.wsdl.extensions.soap.SOAPAddress;
 import javax.wsdl.factory.WSDLFactory;
 import javax.wsdl.xml.WSDLLocator;
@@ -86,17 +81,7 @@
 import org.apache.geronimo.xbeans.j2ee.WebserviceDescriptionType;
 import org.apache.geronimo.xbeans.j2ee.WebservicesDocument;
 import org.apache.geronimo.xbeans.j2ee.WebservicesType;
-import org.apache.xmlbeans.SchemaField;
-import org.apache.xmlbeans.SchemaGlobalElement;
-import org.apache.xmlbeans.SchemaParticle;
-import org.apache.xmlbeans.SchemaType;
-import org.apache.xmlbeans.SchemaTypeSystem;
-import org.apache.xmlbeans.XmlBeans;
-import org.apache.xmlbeans.XmlCursor;
 import org.apache.xmlbeans.XmlException;
-import org.apache.xmlbeans.XmlObject;
-import org.apache.xmlbeans.XmlOptions;
-import org.w3c.dom.Element;
 import org.xml.sax.InputSource;
 
 /**
@@ -104,28 +89,6 @@
  */
 public class WSDescriptorParser {
 
-    private static SchemaTypeSystem basicTypeSystem;
-
-    static {
-        URL url = WSDescriptorParser.class.getClassLoader().getResource("soap_encoding_1_1.xsd");
-        if (url == null) {
-            throw new RuntimeException("Could not locate soap encoding schema");
-        }
-        Collection errors = new ArrayList();
-        XmlOptions xmlOptions = new XmlOptions();
-        xmlOptions.setErrorListener(errors);
-        try {
-            XmlObject xmlObject = SchemaConversionUtils.parse(url);
-            basicTypeSystem = XmlBeans.compileXsd(new XmlObject[]{xmlObject}, XmlBeans.getBuiltinTypeSystem(), xmlOptions);
-            if (errors.size() > 0) {
-                throw new RuntimeException("Could not compile schema type system: errors: " + errors);
-            }
-        } catch (XmlException e) {
-            throw new RuntimeException("Could not compile schema type system", e);
-        } catch (IOException e) {
-            throw new RuntimeException("Could not compile schema type system", e);
-        }
-    }
 
     public static Map parseWebServiceDescriptor(URL wsDDUrl, JarFile moduleFile, boolean isEJB) throws DeploymentException {
         try {
@@ -284,257 +247,6 @@
         return definition;
     }
 
-    public static Map buildSchemaTypeKeyToSchemaTypeMap(Definition definition) throws DeploymentException {
-        SchemaTypeSystem schemaTypeSystem = compileSchemaTypeSystem(definition);
-        return buildSchemaTypeKeyToSchemaTypeMap(schemaTypeSystem);
-    }
-
-    public static SchemaTypeSystem compileSchemaTypeSystem(Definition definition) throws DeploymentException {
-        List schemaList = new ArrayList();
-        Map namespaceMap = definition.getNamespaces();
-        addImportsFromDefinition(definition, namespaceMap, schemaList);
-        Collection errors = new ArrayList();
-        XmlOptions xmlOptions = new XmlOptions();
-        xmlOptions.setErrorListener(errors);
-        XmlObject[] schemas = (XmlObject[]) schemaList.toArray(new XmlObject[schemaList.size()]);
-        try {
-            SchemaTypeSystem schemaTypeSystem = XmlBeans.compileXsd(schemas, basicTypeSystem, xmlOptions);
-            if (errors.size() > 0) {
-                throw new DeploymentException("Could not compile schema type system: errors: " + errors);
-            }
-            return schemaTypeSystem;
-        } catch (XmlException e) {
-            throw new DeploymentException("Could not compile schema type system", e);
-        }
-    }
-
-    private static void addImportsFromDefinition(Definition definition, Map namespaceMap, List schemaList) throws DeploymentException {
-        Types types = definition.getTypes();
-        if (types != null) {
-            List schemas = types.getExtensibilityElements();
-            for (Iterator iterator = schemas.iterator(); iterator.hasNext();) {
-                Object o = iterator.next();
-                if (o instanceof Schema) {
-                    Schema unknownExtensibilityElement = (Schema) o;
-                    QName elementType = unknownExtensibilityElement.getElementType();
-                    if (new QName("http://www.w3.org/2001/XMLSchema", "schema").equals(elementType)) {
-                        Element element = unknownExtensibilityElement.getElement();
-                        addSchemaElement(element, namespaceMap, schemaList);
-                    }
-                } else if (o instanceof UnknownExtensibilityElement) {
-                    //This is allegedly obsolete as of axis-wsdl4j-1.2-RC3.jar which includes the Schema extension above.
-                    //The change notes imply that imported schemas should end up in Schema elements.  They don't, so this is still needed.
-                    UnknownExtensibilityElement unknownExtensibilityElement = (UnknownExtensibilityElement) o;
-                    Element element = unknownExtensibilityElement.getElement();
-                    String elementNamespace = element.getNamespaceURI();
-                    String elementLocalName = element.getNodeName();
-                    if ("http://www.w3.org/2001/XMLSchema".equals(elementNamespace) && "schema".equals(elementLocalName)) {
-                        addSchemaElement(element, namespaceMap, schemaList);
-                    }
-                }
-            }
-        }
-        Map imports = definition.getImports();
-        if (imports != null) {
-            for (Iterator iterator = imports.entrySet().iterator(); iterator.hasNext();) {
-                Map.Entry entry = (Map.Entry) iterator.next();
-                String namespaceURI = (String) entry.getKey();
-                List importList = (List) entry.getValue();
-                for (Iterator iterator1 = importList.iterator(); iterator1.hasNext();) {
-                    Import anImport = (Import) iterator1.next();
-                    //according to the 1.1 jwsdl mr shcema imports are supposed to show up here,
-                    //but according to the 1.0 spec there is supposed to be no Definition.
-                    Definition definition1 = anImport.getDefinition();
-                    if (definition1 != null) {
-                        addImportsFromDefinition(definition1, namespaceMap, schemaList);
-                    } else {
-                        System.out.println("Missing definition in import for namespace " + namespaceURI);
-                    }
-                }
-            }
-        }
-    }
-
-    private static void addSchemaElement(Element element, Map namespaceMap, List schemaList) throws DeploymentException {
-        try {
-            XmlObject xmlObject = SchemaConversionUtils.parse(element);
-            XmlCursor cursor = xmlObject.newCursor();
-            try {
-                cursor.toFirstContentToken();
-                for (Iterator namespaces = namespaceMap.entrySet().iterator(); namespaces.hasNext();) {
-                    Map.Entry entry = (Map.Entry) namespaces.next();
-                    cursor.insertNamespace((String) entry.getKey(), (String) entry.getValue());
-                }
-            } finally {
-                cursor.dispose();
-            }
-            schemaList.add(xmlObject);
-        } catch (XmlException e) {
-            throw new DeploymentException("Could not parse schema element", e);
-        }
-    }
-
-    /**
-     * builds a map of SchemaTypeKey containing jaxrpc-style fake QName and context info to xmlbeans SchemaType object.
-     *
-     * @param schemaTypeSystem
-     * @return
-     */
-    public static Map buildSchemaTypeKeyToSchemaTypeMap(SchemaTypeSystem schemaTypeSystem) {
-        Map qnameMap = new HashMap();
-        SchemaType[] globalTypes = schemaTypeSystem.globalTypes();
-        for (int i = 0; i < globalTypes.length; i++) {
-            SchemaType globalType = globalTypes[i];
-            QName typeQName = globalType.getName();
-            addSchemaType(typeQName, globalType, false, qnameMap);
-        }
-        SchemaGlobalElement[] globalElements = schemaTypeSystem.globalElements();
-        for (int i = 0; i < globalElements.length; i++) {
-            SchemaGlobalElement globalElement = globalElements[i];
-            addElement(globalElement, null, qnameMap);
-        }
-        return qnameMap;
-    }
-
-    private static void addElement(SchemaField element, SchemaTypeKey key, Map qnameMap) {
-        //TODO is this null if element is a ref?
-        QName elementName = element.getName();
-        String elementNamespace = elementName.getNamespaceURI();
-        if (elementNamespace == null || elementNamespace.equals("")) {
-            elementNamespace = key.getqName().getNamespaceURI();
-        }
-        String elementQNameLocalName;
-        SchemaTypeKey elementKey = null;
-        if (key == null) {
-            //top level. rule 2.a,
-            elementQNameLocalName = elementName.getLocalPart();
-            elementKey = new SchemaTypeKey(elementName, true, false, false);
-        } else {
-            //not top level. rule 2.b, key will be for enclosing Type.
-            QName enclosingTypeQName = key.getqName();
-            String enclosingTypeLocalName = enclosingTypeQName.getLocalPart();
-            elementQNameLocalName = enclosingTypeLocalName + ">" + elementName.getLocalPart();
-            QName subElementName = new QName(elementNamespace, elementQNameLocalName);
-            elementKey = new SchemaTypeKey(subElementName, true, false, true);
-        }
-        SchemaType schemaType = element.getType();
-        qnameMap.put(elementKey, schemaType);
-//        new Exception("Adding: " + elementKey.getqName().getLocalPart()).printStackTrace();
-        //check if it's an array. maxOccurs is null if unbounded
-        //element should always be a SchemaParticle... this is a workaround for XMLBEANS-137
-        if (element instanceof SchemaParticle) {
-            addArrayForms((SchemaParticle) element, elementKey.getqName(), qnameMap, schemaType);
-        } else {
-            System.out.println("element is not a schemaParticle! " + element);
-        }
-        //now, name for type.  Rule 1.b, type inside an element
-        String typeQNameLocalPart = ">" + elementQNameLocalName;
-        QName typeQName = new QName(elementNamespace, typeQNameLocalPart);
-        boolean isAnonymous = true;
-        addSchemaType(typeQName, schemaType, isAnonymous, qnameMap);
-    }
-
-    private static void addSchemaType(QName typeQName, SchemaType schemaType, boolean anonymous, Map qnameMap) {
-        SchemaTypeKey typeKey = new SchemaTypeKey(typeQName, false, schemaType.isSimpleType(), anonymous);
-        qnameMap.put(typeKey, schemaType);
-//        new Exception("Adding: " + typeKey.getqName().getLocalPart()).printStackTrace();
-        //TODO xmlbeans recommends using summary info from getElementProperties and getAttributeProperties instead of traversing the content model by hand.
-        SchemaParticle schemaParticle = schemaType.getContentModel();
-        if (schemaParticle != null) {
-            addSchemaParticle(schemaParticle, typeKey, qnameMap);
-        }
-    }
-
-
-    private static void addSchemaParticle(SchemaParticle schemaParticle, SchemaTypeKey key, Map qnameMap) {
-        if (schemaParticle.getParticleType() == SchemaParticle.ELEMENT) {
-            SchemaType elementType = schemaParticle.getType();
-            SchemaField element = elementType.getContainerField();
-            //element will be null if the type is defined elsewhere, such as a built in type.
-            if (element != null) {
-                addElement(element, key, qnameMap);
-            } else {
-                QName keyQName = key.getqName();
-                //TODO I can't distinguish between 3.a and 3.b, so generate names both ways.
-                //3.b
-                String localPart = schemaParticle.getName().getLocalPart();
-                QName elementName = new QName(keyQName.getNamespaceURI(), localPart);
-                addArrayForms(schemaParticle, elementName, qnameMap, elementType);
-                //3.a
-                localPart = keyQName.getLocalPart() + ">" + schemaParticle.getName().getLocalPart();
-                elementName = new QName(keyQName.getNamespaceURI(), localPart);
-                addArrayForms(schemaParticle, elementName, qnameMap, elementType);
-            }
-        } else {
-            SchemaParticle[] children = schemaParticle.getParticleChildren();
-            for (int i = 0; i < children.length; i++) {
-                SchemaParticle child = children[i];
-                addSchemaParticle(child, key, qnameMap);
-            }
-        }
-    }
-
-    private static void addArrayForms(SchemaParticle schemaParticle, QName keyName, Map qnameMap, SchemaType elementType) {
-        //it may be a ref or a built in type.  If it's an array (maxOccurs >1) form a type for it.
-        if (schemaParticle.getIntMaxOccurs() > 1) {
-            String maxOccurs = schemaParticle.getMaxOccurs() == null ? "unbounded" : "" + schemaParticle.getIntMaxOccurs();
-            int minOccurs = schemaParticle.getIntMinOccurs();
-            QName elementName = schemaParticle.getName();
-            String arrayQNameLocalName = keyName.getLocalPart() + "[" + minOccurs + "," + maxOccurs + "]";
-            String elementNamespace = elementName.getNamespaceURI();
-            if (elementNamespace == null || elementNamespace.equals("")) {
-                elementNamespace = keyName.getNamespaceURI();
-            }
-            QName arrayName = new QName(elementNamespace, arrayQNameLocalName);
-            SchemaTypeKey arrayKey = new SchemaTypeKey(arrayName, false, false, true);
-            //TODO not clear we want the schemaType as the value
-            qnameMap.put(arrayKey, elementType);
-//            new Exception("Adding: " + arrayKey.getqName().getLocalPart()).printStackTrace();
-            if (minOccurs == 1) {
-                arrayQNameLocalName = keyName.getLocalPart() + "[," + maxOccurs + "]";
-                arrayName = new QName(elementNamespace, arrayQNameLocalName);
-                arrayKey = new SchemaTypeKey(arrayName, false, false, true);
-                //TODO not clear we want the schemaType as the value
-                qnameMap.put(arrayKey, elementType);
-            }
-        }
-    }
-
-    /**
-     * Find all the complex types in the previously constructed schema analysis.
-     * Put them in a map from complex type QName to schema fragment.
-     *
-     * @param schemaTypeKeyToSchemaTypeMap
-     * @return
-     */
-    public static Map getComplexTypesInWsdl(Map schemaTypeKeyToSchemaTypeMap) {
-        Map complexTypeMap = new HashMap();
-        for (Iterator iterator = schemaTypeKeyToSchemaTypeMap.entrySet().iterator(); iterator.hasNext();) {
-            Map.Entry entry = (Map.Entry) iterator.next();
-            SchemaTypeKey key = (SchemaTypeKey) entry.getKey();
-            if (!key.isSimpleType() && !key.isAnonymous()) {
-                QName qName = key.getqName();
-                SchemaType schemaType = (SchemaType) entry.getValue();
-                complexTypeMap.put(qName, schemaType);
-            }
-        }
-        return complexTypeMap;
-    }
-
-    public static Map getElementToTypeMap(Map schemaTypeKeyToSchemaTypeMap) {
-        Map elementToTypeMap = new HashMap();
-        for (Iterator iterator = schemaTypeKeyToSchemaTypeMap.entrySet().iterator(); iterator.hasNext();) {
-            Map.Entry entry = (Map.Entry) iterator.next();
-            SchemaTypeKey key = (SchemaTypeKey) entry.getKey();
-            if (key.isElement()) {
-                QName elementQName = key.getqName();
-                SchemaType schemaType = (SchemaType) entry.getValue();
-                QName typeQName = schemaType.getName();
-                elementToTypeMap.put(elementQName, typeQName);
-            }
-        }
-        return elementToTypeMap;
-    }
 
     public static Map getExceptionMap(JavaWsdlMappingType mapping) {
         Map exceptionMap = new HashMap();
@@ -760,7 +472,9 @@
             } catch (IOException e) {
                 throw new RuntimeException("Could not open stream to import file", e);
             }
-            return new InputSource(importInputStream);
+            InputSource inputSource = new InputSource(importInputStream);
+            inputSource.setSystemId(getLatestImportURI());
+            return inputSource;
         }
 
         public String getLatestImportURI() {

Modified: geronimo/trunk/modules/axis-builder/src/test/org/apache/geronimo/axis/builder/ParsingTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis-builder/src/test/org/apache/geronimo/axis/builder/ParsingTest.java?view=diff&r1=160133&r2=160134
==============================================================================
--- geronimo/trunk/modules/axis-builder/src/test/org/apache/geronimo/axis/builder/ParsingTest.java (original)
+++ geronimo/trunk/modules/axis-builder/src/test/org/apache/geronimo/axis/builder/ParsingTest.java Mon Apr  4 23:20:16 2005
@@ -38,6 +38,7 @@
  */
 public class ParsingTest extends TestCase {
     private static final File basedir = new File(System.getProperty("basedir", System.getProperty("user.dir")));
+    private SchemaInfoBuilder schemaInfoBuilder;
 
     public void testSchema1() throws Exception {
         File schema1 = new File(basedir, "src/test-resources/schema/schema1.xsd");
@@ -76,7 +77,8 @@
         } catch (XmlException e) {
             throw new DeploymentException("Could not compile schema type system", e);
         }
-        Map map = WSDescriptorParser.buildSchemaTypeKeyToSchemaTypeMap(schemaTypeSystem);
+        schemaInfoBuilder = new SchemaInfoBuilder(null, null, schemaTypeSystem);
+        Map map = schemaInfoBuilder.getSchemaTypeKeyToSchemaTypeMap();
         for (Iterator iterator = map.entrySet().iterator(); iterator.hasNext();) {
             Map.Entry entry = (Map.Entry) iterator.next();
             System.out.println(entry.getKey() + " --> " + entry.getValue());
@@ -89,7 +91,7 @@
         System.out.println("SCHEMA 4");
         Map map = parse(schema1);
         assertEquals(3, map.size());
-        Map elements = WSDescriptorParser.getElementToTypeMap(map);
+        Map elements = schemaInfoBuilder.getElementToTypeMap();
         System.out.println("ELEMENT MAP");
         System.out.println(elements);
         assertEquals(1, elements.size());

Modified: geronimo/trunk/modules/axis-builder/src/test/org/apache/geronimo/axis/builder/ServiceReferenceTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis-builder/src/test/org/apache/geronimo/axis/builder/ServiceReferenceTest.java?view=diff&r1=160133&r2=160134
==============================================================================
--- geronimo/trunk/modules/axis-builder/src/test/org/apache/geronimo/axis/builder/ServiceReferenceTest.java (original)
+++ geronimo/trunk/modules/axis-builder/src/test/org/apache/geronimo/axis/builder/ServiceReferenceTest.java Mon Apr  4 23:20:16 2005
@@ -251,8 +251,8 @@
         WSDLFactory factory = WSDLFactory.newInstance();
         WSDLReader reader = factory.newWSDLReader();
         Definition definition = reader.readWSDL(wsdlFile.toURI().toString());
-        Map schemaTypeKeyToSchemaTypeMap = WSDescriptorParser.buildSchemaTypeKeyToSchemaTypeMap(definition);
-        Map complexTypeMap = WSDescriptorParser.getComplexTypesInWsdl(schemaTypeKeyToSchemaTypeMap);
+        SchemaInfoBuilder schemaInfoBuilder = new SchemaInfoBuilder(null, definition);
+        Map complexTypeMap = schemaInfoBuilder.getComplexTypesInWsdl();
         assertEquals(7, complexTypeMap.size());
     }
 
@@ -274,6 +274,7 @@
     private Definition buildDefinition() throws WSDLException {
         WSDLFactory factory = WSDLFactory.newInstance();
         Definition definition = factory.newDefinition();
+        definition.setDocumentBaseURI("META-INF/wsdl/fake.wsdl");
         ExtensionRegistry extensionRegistry = factory.newPopulatedExtensionRegistry();
         BindingOperation bindingOperation = buildBindingOperation(definition, extensionRegistry);
         Binding binding = definition.createBinding();

Modified: geronimo/trunk/modules/axis/src/etc/META-INF/geronimo-service.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis/src/etc/META-INF/geronimo-service.xml?view=diff&r1=160133&r2=160134
==============================================================================
--- geronimo/trunk/modules/axis/src/etc/META-INF/geronimo-service.xml (original)
+++ geronimo/trunk/modules/axis/src/etc/META-INF/geronimo-service.xml Mon Apr  4 23:20:16 2005
@@ -31,13 +31,13 @@
         <uri>axis/jars/axis-saaj-${axis_saaj_version}.jar</uri>
     </dependency-->
     <dependency>
-        <uri>axis/jars/axis-wsdl4j-${axis_wsdl4j_version}.jar</uri>
+        <uri>wsdl4j/jars/wsdl4j-${wsdl4j_version}.jar</uri>
     </dependency>
     <dependency>
         <uri>axis/jars/commons-discovery-${axis_commons_discovery_version}.jar</uri>
     </dependency>
-    <dependency>
-        <uri>ews/jars/ews-${ews_version}.jar</uri>
-    </dependency>
+<!--    <dependency>-->
+<!--        <uri>ews/jars/ews-${ews_version}.jar</uri>-->
+<!--    </dependency>-->
 
 </service>

Modified: geronimo/trunk/modules/jetty-builder/project.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty-builder/project.xml?view=diff&r1=160133&r2=160134
==============================================================================
--- geronimo/trunk/modules/jetty-builder/project.xml (original)
+++ geronimo/trunk/modules/jetty-builder/project.xml Mon Apr  4 23:20:16 2005
@@ -6,16 +6,16 @@
     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at
-  
+
        http://www.apache.org/licenses/LICENSE-2.0
-  
+
     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
 -->
-  
+
 <!-- $Rev$ $Date$ -->
 
 <project>
@@ -93,19 +93,19 @@
                 <xmlbeans>true</xmlbeans>
             </properties>
         </dependency>
-        
+
        <dependency>
             <groupId>geronimo</groupId>
             <artifactId>geronimo-jetty</artifactId>
-            <version>${pom.currentVersion}</version>           
+            <version>${pom.currentVersion}</version>
         </dependency>
-        
+
        <dependency>
             <groupId>geronimo</groupId>
             <artifactId>geronimo-j2ee</artifactId>
-            <version>${pom.currentVersion}</version>           
+            <version>${pom.currentVersion}</version>
         </dependency>
-        
+
         <dependency>
             <groupId>geronimo</groupId>
             <artifactId>geronimo-j2ee-builder</artifactId>
@@ -315,9 +315,9 @@
         </dependency>
 
         <dependency>
-            <groupId>axis</groupId>
-            <artifactId>axis-wsdl4j</artifactId>
-            <version>${axis_wsdl4j_version}</version>
+            <groupId>wsdl4j</groupId>
+            <artifactId>wsdl4j</artifactId>
+            <version>${wsdl4j_version}</version>
         </dependency>
 
     </dependencies>



Mime
View raw message