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 2005/08/25 07:34:12 UTC

svn commit: r240000 - in /webservices/axis/trunk/java/modules/wsdl: src/org/apache/axis2/wsdl/builder/wsdl4j/ src/org/apache/axis2/wsdl/codegen/emitter/ src/org/apache/axis2/wsdl/codegen/extension/ src/org/apache/axis2/wsdl/template/general/ src/org/ap...

Author: ajith
Date: Wed Aug 24 22:33:25 2005
New Revision: 240000

URL: http://svn.apache.org/viewcvs?rev=240000&view=rev
Log:
1. Modified the Schema.java.SchemaImpl.java and WSDLPump.java to have a name inside the Schema.
2. Updated the MultiLanguageClientEmitter.java to generate multiple callback handlers in case of multiple porttypes.
3. Moved the generated service.xml's to a service_descriptors/<portype_name> folder to avoid conflicts. Earlier the generated service.xml's were overriding each other when multiple port types were present.
4. Updated the WSDL2JavaTest.java. But still the compilation problem with ant javac is present.
5. Re factored a misspelled method name in the Schema classes.

Modified:
    webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/builder/wsdl4j/WSDLPump.java
    webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/codegen/emitter/MultiLanguageClientEmitter.java
    webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/codegen/extension/WSDLValidatorExtension.java
    webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/template/general/ServiceXMLTemplate.xsl
    webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/extensions/Schema.java
    webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/extensions/impl/SchemaImpl.java
    webservices/axis/trunk/java/modules/wsdl/test/org/apache/axis2/wsdl/codegen/WSDL2JavaTest.java
    webservices/axis/trunk/java/modules/wsdl/test/org/apache/wsdl/CreateSchemaTest.java
    webservices/axis/trunk/java/modules/wsdl/test/org/apache/wsdl/MessageReuseTest.java

Modified: webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/builder/wsdl4j/WSDLPump.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/builder/wsdl4j/WSDLPump.java?rev=240000&r1=239999&r2=240000&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/builder/wsdl4j/WSDLPump.java (original)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/builder/wsdl4j/WSDLPump.java Wed Aug 24 22:33:25 2005
@@ -474,7 +474,7 @@
                     ExtensionFactory extensionFactory = wsdlComponentFactory.createExtensionFactory();
                     org.apache.wsdl.extensions.Schema typesElement = (org.apache.wsdl.extensions.Schema) extensionFactory.getExtensionElement(
                             ExtensionConstants.SCHEMA);
-                    typesElement.setElelment(newSchemaElement);
+                    typesElement.setElement(newSchemaElement);
                     types.addExtensibilityElement(typesElement);
                     this.womDefinition.setTypes(types);
                 }
@@ -487,7 +487,7 @@
                     WSDLExtensibilityElement temp = (WSDLExtensibilityElement) schemaEIIterator.next();
                     if (ExtensionConstants.SCHEMA.equals(temp.getType())) {
                         schemaElement =
-                                ((org.apache.wsdl.extensions.Schema) temp).getElelment();
+                                ((org.apache.wsdl.extensions.Schema) temp).getElement();
                         break;
                     }
                 }
