You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by aj...@apache.org on 2006/04/25 13:38:13 UTC

svn commit: r396850 - in /webservices/axis2/trunk/java/modules: codegen/src/org/apache/axis2/wsdl/codegen/emitter/ codegen/src/org/apache/axis2/wsdl/codegen/writer/ core/src/org/apache/axis2/deployment/resolver/ core/src/org/apache/axis2/description/ c...

Author: ajith
Date: Tue Apr 25 04:38:05 2006
New Revision: 396850

URL: http://svn.apache.org/viewcvs?rev=396850&view=rev
Log:
1. Adding support for relative schema imports in the included WSDLs. Now the Schemas are renamed and the inlcuded schemas are correctly referred through relative references
2. Added codegen support to serialize the schemas and WSDL into the resources directory while generating server side code
3. Updated some of the project references to include the necessary dependancies to the Java2WSDL module (introduced by the change in (1))

Added:
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/writer/SchemaWriter.java
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/writer/WSDLWriter.java
Modified:
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/resolver/AARFileBasedURIResolver.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService2OM.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/HTTPWorker.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/ListingAgent.java
    webservices/axis2/trunk/java/modules/jibx/project.xml
    webservices/axis2/trunk/java/modules/security/project.xml
    webservices/axis2/trunk/java/modules/xmlbeans/project.xml
    webservices/axis2/trunk/java/modules/xmlbeans/test/org/apache/axis2/xmlbeans/WSDL2JavaTest.java

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java?rev=396850&r1=396849&r2=396850&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java Tue Apr 25 04:38:05 2006
@@ -20,6 +20,9 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.ws.policy.Policy;
+import org.apache.ws.commons.schema.XmlSchema;
+import org.apache.ws.commons.schema.XmlSchemaObjectCollection;
+import org.apache.ws.commons.schema.XmlSchemaExternal;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
@@ -697,6 +700,47 @@
 
         //write the ant build
         writeAntBuild();
+
+        //for the server side codegen
+        //we need to seriali
+        writeWSDLFiles();
+    }
+
+    /**
+     * Write out the WSDL files (and the schemas)
+     * writing the WSDL (and schemas) is somewhat special so we cannot follow
+     * the usual pattern of using the class writer
+     */
+    private void writeWSDLFiles() {
+        //first modify the schema names (and locations) so that
+        //they have unique (flattened) names and the schema locations
+        //are adjusted to suit it
+        axisService.setCustomSchemaNamePrefix("");//prefix with nothing
+        axisService.setCustomSchemaNameSuffix(".xsd");//suffix with .xsd - the file name extension
+        //force the mappings to be reconstructed
+        axisService.setSchemaLocationsAdjusted(false);
+        axisService.populateSchemaMappings();
+
+        //now get the schema list and write it out
+        SchemaWriter schemaWriter = new SchemaWriter(
+                codeGenConfiguration.getOutputLocation());
+        Hashtable schemaMappings = axisService.getSchemaMappingTable();
+        Iterator keys = schemaMappings.keySet().iterator();
+        while (keys.hasNext()) {
+            Object key =  keys.next();
+            schemaWriter.writeSchema(
+                    (XmlSchema)schemaMappings.get(key),
+                    (String)key
+            );
+        }
+
+
+        WSDLWriter wsdlWriter = new WSDLWriter(
+                codeGenConfiguration.getOutputLocation());
+        wsdlWriter.writeWSDL(axisService);
+
+
+
     }
 
     private void copyToFaultMap() {
@@ -1220,6 +1264,11 @@
                 : "0", rootElement);
     }
 