@@ -726,6 +726,7 @@
                 component.addExtensibilityElement(extensibilityElement);
             } else if (wsdl4jElement instanceof Schema) {
                 Schema schema = (Schema) wsdl4jElement;
+                //schema.getDocumentBaseURI()
                 //populate the imported schema stack
                 Stack schemaStack = new Stack();
                 //recursivly load the schema elements. The best thing is to push these into
@@ -733,12 +734,14 @@
                 pushSchemaElement(schema, schemaStack);
                 org.apache.wsdl.extensions.Schema extensibilityElement = (org.apache.wsdl.extensions.Schema) extensionFactory.getExtensionElement(
                         schema.getElementType());
-                extensibilityElement.setElelment(schema.getElement());
+                extensibilityElement.setElement(schema.getElement());
                 extensibilityElement.setImportedSchemaStack(schemaStack);
                 Boolean required = schema.getRequired();
                 if (null != required) {
                     extensibilityElement.setRequired(required.booleanValue());
                 }
+                //set the name of this Schema element
+                extensibilityElement.setName(new QName("",schema.getDocumentBaseURI()));
                 component.addExtensibilityElement(extensibilityElement);
             } else if (SOAPConstants.Q_ELEM_SOAP_OPERATION.equals(
                     wsdl4jElement.getElementType())) {

Modified: webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/codegen/emitter/MultiLanguageClientEmitter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/codegen/emitter/MultiLanguageClientEmitter.java?rev=240000&r1=239999&r2=240000&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/codegen/emitter/MultiLanguageClientEmitter.java (original)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/codegen/emitter/MultiLanguageClientEmitter.java Wed Aug 24 22:33:25 2005
@@ -71,6 +71,7 @@
     private static final String DATABINDING_PACKAGE_NAME_SUFFIX = ".databinding";
     private static final String TEST_SERVICE_CLASS_NAME_SUFFIX = "SkeletonTest";
     private static final String MESSAGE_RECEIVER_SUFFIX = "MessageReceiver";
+    private static final String SERVICE_XML_OUTPUT_FOLDER_NAME = "service_descriptors.";
 
 
     protected InputStream xsltStream = null;
@@ -120,7 +121,7 @@
                 //We may need a flag in the config to force code generation with the binding
                 //if so the following check needs to be uncommented. For now log the situation
                 //throw new CodeGenerationException("Binding needs to be present!");
-                log.info("No binding is present.The follwing items will not be generated");
+                log.info("No binding is present.The following items will not be generated");
                 log.info("1. Message Receiver");
 
             }else{
@@ -163,7 +164,10 @@
             Collection interfaceCollection =interfaces.values();
             for (Iterator iterator = interfaceCollection.iterator(); iterator.hasNext();) {
                 //Write the interfaces
-                writeInterface((WSDLInterface)iterator.next());
+                WSDLInterface axisInterface = (WSDLInterface) iterator.next();
+                writeInterface(axisInterface);
+                //write the call back handlers
+                 writeCallBackHandlers(axisInterface);
             }
 
             Map bindings = wom.getBindings();
@@ -171,7 +175,7 @@
                 //We may need a flag in the config to force code generation with the binding
                 //if so the following check needs to be uncommented. For now log the situation
                 //throw new CodeGenerationException("Binding needs to be present!");
-                log.info("No binding is present.The follwing items will not be generated");
+                log.info("No binding is present.The following items will not be generated");
                 log.info("1. Stub");
                 log.info("2. CallbackHandler");
                 log.info("3. Test Classes");
@@ -187,8 +191,7 @@
 
                     //write interface implementations
                     writeInterfaceImplementation(axisBinding, axisService);
-                    //write the call back handlers
-                    writeCallBackHandlers(axisBinding);
+
                     //write the test classes
                     writeTestClasses(axisBinding);
                     //write the databinding supporters
@@ -232,11 +235,11 @@
     /**
      *
      */
-    protected void writeCallBackHandlers(WSDLBinding binding) throws Exception {
+    protected void writeCallBackHandlers(WSDLInterface wsdlInterface) throws Exception {
 
         if (configuration.isAsyncOn()) {
             Document interfaceModel = createDOMDocumentForCallbackHandler(
-                    binding);
+                    wsdlInterface);
             CallbackHandlerWriter callbackWriter =
                     new CallbackHandlerWriter(
                             this.configuration.getOutputLocation(),
@@ -357,6 +360,7 @@
      */
     protected void writeServiceXml(WSDLInterface axisInterface) throws Exception {
         if (this.configuration.isGenerateDeployementDescriptor()) {
+            //Write the service xml in a folder with the
             Document skeletonModel = createDOMDocumentForServiceXML(
                     axisInterface, false);
             ClassWriter serviceXmlWriter = new ServiceXMLWriter(
@@ -493,11 +497,10 @@
     /**
      * Generating the callbacks
      *
-     * @param binding
+     * @param boundInterface
      */
     protected Document createDOMDocumentForCallbackHandler(
-            WSDLBinding binding) {
-        WSDLInterface boundInterface = binding.getBoundInterface();
+             WSDLInterface boundInterface) {
         Document doc = getEmptyDocument();
         Element rootElement = doc.createElement("callback");
         addAttribute(doc,
@@ -627,8 +630,15 @@
                     localPart + TEST_SERVICE_CLASS_NAME_SUFFIX,
                     rootElement);
         } else {
+            //put the package to be SERVICE_XML_OUTPUT_FOLDER_NAME.interface name
+            //this forces the service XML to be written in a folder of it's porttype
+            //name
             addAttribute(doc,
                     "package",
+                    SERVICE_XML_OUTPUT_FOLDER_NAME+localPart,
+                    rootElement);
+            addAttribute(doc,
+                    "classpackage",
                     configuration.getPackageName(),
                     rootElement);
             addAttribute(doc,

Modified: webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/codegen/extension/WSDLValidatorExtension.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/codegen/extension/WSDLValidatorExtension.java?rev=240000&r1=239999&r2=240000&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/codegen/extension/WSDLValidatorExtension.java (original)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/codegen/extension/WSDLValidatorExtension.java Wed Aug 24 22:33:25 2005
@@ -49,16 +49,19 @@
             boolean targetnamespaceFound = false;
             if (ExtensionConstants.SCHEMA.equals(element.getType())) {
                 Schema schema = (Schema) element;
-                NamedNodeMap attributes = schema.getElelment().getAttributes();
+                NamedNodeMap attributes = schema.getElement().getAttributes();
                 for (int i = 0; i < attributes.getLength(); i++) {
                     if (TARGETNAMESPACE_STRING.equalsIgnoreCase(
-                            attributes.item(i).getLocalName()))
+                            attributes.item(i).getLocalName())){
                         targetnamespaceFound = true;
+                        break;
+                    }
                 }
+                if (!targetnamespaceFound)
+                    throw new CodeGenerationException(
+                            "Invalid WSDL: The WSDL Types Schema does not define a targetNamespace in "+schema.getName() );
             }
-            if (!targetnamespaceFound)
-                throw new CodeGenerationException(
-                        "Invalid WSDL: The WSDL Types Schema does not define a targetNamespace");
+
         }
     }
 }

Modified: webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/template/general/ServiceXMLTemplate.xsl
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/template/general/ServiceXMLTemplate.xsl?rev=240000&r1=239999&r2=240000&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/template/general/ServiceXMLTemplate.xsl (original)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/template/general/ServiceXMLTemplate.xsl Wed Aug 24 22:33:25 2005
@@ -2,7 +2,7 @@
     <xsl:output method="xml" indent="yes" omit-xml-declaration="yes"/>
     <xsl:template match="/interface">
     <xsl:variable name="receiver"><xsl:value-of select="@messagereceiver"/></xsl:variable>
-    <xsl:variable name="package"><xsl:value-of select="@package"/></xsl:variable>
+    <xsl:variable name="package"><xsl:value-of select="@classpackage"/></xsl:variable>
 
     <xsl:comment>Auto generated Axis Service XML</xsl:comment>
     <service><xsl:attribute name="name"><xsl:value-of select="@servicename"/></xsl:attribute>

Modified: webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/extensions/Schema.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/extensions/Schema.java?rev=240000&r1=239999&r2=240000&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/extensions/Schema.java (original)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/extensions/Schema.java Wed Aug 24 22:33:25 2005
@@ -19,22 +19,35 @@
 import org.apache.wsdl.WSDLExtensibilityElement;
 import org.w3c.dom.Element;
 
+import javax.xml.namespace.QName;
 import java.util.Stack;
 
 /**
  * @author chathura@opensource.lk
  */
 public interface Schema extends WSDLExtensibilityElement {
+
+    /**
+     *
+     * @return The QName of this schema
+     */
+    public QName getName();
+
+    /**
+     *  @param  name of this schema
+     */
+     public void setName(QName name);
+
     /**
      * @return The schema Element as a DOM element
      */
-    public Element getElelment();
+    public Element getElement();
 
     /**
      * Sets the Schema Element as a DOM Element.
-     * @param elelment
+     * @param element
      */
-    public void setElelment(Element elelment);
+    public void setElement(Element element);
     /**
      *
      *

Modified: webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/extensions/impl/SchemaImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/extensions/impl/SchemaImpl.java?rev=240000&r1=239999&r2=240000&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/extensions/impl/SchemaImpl.java (original)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/extensions/impl/SchemaImpl.java Wed Aug 24 22:33:25 2005
@@ -21,6 +21,7 @@
 import org.apache.wsdl.impl.WSDLExtensibilityElementImpl;
 import org.w3c.dom.Element;
 
+import javax.xml.namespace.QName;
 import java.util.Stack;
 
 /**
@@ -29,7 +30,8 @@
 public class SchemaImpl extends WSDLExtensibilityElementImpl implements ExtensionConstants,
         Schema {
 
-    private Element elelment;
+    private Element element;
+    private QName name;
     private Stack importedSchemaStack= new Stack();
 
     public SchemaImpl() {
@@ -44,11 +46,19 @@
         this.importedSchemaStack = importedSchemaStack;
     }
 
+    public QName getName() {
+        return name;
+    }
+
+    public void setName(QName name) {
+       this.name = name;
+    }
+
     /**
      * @return The schema Element as a DOM element
      */
-    public Element getElelment() {
-        return elelment;
+    public Element getElement() {
+        return element;
     }
 
     /**
@@ -56,7 +66,7 @@
      *
      * @param elelment
      */
-    public void setElelment(Element elelment) {
-        this.elelment = elelment;
+    public void setElement(Element elelment) {
+        this.element = elelment;
     }
 }

Modified: webservices/axis/trunk/java/modules/wsdl/test/org/apache/axis2/wsdl/codegen/WSDL2JavaTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/test/org/apache/axis2/wsdl/codegen/WSDL2JavaTest.java?rev=240000&r1=239999&r2=240000&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/test/org/apache/axis2/wsdl/codegen/WSDL2JavaTest.java (original)
+++ webservices/axis/trunk/java/modules/wsdl/test/org/apache/axis2/wsdl/codegen/WSDL2JavaTest.java Wed Aug 24 22:33:25 2005
@@ -3,6 +3,7 @@
 import junit.framework.TestCase;
 import org.apache.tools.ant.Project;
 import org.apache.tools.ant.Target;
+import org.apache.tools.ant.BuildException;
 import org.apache.tools.ant.taskdefs.Javac;
 import org.apache.tools.ant.types.Path;
 
@@ -29,33 +30,47 @@
 */
 public class WSDL2JavaTest extends TestCase{
 
-    public static final String OUTPUT_LOCATION = "./out_put_classes";
-    // public static final String OUTPUT_LOCATION = "C:\\GeneratedCode\\test4\\src";
+    public static final String OUTPUT_LOCATION_BASE = "./out_put_classes";
+    public static final String OUTPUT_LOCATION_PREFIX = "/test";
+    private static int FOLDER_COUNT = 0;
+    // public static final String OUTPUT_LOCATION_BASE = "C:\\GeneratedCode\\test4\\src";
     public static final String WSDL_BASE_DIR = "./test-resources/";
     public static final String CLASSES_DIR = "/target/classes/";
     private String[] moduleNames={"xml","common","core"};
+    private static final String MODULE_PATH_PREFIX = "../modules/";
+    private static final String COMPILE_TARGET_NAME = "compile";
 
 
+    /**
+     * Make the root output directory
+     * @throws Exception
+     */
     protected void setUp() throws Exception {
-        File outputFile = new File(OUTPUT_LOCATION);
+        File outputFile = new File(OUTPUT_LOCATION_BASE);
         if (outputFile.exists() && outputFile.isDirectory()){
-            deleteDir(outputFile);
-            outputFile.mkdir();
+           deleteDir(outputFile);
+           outputFile.mkdir();
         }else{
             outputFile.mkdir();
         }
     }
 
+    /**
+     *  Remove the root output directory
+     * @throws Exception
+     */
     protected void tearDown() throws Exception {
-        File outputFile = new File(OUTPUT_LOCATION);
+        File outputFile = new File(OUTPUT_LOCATION_BASE);
         if (outputFile.exists() && outputFile.isDirectory()){
             deleteDir(outputFile);
         }
     }
 
-    // Deletes all files and subdirectories under dir.
-    // Returns true if all deletions were successful.
-    // If a deletion fails, the method stops attempting to delete and returns false.
+    /**
+     * Deletes all files and subdirectories under dir.
+     * Returns true if all deletions were successful.
+     * If a deletion fails, the method stops attempting to delete and returns false.
+     */
     private boolean deleteDir(File dir) {
         if (dir.isDirectory()) {
             String[] children = dir.list();
@@ -70,113 +85,144 @@
         // The directory is now empty so delete it
         return dir.delete();
     }
-        /**
-         * Test for the WSAT wsdl
-         */
-        public void testCodeGenerationWSAT(){
-
-            try {
-                generateAndCompile("wsat.wsdl");
-            } catch (CodeGenerationException e) {
-                fail("Exception while codegeneration test!"+ e.getMessage());
-            }
+
+    /**
+     * Test for the WSAT wsdl
+     */
+    public void testCodeGenerationWSAT(){
+
+        try {
+            generateAndCompile("wsat.wsdl", OUTPUT_LOCATION_BASE+OUTPUT_LOCATION_PREFIX+FOLDER_COUNT++);
+        } catch (CodeGenerationException e) {
+            fail("Exception while code generation test!"+ e.getMessage());
         }
+    }
 
 
     /**
-         * Test for the ping WSDL
-         */
-        public void testCodeGenerationPing(){
-
-            try {
-                generateAndCompile("ping.wsdl");
-            } catch (CodeGenerationException e) {
-                fail("Exception while codegeneration test!"+ e.getMessage());
-            }
+     * Test for the ping WSDL
+     */
+    public void testCodeGenerationPing(){
+
+        try {
+            generateAndCompile("ping.wsdl", OUTPUT_LOCATION_BASE+OUTPUT_LOCATION_PREFIX+FOLDER_COUNT++);
+        } catch (CodeGenerationException e) {
+            fail("Exception while code generation test!"+ e.getMessage());
         }
+    }
 
     /**
-     * Test for the interoptestdoclit.wsdl
+     * Test for the wscoor.wsdl
      */
     public void testCodeGenerationWSCOOR(){
 
         try {
-            generateAndCompile("interoptestdoclit.wsdl");
+            generateAndCompile("interoptestdoclit.wsdl", OUTPUT_LOCATION_BASE+OUTPUT_LOCATION_PREFIX+FOLDER_COUNT++);
         } catch (CodeGenerationException e) {
-            fail("Exception while codegeneration test!"+ e.getMessage());
+            fail("Exception while code generation test!"+ e.getMessage());
         }
     }
-    private void generateAndCompile(String wsdlName) throws CodeGenerationException {
-        codeGenerate(WSDL_BASE_DIR + wsdlName);
-        //todo - Strangely the java.home system variable does not point to the correct place
-        //todo - Need to find the prob and uncomment this
-        //compile();
+
+    /**
+     *
+     * @param wsdlName
+     * @param outputLocation
+     * @throws CodeGenerationException
+     */
+    private void generateAndCompile(String wsdlName, String outputLocation) throws CodeGenerationException {
+        codeGenerate(WSDL_BASE_DIR + wsdlName,outputLocation);
+        //todo - Still the compilation fails (the original problem of the java.home was settled by setting fork
+        //todo - to true). Now the compiler fails for some unknown reason (inside maven)
+
+        //compile(outputLocation);
     }
-    private void codeGenerate(String wsdlFile) throws CodeGenerationException {
+
+    /**
+     *
+     * @param wsdlFile
+     * @param outputLocation
+     * @throws CodeGenerationException
+     */
+    private void codeGenerate(String wsdlFile,String outputLocation) throws CodeGenerationException {
         //create the option map
-        Map optionMap = fillOptionMap(wsdlFile);
+        Map optionMap = fillOptionMap(wsdlFile,outputLocation);
         CommandLineOptionParser parser =
                 new CommandLineOptionParser(optionMap);
         new CodeGenerationEngine(parser).generate();
     }
 
-    private void compile(){
+    /**
+     *
+     * @param outputLocation
+     */
+    private void compile(String outputLocation){
         //using the ant javac task for compilation
         Javac javaCompiler = new Javac();
         Project codeGenProject = new Project();
         Target compileTarget = new Target();
 
-        compileTarget.setName("compile");
+        compileTarget.setName(COMPILE_TARGET_NAME);
         compileTarget.addTask(javaCompiler);
         codeGenProject.addTarget(compileTarget);
         codeGenProject.setSystemProperties();
         javaCompiler.setProject(codeGenProject);
         javaCompiler.setIncludejavaruntime(true);
         javaCompiler.setIncludeantruntime(true);
-
-        File outputLocationFile = new File(OUTPUT_LOCATION);
-
-        Path classPath = new Path(codeGenProject,OUTPUT_LOCATION) ;
+        /*
+          This harmless looking setFork is actually very important. unless the compiler is
+          forked it wont work!
+        */
+        javaCompiler.setFork(true);
+
+        //Create classpath - The generated output directories also become part of the classpath
+        //reason for this is that some codegenerators(XMLBeans) produce compiled classes as part of
+        //generated artifacts
+        File outputLocationFile = new File(outputLocation);
+        Path classPath = new Path(codeGenProject,outputLocation) ;
         classPath.addExisting(classPath.concatSystemClasspath(),false);
         for (int i = 0; i < moduleNames.length; i++) {
-            classPath.add(new Path(codeGenProject,"../modules/"+moduleNames[i]+CLASSES_DIR));
+            classPath.add(new Path(codeGenProject,MODULE_PATH_PREFIX +moduleNames[i]+CLASSES_DIR));
         }
         javaCompiler.setClasspath(classPath);
 
-
-        System.out.println("javaCompiler classpath = " + javaCompiler.getClasspath());
-        System.out.println("System java home setting = " + System.getProperty("java.home"));
-        System.out.println("Compiler name = " +javaCompiler.getExecutable());
-
-        Path sourcePath = new Path(codeGenProject,OUTPUT_LOCATION) ;
+        //set sourcePath - The generated output directories also become part of the sourcepath
+        Path sourcePath = new Path(codeGenProject,outputLocation) ;
         sourcePath.setLocation(outputLocationFile);
         javaCompiler.setSrcdir(sourcePath);
 
+        //output the classes into the output dir as well
         javaCompiler.setDestdir(outputLocationFile);
-
-        codeGenProject.executeTarget("compile");
+        javaCompiler.setVerbose(true);
+        try {
+            codeGenProject.executeTarget(COMPILE_TARGET_NAME);
+        } catch (BuildException e) {
+            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
+            fail();
+        }
 
     }
 
     /**
      *
      */
-    private Map fillOptionMap(String wsdlFileName) {
+    private Map fillOptionMap(String wsdlFileName,String outputLocation) {
         Map optionMap = new HashMap();
         optionMap.put(
                 CommandLineOptionConstants.WSDL_LOCATION_URI_OPTION,
                 new CommandLineOption(
                         CommandLineOptionConstants.WSDL_LOCATION_URI_OPTION,
                         new String[]{wsdlFileName}));
+
         //use default sync option - No option is given
         //use default async option - No option is given
         //use default language option - No option is given
         //output location - code_gen_output
+
         optionMap.put(
                 CommandLineOptionConstants.OUTPUT_LOCATION_OPTION,
                 new CommandLineOption(
                         CommandLineOptionConstants.OUTPUT_LOCATION_OPTION,
-                        new String[]{OUTPUT_LOCATION}));
+                        new String[]{outputLocation}));
         //server side option is on
         optionMap.put(
                 CommandLineOptionConstants.SERVER_SIDE_CODE_OPTION,

Modified: webservices/axis/trunk/java/modules/wsdl/test/org/apache/wsdl/CreateSchemaTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/test/org/apache/wsdl/CreateSchemaTest.java?rev=240000&r1=239999&r2=240000&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/test/org/apache/wsdl/CreateSchemaTest.java (original)
+++ webservices/axis/trunk/java/modules/wsdl/test/org/apache/wsdl/CreateSchemaTest.java Wed Aug 24 22:33:25 2005
@@ -66,7 +66,7 @@
         }
         assertNotNull(element);
         Schema schema = (Schema) element;
-        NodeList childNodes = schema.getElelment().getChildNodes();
+        NodeList childNodes = schema.getElement().getChildNodes();
         Element insertedElementForMessageReference = null;
         for (int i = 0; i < childNodes.getLength(); i++) {
             Node item = childNodes.item(i);

Modified: webservices/axis/trunk/java/modules/wsdl/test/org/apache/wsdl/MessageReuseTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/test/org/apache/wsdl/MessageReuseTest.java?rev=240000&r1=239999&r2=240000&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/test/org/apache/wsdl/MessageReuseTest.java (original)
+++ webservices/axis/trunk/java/modules/wsdl/test/org/apache/wsdl/MessageReuseTest.java Wed Aug 24 22:33:25 2005
@@ -80,7 +80,7 @@
             }
         }
         int numberOfBookQuote_getBookPrice = 0;
-        NodeList childNodes = types.getElelment().getChildNodes();
+        NodeList childNodes = types.getElement().getChildNodes();
         for (int i = 0; i < childNodes.getLength(); i++) {
             Node item = childNodes.item(i);
             if (item instanceof Element) {