+    /**
+     * debugging method - write the output to the debugger
+     * @param description
+     * @param doc
+     */
     private void debugLogDocument(String description, Document doc) {
         if (log.isDebugEnabled()) {
             try {
@@ -1603,6 +1652,79 @@
         elt.appendChild(document.createTextNode(eltValue));
         return elt;
     }
+
+//    ///////////////////////////////////////////////////////////////////////////
+//    /////////////  Utility methods to travel the schemas and
+//    /**
+//     * run 1 -calcualte unique names
+//     * @param schemas
+//     */
+//    private void calcualteSchemaNames(List schemas, Hashtable nameTable) {
+//        //first traversal - fill the hashtable
+//        for (int i = 0; i < schemas.size(); i++) {
+//            XmlSchema schema = (XmlSchema) schemas.get(i);
+//            XmlSchemaObjectCollection includes = schema.getIncludes();
+//            for (int j = 0; j < includes.getCount(); j++) {
+//                Object item = includes.getItem(i);
+//                XmlSchema s = null;
+//                if (item instanceof XmlSchemaExternal) {
+//                    //recursively call the calculating
+//                    XmlSchemaExternal externalSchema = (XmlSchemaExternal) item;
+//                    s = externalSchema.getSchema();
+//                    calcualteSchemaNames(Arrays.asList(
+//                            new XmlSchema[]{s}),
+//                            nameTable);
+//                    nameTable.put(s,
+//                            ("xsd" + count++));
+//
+//                }
+//            }
+//        }
+//    }
+//
+//    /**
+//     * Run 2  - adjust the names
+//     * @param schemas
+//     */
+//    private void adjustSchemaNames(List schemas, Hashtable nameTable) {
+//        //first traversal - fill the hashtable
+//        for (int i = 0; i < schemas.size(); i++) {
+//            XmlSchema schema = (XmlSchema) schemas.get(i);
+//            XmlSchemaObjectCollection includes = schema.getIncludes();
+//            for (int j = 0; j < includes.getCount(); j++) {
+//                Object item = includes.getItem(i);
+//                if (item instanceof XmlSchemaExternal) {
+//                    //recursively call the name adjusting
+//                    XmlSchemaExternal xmlSchemaExternal = (XmlSchemaExternal) item;
+//                    adjustSchemaNames(Arrays.asList(
+//                            new XmlSchema[]{xmlSchemaExternal.getSchema()}), nameTable);
+//                    xmlSchemaExternal.setSchemaLocation(
+//                            //this should return the correct end point!
+//                            getName() +
+//                                    "?xsd=" +
+//                                    nameTable.get(xmlSchemaExternal.getSchema()));
+//                }
+//            }
+//        }
+//    }
+//
+//    /**
+//     * Swap the key,value pairs
+//     *
+//     * @param originalTable
+//     * @return
+//     */
+//    private Hashtable swapMappingTable(Hashtable originalTable) {
+//        Hashtable swappedTable = new Hashtable(originalTable.size());
+//        Iterator keys = originalTable.keySet().iterator();
+//        Object key;
+//        while (keys.hasNext()) {
+//            key = keys.next();
+//            swappedTable.put(originalTable.get(key), key);
+//        }
+//
+//        return swappedTable;
+//    }
 
 
 }

Added: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/writer/SchemaWriter.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/writer/SchemaWriter.java?rev=396850&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/writer/SchemaWriter.java (added)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/writer/SchemaWriter.java Tue Apr 25 04:38:05 2006
@@ -0,0 +1,54 @@
+package org.apache.axis2.wsdl.codegen.writer;
+
+import org.apache.ws.commons.schema.XmlSchema;
+import org.apache.axis2.util.FileWriter;
+
+import java.io.File;
+import java.io.FileOutputStream;
+/*
+ * Copyright 2004,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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * A convenient class to write out the schemas into a file in the
+ * output location
+ */
+public class SchemaWriter {
+
+    private File baseFolder = null;
+
+    public SchemaWriter(File baseFolder) {
+        this.baseFolder = baseFolder;
+    }
+
+    public void writeSchema(XmlSchema schema,String schemaFileName){
+        try {
+            if (schema!= null){
+                //create a output file
+                File outputFile = FileWriter.createClassFile(baseFolder,
+                        "resources",
+                        schemaFileName.substring(0,schemaFileName.lastIndexOf(".")),
+                        ".xsd");
+                FileOutputStream fos = new FileOutputStream(outputFile);
+                schema.write(fos);
+                fos.flush();
+                fos.close();
+            }
+        } catch (Exception e) {
+            throw new RuntimeException("Schema writing failed!", e);
+        }
+    }
+
+}

Added: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/writer/WSDLWriter.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/writer/WSDLWriter.java?rev=396850&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/writer/WSDLWriter.java (added)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/writer/WSDLWriter.java Tue Apr 25 04:38:05 2006
@@ -0,0 +1,49 @@
+package org.apache.axis2.wsdl.codegen.writer;
+
+import org.apache.axis2.description.AxisService;
+import org.apache.axis2.util.FileWriter;
+
+import java.io.File;
+import java.io.FileOutputStream;
+/*
+ * Copyright 2004,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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+public class WSDLWriter {
+    private File baseFolder = null;
+
+       public WSDLWriter(File baseFolder) {
+           this.baseFolder = baseFolder;
+       }
+
+       public void writeWSDL(AxisService axisService){
+           try {
+               if (axisService!= null){
+                   //create a output file
+                   File outputFile = FileWriter.createClassFile(baseFolder,
+                           "resources",
+                           axisService.getName(),
+                           ".wsdl");
+                   FileOutputStream fos = new FileOutputStream(outputFile);
+                   axisService.printWSDL(fos);
+                   fos.flush();
+                   fos.close();
+               }
+           } catch (Exception e) {
+               throw new RuntimeException("WSDL writing failed!", e);
+           }
+       }
+
+}

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/resolver/AARFileBasedURIResolver.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/resolver/AARFileBasedURIResolver.java?rev=396850&r1=396849&r2=396850&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/resolver/AARFileBasedURIResolver.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/resolver/AARFileBasedURIResolver.java Tue Apr 25 04:38:05 2006
@@ -32,8 +32,6 @@
  */
 public class AARFileBasedURIResolver extends DefaultURIResolver{
 
-
-
     private String aarFileName;
     private File aarFile;
 

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService.java?rev=396850&r1=396849&r2=396850&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService.java Tue Apr 25 04:38:05 2006
@@ -37,6 +37,8 @@
 import org.apache.commons.logging.LogFactory;
 import org.apache.ws.commons.schema.XmlSchema;
 import org.apache.ws.commons.schema.XmlSchemaElement;
+import org.apache.ws.commons.schema.XmlSchemaObjectCollection;
+import org.apache.ws.commons.schema.XmlSchemaExternal;
 import org.apache.ws.java2wsdl.Java2WSDLConstants;
 import org.apache.ws.java2wsdl.SchemaGenerator;
 import org.apache.ws.java2wsdl.utils.TypeTable;
@@ -102,17 +104,49 @@
     private boolean active = true;
 
     //to keep the service target name space
-    private String targetNamespace = Java2WSDLConstants.DEFAULT_TARGET_NAMESPACE;
-    private String targetNamespacePrefix = Java2WSDLConstants.TARGETNAMESPACE_PREFIX;
+    private String targetNamespace =
+            Java2WSDLConstants.DEFAULT_TARGET_NAMESPACE;
+    private String targetNamespacePrefix =
+            Java2WSDLConstants.TARGETNAMESPACE_PREFIX;
 
     // to store the target namespace for the schema
-    private String schematargetNamespace = Java2WSDLConstants.AXIS2_XSD;
-    private String schematargetNamespacePrefix = Java2WSDLConstants.SCHEMA_NAMESPACE_PRFIX;
+    private String schematargetNamespace =
+            Java2WSDLConstants.AXIS2_XSD;
+    private String schematargetNamespacePrefix =
+            Java2WSDLConstants.SCHEMA_NAMESPACE_PRFIX;
 
     private boolean enableAllTransport = true;
     private String [] exposeTransports;
 
+    /**
+     * Keeps track whether the schema locations are adjusted
+     */
+    private boolean schemaLocationsAdjusted = false;
+
+    /**
+     * A table that keeps a mapping of unique xsd names (Strings)
+     * against the schema objects. This is populated in the first
+     * instance the schemas are asked for and then used to serve
+     * the subsequent requests
+     */
+    private Hashtable schemaMappingTable = null;
 
+    /**
+     * counter variable for naming the schemas
+     */
+    private int count = 0;
+    /**
+     * A custom schema Name prefix. if set this will be used to
+     * modify the schema names
+     */
+    private String customSchemaNamePrefix = null;
+
+    /**
+     * A custom schema name suffix. will be attached to the
+     * schema file name when the files are uniquely named.
+     * A good place to add a file extension if needed
+     */
+    private String customSchemaNameSuffix = null;
     /////////////////////////////////////////
     // WSDL related stuff ////////////////////
     ////////////////////////////////////////
@@ -121,6 +155,39 @@
     private String soapNsUri;
     private String endpoint;
 
+
+    public boolean isSchemaLocationsAdjusted() {
+        return schemaLocationsAdjusted;
+    }
+
+    public void setSchemaLocationsAdjusted(boolean schemaLocationsAdjusted) {
+        this.schemaLocationsAdjusted = schemaLocationsAdjusted;
+    }
+
+    public Hashtable getSchemaMappingTable() {
+        return schemaMappingTable;
+    }
+
+    public void setSchemaMappingTable(Hashtable schemaMappingTable) {
+        this.schemaMappingTable = schemaMappingTable;
+    }
+
+    public String getCustomSchemaNamePrefix() {
+        return customSchemaNamePrefix;
+    }
+
+    public void setCustomSchemaNamePrefix(String customSchemaNamePrefix) {
+        this.customSchemaNamePrefix = customSchemaNamePrefix;
+    }
+
+    public String getCustomSchemaNameSuffix() {
+        return customSchemaNameSuffix;
+    }
+
+    public void setCustomSchemaNameSuffix(String customSchemaNameSuffix) {
+        this.customSchemaNameSuffix = customSchemaNameSuffix;
+    }
+
     /**
      * Constructor AxisService.
      */
@@ -442,13 +509,16 @@
             String trs [] = getExposeTransports();
             for (int i = 0; i < trs.length; i++) {
                 String trsName = trs[i];
-                TransportInDescription transportIn = axisConfig.getTransportIn(new QName(trsName));
+                TransportInDescription transportIn = axisConfig.getTransportIn(
+                        new QName(trsName));
                 if (transportIn != null) {
                     TransportListener listener = transportIn.getReceiver();
                     if (listener != null) {
                         try {
-                            if (listener.getEPRForService(getName(), requestIP) != null) {
-                                String address = listener.getEPRForService(getName(), requestIP).getAddress();
+                            if (listener.getEPRForService(getName(), requestIP)
+                                    != null) {
+                                String address = listener.getEPRForService(
+                                        getName(), requestIP).getAddress();
                                 if (address != null) {
                                     eprList.add(address);
                                 }
@@ -464,8 +534,19 @@
         getWSDL(out, eprArray);
     }
 
+    /**
+     * Print the WSDL with a default URL
+     * @param out
+     * @throws AxisFault
+     */
+    public void printWSDL(OutputStream out) throws AxisFault {
+        //pick the endpoint and take it as the epr for the WSDL
+        getWSDL(out,new String[]{getEndpoint()});
+    }
+
     private void getWSDL(OutputStream out, String [] serviceURL) throws AxisFault {
-        AxisService2OM axisService2WOM = new AxisService2OM(this, serviceURL, "document", "literal");
+        AxisService2OM axisService2WOM = new AxisService2OM(this,
+                serviceURL, "document", "literal");
         try {
             OMElement wsdlElement = axisService2WOM.generateOM();
             wsdlElement.serialize(out);
@@ -558,7 +639,8 @@
         AxisOperation axisOperation = (AxisOperation) getChild(operationName);
 
         if (axisOperation == null) {
-            axisOperation = (AxisOperation) operationsAliasesMap.get(operationName.getLocalPart());
+            axisOperation = (AxisOperation) operationsAliasesMap.get(
+                    operationName.getLocalPart());
         }
 
         return axisOperation;
@@ -1026,13 +1108,13 @@
         this.nameSpacesMap = nameSpacesMap;
     }
 
-    private void addSchemaNameSpace(String tragetNameSpace) {
+    private void addSchemaNameSpace(String targetNameSpace) {
         boolean found = false;
         if (nameSpacesMap != null && nameSpacesMap.size() > 0) {
             Iterator itr = nameSpacesMap.values().iterator();
             while (itr.hasNext()) {
                 String value = (String) itr.next();
-                if (value.equals(tragetNameSpace)) {
+                if (value.equals(targetNameSpace)) {
                     found = true;
                 }
             }
@@ -1041,8 +1123,119 @@
             nameSpacesMap = new HashMap();
         }
         if (!found) {
-            nameSpacesMap.put("ns" + nsCount, tragetNameSpace);
+            nameSpacesMap.put("ns" + nsCount, targetNameSpace);
             nsCount ++;
         }
     }
+
+    /**
+     * runs the schema mappings if it has not been run previously
+     * it is best that this logic be in the axis service since one can
+     * call the axis service to populate the schema mappings
+     */
+    public void populateSchemaMappings() {
+
+        //populate the axis service with the necessary schema references
+        ArrayList schema = getSchema();
+        if (!isSchemaLocationsAdjusted()) {
+            Hashtable nameTable = new Hashtable();
+            //calculate unique names for the schemas
+            calcualteSchemaNames(schema, nameTable);
+            //adjust the schema locations as per the calculated names
+            adjustSchemaNames(schema, nameTable);
+            //reverse the nametable so that there is a mapping from the
+            //name to the schemaObject
+            setSchemaMappingTable(swapMappingTable(nameTable));
+            setSchemaLocationsAdjusted(true);
+        }
+    }
+
+    /**
+     * run 1 -calcualte unique names
+     *
+     * @param schemas
+     */
+    private void calcualteSchemaNames(List schemas, Hashtable nameTable) {
+        //first traversal - fill the hashtable
+        for (int i = 0; i < schemas.size(); i++) {
+            XmlSchema schema = (XmlSchema) schemas.get(i);
+
+            XmlSchemaObjectCollection includes = schema.getIncludes();
+            for (int j = 0; j < includes.getCount(); j++) {
+                Object item = includes.getItem(j);
+                XmlSchema s = null;
+                if (item instanceof XmlSchemaExternal) {
+                    //recursively call the calculating
+                    XmlSchemaExternal externalSchema = (XmlSchemaExternal) item;
+                    s = externalSchema.getSchema();
+                    if (s != null){
+                        calcualteSchemaNames(Arrays.asList(
+                                new XmlSchema[]{s}),
+                                nameTable);
+                        nameTable.put(s,
+                                ("xsd" + count++)
+                                        +(customSchemaNameSuffix!=null?
+                                        customSchemaNameSuffix:
+                                        ""));
+                    }
+
+                }
+            }
+        }
+    }
+
+    /**
+     * Run 2  - adjust the names
+     *
+     * @param schemas
+     */
+    private void adjustSchemaNames(List schemas, Hashtable nameTable) {
+        //first traversal - fill the hashtable
+        for (int i = 0; i < schemas.size(); i++) {
+            XmlSchema schema = (XmlSchema) schemas.get(i);
+
+            XmlSchemaObjectCollection includes = schema.getIncludes();
+            for (int j = 0; j < includes.getCount(); j++) {
+                Object item = includes.getItem(j);
+                if (item instanceof XmlSchemaExternal) {
+                    //recursively call the name adjusting
+                    XmlSchemaExternal xmlSchemaExternal = (XmlSchemaExternal) item;
+                    XmlSchema s = xmlSchemaExternal.getSchema();
+                    if (s!=null){
+                        adjustSchemaNames(Arrays.asList(
+                                new XmlSchema[]{s}), nameTable);
+                        xmlSchemaExternal.setSchemaLocation(
+                                customSchemaNamePrefix == null ?
+                                        //use the default mode
+                                        (getName() +
+                                                "?xsd=" +
+                                                nameTable.get(s)) :
+                                        //custom prefix is present - add the custom prefix
+                                        (customSchemaNamePrefix +
+                                                nameTable.get(s)));
+                    }
+                }
+            }
+
+        }
+    }
+
+    /**
+     * Swap the key,value pairs
+     *
+     * @param originalTable
+     * @return
+     */
+    private Hashtable swapMappingTable(Hashtable originalTable) {
+        Hashtable swappedTable = new Hashtable(originalTable.size());
+        Iterator keys = originalTable.keySet().iterator();
+        Object key;
+        while (keys.hasNext()) {
+            key = keys.next();
+            swappedTable.put(originalTable.get(key), key);
+        }
+
+        return swappedTable;
+    }
+
 }

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService2OM.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService2OM.java?rev=396850&r1=396849&r2=396850&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService2OM.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService2OM.java Tue Apr 25 04:38:05 2006
@@ -9,6 +9,10 @@
 import org.apache.axis2.wsdl.SOAPHeaderMessage;
 import org.apache.axis2.wsdl.WSDLConstants;
 import org.apache.ws.commons.schema.XmlSchema;
+import org.apache.ws.commons.schema.XmlSchemaObjectCollection;
+import org.apache.ws.commons.schema.XmlSchemaImport;
+import org.apache.ws.commons.schema.XmlSchemaInclude;
+import org.apache.ws.commons.schema.XmlSchemaRedefine;
 import org.apache.ws.java2wsdl.Java2WSDLConstants;
 import org.apache.ws.policy.Policy;
 import org.apache.ws.policy.PolicyReference;
@@ -25,6 +29,9 @@
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.Map;
+import java.util.List;
+import java.util.Arrays;
+import java.util.Hashtable;
 /*
 * Copyright 2004,2005 The Apache Software Foundation.
 *
@@ -109,11 +116,14 @@
         OMElement wsdlTypes = fac.createOMElement("types", wsdl);
         ele.addChild(wsdlTypes);
 
+        // populate the schema mappings
+        axisService.populateSchemaMappings();
+
         ArrayList schemas = axisService.getSchema();
         for (int i = 0; i < schemas.size(); i++) {
             StringWriter writer = new StringWriter();
             XmlSchema schema = (XmlSchema) schemas.get(i);
-            
+
             schema.write(writer);
             if (!"".equals(writer.toString())) {
                 XMLInputFactory xmlInputFactory = XMLInputFactory.newInstance();
@@ -147,6 +157,10 @@
         return ele;
     }
 
+    private int count =0;
+
+
+
     private void generateMessages(OMFactory fac,
                                   OMElement defintions) {
         Iterator operations = axisService.getOperations();
@@ -381,7 +395,7 @@
         binding.addAttribute("type", tns.getPrefix() + ":" + axisService.getName() + PORT_TYPE_SUFFIX, null);
         addPolicy(PolicyInclude.BINDING_POLICY, axisService.getPolicyInclude(), binding, fac);
 
-        //Adding ext elements
+//Adding ext elements
         addExtensionElemnet(fac, binding, BINDING_LOCAL_NAME,
                 TRANSPORT, TRANSPORT_URI,
                 STYLE, style, soap);
@@ -452,7 +466,7 @@
                     addExtensionElemnet(fac, fault, SOAP_BODY, SOAP_USE, use, "namespace",
                             targetNamespace, soap);
                     fault.addAttribute(ATTRIBUTE_NAME, faultyMessge.getName(), null);
-                    // TODO adding policies for fault messages
+// TODO adding policies for fault messages
                     operation.addChild(fault);
                     writeSoapHeaders(faultyMessge, fac, fault, soap);
                 }
@@ -473,7 +487,7 @@
         binding.addAttribute("type", tns.getPrefix() + ":" + axisService.getName() + PORT_TYPE_SUFFIX, null);
         addPolicy(PolicyInclude.BINDING_POLICY, axisService.getPolicyInclude(), binding, fac);
 
-        //Adding ext elements
+//Adding ext elements
         addExtensionElemnet(fac, binding, BINDING_LOCAL_NAME,
                 TRANSPORT, TRANSPORT_URI,
                 STYLE, style, soap12);
@@ -544,7 +558,7 @@
                     addExtensionElemnet(fac, fault, SOAP_BODY, SOAP_USE, use, "namespace",
                             targetNamespace, soap12);
                     fault.addAttribute(ATTRIBUTE_NAME, faultyMessge.getName(), null);
-                    // add policies for fault messages
+// add policies for fault messages
                     operation.addChild(fault);
                     writeSoapHeaders(faultyMessge, fac, fault, soap12);
                 }
@@ -559,7 +573,7 @@
         binding.addAttribute(ATTRIBUTE_NAME, axisService.getName() + HTTP_BINDING, null);
         binding.addAttribute("type", tns.getPrefix() + ":" + axisService.getName() + PORT_TYPE_SUFFIX, null);
 
-        //Adding ext elements
+//Adding ext elements
         OMElement httpBinding = fac.createOMElement("binding", http);
         binding.addChild(httpBinding);
         httpBinding.addAttribute("verb", "POST", null);

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/HTTPWorker.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/HTTPWorker.java?rev=396850&r1=396849&r2=396850&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/HTTPWorker.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/HTTPWorker.java Tue Apr 25 04:38:05 2006
@@ -36,6 +36,7 @@
 import org.apache.commons.httpclient.HttpVersion;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.ws.commons.schema.XmlSchema;
 
 import javax.xml.namespace.QName;
 import java.io.ByteArrayInputStream;
@@ -189,6 +190,38 @@
                     }
                 }
 
+                //cater for named xsds - check for the xsd name
+                if (uri.indexOf("?xsd=")>0) {
+                    String serviceName = uri.substring(uri.lastIndexOf("/") + 1, uri.lastIndexOf("?xsd="));
+                    String schemaName = uri.substring(uri.lastIndexOf("=") + 1);
+
+                    HashMap services = configurationContext.getAxisConfiguration().getServices();
+                    AxisService service = (AxisService) services.get(serviceName);
+                    if (service != null) {
+                        //run the population logic just to be sure
+                        service.populateSchemaMappings();
+                        //write out the correct schema
+                        Hashtable schemaTable = service.getSchemaMappingTable();
+                        XmlSchema schema = (XmlSchema)schemaTable.get(schemaName);
+                        //schema found - write it to the stream
+                        if (schema!=null){
+                            response.addHeader(new Header("Content-Type", "text/xml"));
+                            schema.write(baos);
+                            byte[] buf = baos.toByteArray();
+                            response.setBody(new ByteArrayInputStream(buf));
+                            conn.writeResponse(response);
+
+                        }else{
+                          // no schema available by that name  - send 404
+                          response.setStatusLine(
+                                  request.getRequestLine().getHttpVersion(),
+                                  404, "Schema Not Found!");
+                        }
+
+                         return true;
+
+                    }
+                }
                 // It is GET handle the Get request
                 boolean processed = HTTPTransportUtils.processHTTPGetRequest(
                         msgContext, baos,

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/ListingAgent.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/ListingAgent.java?rev=396850&r1=396849&r2=396850&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/ListingAgent.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/ListingAgent.java Tue Apr 25 04:38:05 2006
@@ -26,15 +26,17 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
-import java.io.InputStream;
 import java.io.OutputStream;
 import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.Hashtable;
 
 public class ListingAgent extends AbstractAgent {
 
-    private static final String LIST_MULTIPLE_SERVICE_JSP_NAME = "listServices.jsp";
-    private static final String LIST_SINGLE_SERVICE_JSP_NAME = "listSingleService.jsp";
+    private static final String LIST_MULTIPLE_SERVICE_JSP_NAME =
+            "listServices.jsp";
+    private static final String LIST_SINGLE_SERVICE_JSP_NAME =
+            "listSingleService.jsp";
 
     public static final String RUNNING_PORT = "RUNNING_PORT";
 
@@ -42,9 +44,11 @@
         super(aConfigContext);
     }
 
-    public void handle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse)
+    public void handle(HttpServletRequest httpServletRequest,
+                       HttpServletResponse httpServletResponse)
             throws IOException, ServletException {
-        if (httpServletRequest.getParameter("wsdl") != null || httpServletRequest.getParameter("xsd") != null) {
+        if (httpServletRequest.getParameter("wsdl") != null ||
+                httpServletRequest.getParameter("xsd") != null) {
             processListService(httpServletRequest, httpServletResponse);
         } else {
             super.handle(httpServletRequest, httpServletResponse);
@@ -52,15 +56,19 @@
     }
 
 
-    protected void processIndex(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws IOException, ServletException {
+    protected void processIndex(HttpServletRequest httpServletRequest,
+                                HttpServletResponse httpServletResponse)
+            throws IOException, ServletException {
         processListServices(httpServletRequest, httpServletResponse);
     }
 
-    protected void processListService(HttpServletRequest req, HttpServletResponse res)
+    protected void processListService(HttpServletRequest req,
+                                      HttpServletResponse res)
             throws IOException, ServletException {
 
         String filePart = req.getRequestURL().toString();
-        String serviceName = filePart.substring(filePart.lastIndexOf("/") + 1, filePart.length());
+        String serviceName = filePart.substring(filePart.lastIndexOf("/") + 1,
+                filePart.length());
         HashMap services = configContext.getAxisConfiguration().getServices();
         String wsdl = req.getParameter("wsdl");
         String xsd = req.getParameter("xsd");
@@ -76,7 +84,8 @@
                         ip = filePart.substring(ipindex + 2, filePart.length());
                         int seperatorIndex = ip.indexOf(":");
                         int slashIndex = ip.indexOf("/");
-                        String port = ip.substring(seperatorIndex + 1, slashIndex);
+                        String port = ip.substring(seperatorIndex + 1,
+                                slashIndex);
                         configContext.setProperty(RUNNING_PORT, port);
                         if (seperatorIndex > 0) {
                             ip = ip.substring(0, seperatorIndex);
@@ -89,41 +98,35 @@
                 } else if (xsd != null) {
                     OutputStream out = res.getOutputStream();
                     res.setContentType("text/xml");
-
                     AxisService axisService = (AxisService) serviceObj;
+                    //call the populator
+                    axisService.populateSchemaMappings();
+                    Hashtable schemaMappingtable =
+                            axisService.getSchemaMappingTable();
                     ArrayList scheams = axisService.getSchema();
-                    if (!"".equals(xsd)) {
-//                        if (xsd.endsWith(".xsd")) {
-//                            ClassLoader loader = axisService.getClassLoader();
-//                            InputStream in = loader.getResourceAsStream("META-INF/" + xsd);
-//                            if (in != null) {
-//                                byte[] buf = new byte[1024];
-//                                int read;
-//                                while ((read = in.read(buf)) > 0) {
-//                                    out.write(buf, 0, read);
-//                                }
-//                                out.flush();
-//                                out.close();
-//                            }
-//                            return;
-//                        }
-                        xsd = xsd.replaceAll("xsd", "").trim();
-                        try {
-                            int index = Integer.parseInt(xsd);
-                            XmlSchema scheam = axisService.getSchema(index);
-                            if (scheam != null) {
-                                scheam.write(out);
-                                out.flush();
-                                out.close();
-                            }
-                        } catch (Exception e) {
 
+                    //a name is present - try to pump the requested schema
+                    if (!"".equals(xsd)) {
+                        XmlSchema scheam =
+                                (XmlSchema)schemaMappingtable.get(xsd);
+                        if (scheam!=null){
+                            //schema is there - pump it outs
+                            scheam.write(out);
+                            out.flush();
+                            out.close();
+                        }else{
+                            //the schema is not found - pump a 404
+                            res.sendError(HttpServletResponse.SC_NOT_FOUND);
                         }
-                        return;
-                    }
-                    if (scheams.size() > 1) {
+
+                    //multiple schemas are present and the user specified
+                    //no name - in this case we cannot possibly pump a schema
+                    //so redirect to the service root    
+                    }else  if (scheams.size() > 1) {
                         res.sendRedirect("");
-                    } else if ("".equals(xsd)) {
+                    //user specified no name and there is only one schema
+                    //so pump that out
+                    }else{
                         XmlSchema scheam = axisService.getSchema(0);
                         if (scheam != null) {
                             scheam.write(out);
@@ -133,7 +136,8 @@
                     }
                     return;
                 } else {
-                    req.getSession().setAttribute(Constants.SINGLE_SERVICE, serviceObj);
+                    req.getSession().setAttribute(Constants.SINGLE_SERVICE,
+                            serviceObj);
                 }
             } else {
                 req.getSession().setAttribute(Constants.SINGLE_SERVICE, null);
@@ -143,7 +147,9 @@
         renderView(LIST_SINGLE_SERVICE_JSP_NAME, req, res);
     }
 
-    protected void processListServices(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException {
+    protected void processListServices(HttpServletRequest req,
+                                       HttpServletResponse res)
+            throws IOException, ServletException {
         HashMap services = configContext.getAxisConfiguration().getServices();
 
         req.getSession().setAttribute(Constants.SERVICE_MAP, services);

Modified: webservices/axis2/trunk/java/modules/jibx/project.xml
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/jibx/project.xml?rev=396850&r1=396849&r2=396850&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jibx/project.xml (original)
+++ webservices/axis2/trunk/java/modules/jibx/project.xml Tue Apr 25 04:38:05 2006
@@ -1,138 +1,143 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/*
- * Copyright 2001-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.
- */
- -->
-<project>
-    <pomVersion>3</pomVersion>
-    <extend>../../etc/project.xml</extend>
-
-    <name>Apache Axis 2.0 - JiBX Data Binding</name>
-    <id>axis2-jibx</id>
-    <groupId>axis2</groupId>
-    <description>JiBX data binding support for Axis 2.0</description>
-
-    <dependencies>
-       <dependency>
-            <groupId>ws-commons</groupId>
-            <artifactId>axiom-api</artifactId>
-            <version>${axiom.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>ws-commons</groupId>
-            <artifactId>axiom-impl</artifactId>
-            <version>${axiom.version}</version>
-        </dependency>
-       <dependency>
-            <groupId>ws-commons</groupId>
-            <artifactId>XmlSchema</artifactId>
-            <version>${XmlSchema.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>ws-commons</groupId>
-            <artifactId>policy</artifactId>
-            <version>${policy.version}</version>
-            <properties>
-                <module>true</module>
-            </properties>
-        </dependency>
-        <dependency>
-            <groupId>axis2</groupId>
-            <artifactId>axis2-common</artifactId>
-            <version>${pom.currentVersion}</version>
-        </dependency>
-        <dependency>
-            <groupId>axis2</groupId>
-            <artifactId>axis2-codegen</artifactId>
-            <version>${pom.currentVersion}</version>
-        </dependency>
-        <dependency>
-            <groupId>axis2</groupId>
-            <artifactId>axis2-core</artifactId>
-            <version>${pom.currentVersion}</version>
-        </dependency>
-        <dependency>
-            <groupId>axis</groupId>
-            <artifactId>axis-wsdl4j</artifactId>
-            <version>${axis.wsdl4j.version}</version>
-            <properties>
-                <module>true</module>
-            </properties>
-        </dependency>
-
-        <!-- external JARs -->
-        <dependency>
-            <groupId>ant</groupId>
-            <artifactId>ant</artifactId>
-            <version>${ant.version}</version>
-            <type>jar</type>
-            <properties>
-                <module>true</module>
-            </properties>
-        </dependency>
-        <dependency>
-            <groupId>commons-logging</groupId>
-            <artifactId>commons-logging</artifactId>
-            <version>${commons.logging.version}</version>
-            <properties>
-                <module>true</module>
-            </properties>
-        </dependency>
-        <dependency>
-            <groupId>log4j</groupId>
-            <artifactId>log4j</artifactId>
-            <version>${log4j.version}</version>
-            <properties>
-                <module>true</module>
-            </properties>
-            <url>http://dist.codehaus.org/stax/jars/</url>
-        </dependency>
-        <dependency>
-            <groupId>${stax.impl.groupid}</groupId>
-            <artifactId>${stax.impl.artifactid}</artifactId>
-            <version>${stax.impl.version}</version>
-            <properties>
-                <module>true</module>
-            </properties>
-        </dependency>
-        <dependency>
-            <groupId>stax</groupId>
-            <artifactId>stax-api</artifactId>
-            <version>${stax.api.version}</version>
-            <properties>
-                <module>true</module>
-            </properties>
-        </dependency>
-        <dependency>
-            <groupId>jibx</groupId>
-            <artifactId>jibx-bind</artifactId>
-            <version>${jibx.version}</version>
-            <properties>
-                <module>true</module>
-            </properties>
-        </dependency>
-        <dependency>
-            <groupId>jibx</groupId>
-            <artifactId>jibx-run</artifactId>
-            <version>${jibx.version}</version>
-            <properties>
-                <module>true</module>
-            </properties>
-        </dependency>
-    </dependencies>
-    <build/>
-    <reports/>
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/*
+ * Copyright 2001-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.
+ */
+ -->
+<project>
+    <pomVersion>3</pomVersion>
+    <extend>../../etc/project.xml</extend>
+
+    <name>Apache Axis 2.0 - JiBX Data Binding</name>
+    <id>axis2-jibx</id>
+    <groupId>axis2</groupId>
+    <description>JiBX data binding support for Axis 2.0</description>
+
+    <dependencies>
+       <dependency>
+            <groupId>ws-commons</groupId>
+            <artifactId>axiom-api</artifactId>
+            <version>${axiom.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>ws-commons</groupId>
+            <artifactId>axiom-impl</artifactId>
+            <version>${axiom.version}</version>
+        </dependency>
+       <dependency>
+            <groupId>ws-commons</groupId>
+            <artifactId>XmlSchema</artifactId>
+            <version>${XmlSchema.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>ws-commons</groupId>
+            <artifactId>policy</artifactId>
+            <version>${policy.version}</version>
+            <properties>
+                <module>true</module>
+            </properties>
+        </dependency>
+        <dependency>
+            <groupId>axis2</groupId>
+            <artifactId>axis2-common</artifactId>
+            <version>${pom.currentVersion}</version>
+        </dependency>
+        <dependency>
+            <groupId>axis2</groupId>
+            <artifactId>axis2-codegen</artifactId>
+            <version>${pom.currentVersion}</version>
+        </dependency>
+        <dependency>
+            <groupId>axis2</groupId>
+            <artifactId>axis2-core</artifactId>
+            <version>${pom.currentVersion}</version>
+        </dependency>
+	  <dependency>
+            <groupId>axis2</groupId>
+            <artifactId>axis2-java2wsdl</artifactId>
+            <version>${pom.currentVersion}</version>
+        </dependency>
+        <dependency>
+            <groupId>axis</groupId>
+            <artifactId>axis-wsdl4j</artifactId>
+            <version>${axis.wsdl4j.version}</version>
+            <properties>
+                <module>true</module>
+            </properties>
+        </dependency>
+
+        <!-- external JARs -->
+        <dependency>
+            <groupId>ant</groupId>
+            <artifactId>ant</artifactId>
+            <version>${ant.version}</version>
+            <type>jar</type>
+            <properties>
+                <module>true</module>
+            </properties>
+        </dependency>
+        <dependency>
+            <groupId>commons-logging</groupId>
+            <artifactId>commons-logging</artifactId>
+            <version>${commons.logging.version}</version>
+            <properties>
+                <module>true</module>
+            </properties>
+        </dependency>
+        <dependency>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+            <version>${log4j.version}</version>
+            <properties>
+                <module>true</module>
+            </properties>
+            <url>http://dist.codehaus.org/stax/jars/</url>
+        </dependency>
+        <dependency>
+            <groupId>${stax.impl.groupid}</groupId>
+            <artifactId>${stax.impl.artifactid}</artifactId>
+            <version>${stax.impl.version}</version>
+            <properties>
+                <module>true</module>
+            </properties>
+        </dependency>
+        <dependency>
+            <groupId>stax</groupId>
+            <artifactId>stax-api</artifactId>
+            <version>${stax.api.version}</version>
+            <properties>
+                <module>true</module>
+            </properties>
+        </dependency>
+        <dependency>
+            <groupId>jibx</groupId>
+            <artifactId>jibx-bind</artifactId>
+            <version>${jibx.version}</version>
+            <properties>
+                <module>true</module>
+            </properties>
+        </dependency>
+        <dependency>
+            <groupId>jibx</groupId>
+            <artifactId>jibx-run</artifactId>
+            <version>${jibx.version}</version>
+            <properties>
+                <module>true</module>
+            </properties>
+        </dependency>
+    </dependencies>
+    <build/>
+    <reports/>
+</project>

Modified: webservices/axis2/trunk/java/modules/security/project.xml
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/security/project.xml?rev=396850&r1=396849&r2=396850&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/security/project.xml (original)
+++ webservices/axis2/trunk/java/modules/security/project.xml Tue Apr 25 04:38:05 2006
@@ -46,6 +46,13 @@
             <artifactId>axis2-common</artifactId>
             <version>${pom.currentVersion}</version>
         </dependency>
+  <dependency>
+            <groupId>axis2</groupId>
+            <artifactId>axis2-java2wsdl</artifactId>
+            <version>${pom.currentVersion}</version>
+        </dependency>
+
+
                 <dependency>
             <groupId>axis2</groupId>
             <artifactId>axis2-codegen</artifactId>

Modified: webservices/axis2/trunk/java/modules/xmlbeans/project.xml
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xmlbeans/project.xml?rev=396850&r1=396849&r2=396850&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xmlbeans/project.xml (original)
+++ webservices/axis2/trunk/java/modules/xmlbeans/project.xml Tue Apr 25 04:38:05 2006
@@ -1,166 +1,179 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/*
- * Copyright 2001-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.
- */
- -->
-<project>
-    <pomVersion>3</pomVersion>
-    <extend>../../etc/project.xml</extend>
-
-    <id>axis2-xmlbeans</id>
-    <name>Apache Axis 2.0 - XMLBeans Data Binding</name>
-    <groupId>axis2</groupId>
-    <description>XMLBeans data binding support for Axis2</description>
-
-    <dependencies>
-       <dependency>
-            <groupId>ws-commons</groupId>
-            <artifactId>axiom-api</artifactId>
-            <version>${axiom.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>axis2</groupId>
-            <artifactId>axis2-common</artifactId>
-            <version>${pom.currentVersion}</version>
-        </dependency>
-        <dependency>
-            <groupId>axis2</groupId>
-            <artifactId>axis2-codegen</artifactId>
-            <version>${pom.currentVersion}</version>
-        </dependency>
-        <dependency>
-            <groupId>axis2</groupId>
-            <artifactId>axis2-core</artifactId>
-            <version>${pom.currentVersion}</version>
-        </dependency>
-        <dependency>
-            <groupId>ws-commons</groupId>
-            <artifactId>XmlSchema</artifactId>
-            <version>${XmlSchema.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>xmlbeans</groupId>
-            <artifactId>xbean</artifactId>
-            <version>${xbean.version}</version>
-            <type>jar</type>
-            <properties>
-                <module>true</module>
-            </properties>
-        </dependency>
-        <dependency>
-            <groupId>commons-logging</groupId>
-            <artifactId>commons-logging</artifactId>
-            <version>${commons.logging.version}</version>
-            <properties>
-                <module>true</module>
-            </properties>
-        </dependency>
-        <dependency>
-            <groupId>${stax.impl.groupid}</groupId>
-            <artifactId>${stax.impl.artifactid}</artifactId>
-            <version>${stax.impl.version}</version>
-            <properties>
-                <module>true</module>
-            </properties>
-            <url>http://dist.codehaus.org/stax/jars/</url>
-        </dependency>
-        <dependency>
-            <groupId>log4j</groupId>
-            <artifactId>log4j</artifactId>
-            <version>${log4j.version}</version>
-            <properties>
-                <module>true</module>
-            </properties>
-            <url>http://dist.codehaus.org/stax/jars/</url>
-        </dependency>
-
-        <dependency>
-            <groupId>stax</groupId>
-            <artifactId>stax-api</artifactId>
-            <version>${stax.api.version}</version>
-            <properties>
-                <module>true</module>
-            </properties>
-            <url>http://dist.codehaus.org/stax/jars/</url>
-        </dependency>
-        <dependency>
-            <groupId>axis</groupId>
-            <artifactId>axis-wsdl4j</artifactId>
-            <version>${axis.wsdl4j.version}</version>
-            <properties>
-                <module>true</module>
-            </properties>
-        </dependency>
-        <dependency>
-            <groupId>ant</groupId>
-            <artifactId>ant</artifactId>
-            <version>${ant.version}</version>
-            <type>jar</type>
-            <properties>
-                <module>true</module>
-            </properties>
-        </dependency>
-        <dependency>
-            <groupId>xmlunit</groupId>
-            <artifactId>xmlunit</artifactId>
-            <version>${xmlunit.version}</version>
-            <properties>
-                <module>true</module>
-            </properties>
-            <url>http://www.ibiblio.org/maven/xmlunit/jars/</url>
-        </dependency>
-         <dependency>
-            <groupId>annogen</groupId>
-            <artifactId>annogen</artifactId>
-            <version>${annogen.version}</version>
-            <properties>
-                <module>true</module>
-            </properties>
-        </dependency>
-        <dependency>
-            <groupId>backport-util-concurrent</groupId>
-            <artifactId>backport-util-concurrent</artifactId>
-            <version>${backport_util_concurrent.version}</version>
-            <properties>
-                <module>true</module>
-            </properties>
-        </dependency>
-        <dependency>
-            <groupId>ws-commons</groupId>
-            <artifactId>policy</artifactId>
-            <version>${policy.version}</version>
-            <properties>
-                <module>true</module>
-            </properties>
-        </dependency>
-    </dependencies>
-
-    <reports/>
-    <!-- add the build properties-->
-    <build>
-        <resources>
-            <resource>
-                <directory>src</directory>
-                <includes>
-                    <include>**/*.properties</include>
-                    <include>**/*.xml</include>
-                    <include>**/*.xsl</include>
-                    <include>**/*.xsd</include>
-                </includes>
-            </resource>
-        </resources>
-    </build>
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/*
+ * Copyright 2001-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.
+ */
+ -->
+<project>
+    <pomVersion>3</pomVersion>
+    <extend>../../etc/project.xml</extend>
+
+    <id>axis2-xmlbeans</id>
+    <name>Apache Axis 2.0 - XMLBeans Data Binding</name>
+    <groupId>axis2</groupId>
+    <description>XMLBeans data binding support for Axis2</description>
+
+    <dependencies>
+       <dependency>
+            <groupId>ws-commons</groupId>
+            <artifactId>axiom-api</artifactId>
+            <version>${axiom.version}</version>
+        </dependency>
+       
+        <dependency>
+            <groupId>ws-commons</groupId>
+            <artifactId>axiom-impl</artifactId>
+            <version>${axiom.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>axis2</groupId>
+            <artifactId>axis2-common</artifactId>
+            <version>${pom.currentVersion}</version>
+        </dependency>
+        <dependency>
+            <groupId>axis2</groupId>
+            <artifactId>axis2-codegen</artifactId>
+            <version>${pom.currentVersion}</version>
+        </dependency>
+        <dependency>
+            <groupId>axis2</groupId>
+            <artifactId>axis2-core</artifactId>
+            <version>${pom.currentVersion}</version>
+        </dependency>
+	  <dependency>
+            <groupId>axis2</groupId>
+            <artifactId>axis2-java2wsdl</artifactId>
+            <version>${pom.currentVersion}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>ws-commons</groupId>
+            <artifactId>XmlSchema</artifactId>
+            <version>${XmlSchema.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>xmlbeans</groupId>
+            <artifactId>xbean</artifactId>
+            <version>${xbean.version}</version>
+            <type>jar</type>
+            <properties>
+                <module>true</module>
+            </properties>
+        </dependency>
+        <dependency>
+            <groupId>commons-logging</groupId>
+            <artifactId>commons-logging</artifactId>
+            <version>${commons.logging.version}</version>
+            <properties>
+                <module>true</module>
+            </properties>
+        </dependency>
+        <dependency>
+            <groupId>${stax.impl.groupid}</groupId>
+            <artifactId>${stax.impl.artifactid}</artifactId>
+            <version>${stax.impl.version}</version>
+            <properties>
+                <module>true</module>
+            </properties>
+            <url>http://dist.codehaus.org/stax/jars/</url>
+        </dependency>
+        <dependency>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+            <version>${log4j.version}</version>
+            <properties>
+                <module>true</module>
+            </properties>
+            <url>http://dist.codehaus.org/stax/jars/</url>
+        </dependency>
+
+        <dependency>
+            <groupId>stax</groupId>
+            <artifactId>stax-api</artifactId>
+            <version>${stax.api.version}</version>
+            <properties>
+                <module>true</module>
+            </properties>
+            <url>http://dist.codehaus.org/stax/jars/</url>
+        </dependency>
+        <dependency>
+            <groupId>axis</groupId>
+            <artifactId>axis-wsdl4j</artifactId>
+            <version>${axis.wsdl4j.version}</version>
+            <properties>
+                <module>true</module>
+            </properties>
+        </dependency>
+        <dependency>
+            <groupId>ant</groupId>
+            <artifactId>ant</artifactId>
+            <version>${ant.version}</version>
+            <type>jar</type>
+            <properties>
+                <module>true</module>
+            </properties>
+        </dependency>
+        <dependency>
+            <groupId>xmlunit</groupId>
+            <artifactId>xmlunit</artifactId>
+            <version>${xmlunit.version}</version>
+            <properties>
+                <module>true</module>
+            </properties>
+            <url>http://www.ibiblio.org/maven/xmlunit/jars/</url>
+        </dependency>
+         <dependency>
+            <groupId>annogen</groupId>
+            <artifactId>annogen</artifactId>
+            <version>${annogen.version}</version>
+            <properties>
+                <module>true</module>
+            </properties>
+        </dependency>
+        <dependency>
+            <groupId>backport-util-concurrent</groupId>
+            <artifactId>backport-util-concurrent</artifactId>
+            <version>${backport_util_concurrent.version}</version>
+            <properties>
+                <module>true</module>
+            </properties>
+        </dependency>
+        <dependency>
+            <groupId>ws-commons</groupId>
+            <artifactId>policy</artifactId>
+            <version>${policy.version}</version>
+            <properties>
+                <module>true</module>
+            </properties>
+        </dependency>
+    </dependencies>
+
+    <reports/>
+    <!-- add the build properties-->
+    <build>
+        <resources>
+            <resource>
+                <directory>src</directory>
+                <includes>
+                    <include>**/*.properties</include>
+                    <include>**/*.xml</include>
+                    <include>**/*.xsl</include>
+                    <include>**/*.xsd</include>
+                </includes>
+            </resource>
+        </resources>
+    </build>
+</project>

Modified: webservices/axis2/trunk/java/modules/xmlbeans/test/org/apache/axis2/xmlbeans/WSDL2JavaTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xmlbeans/test/org/apache/axis2/xmlbeans/WSDL2JavaTest.java?rev=396850&r1=396849&r2=396850&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xmlbeans/test/org/apache/axis2/xmlbeans/WSDL2JavaTest.java (original)
+++ webservices/axis2/trunk/java/modules/xmlbeans/test/org/apache/axis2/xmlbeans/WSDL2JavaTest.java Tue Apr 25 04:38:05 2006
@@ -138,6 +138,7 @@
         try {
             generateAndCompile("ping.wsdl", OUTPUT_LOCATION_BASE+OUTPUT_LOCATION_PREFIX+folderCount++);
         } catch (CodeGenerationException e) {
+            e.printStackTrace();
             fail("Exception while code generation test!"+ e.getMessage());
         }
     }