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/09 06:53:25 UTC

svn commit: r230967 - in /webservices/axis/trunk/java/modules/wsdl: ./ src/org/apache/axis2/wsdl/codegen/ src/org/apache/axis2/wsdl/codegen/emitter/ src/org/apache/axis2/wsdl/template/java/ test-resources/ test/org/apache/axis2/ test/org/apache/axis2/w...

Author: ajith
Date: Mon Aug  8 21:52:16 2005
New Revision: 230967

URL: http://svn.apache.org/viewcvs?rev=230967&view=rev
Log:
1. Added a new test case to generate and compile source code using the Code generator
2. Added a dependency in the project XML for the ant jar. (the compiler is from Ant)
3. Imporved and corrected some problems in the templates. Now the XSL's are more readable and efficient
4. Added the WSAT wsdl to the test resources directory
5. Changed Glens code slightly and added the XBeans extension again 

Added:
    webservices/axis/trunk/java/modules/wsdl/test-resources/wsat.wsdl
    webservices/axis/trunk/java/modules/wsdl/test-resources/wsat.xsd
    webservices/axis/trunk/java/modules/wsdl/test/org/apache/axis2/
    webservices/axis/trunk/java/modules/wsdl/test/org/apache/axis2/wsdl/
    webservices/axis/trunk/java/modules/wsdl/test/org/apache/axis2/wsdl/codegen/
    webservices/axis/trunk/java/modules/wsdl/test/org/apache/axis2/wsdl/codegen/WSDL2JavaTest.java
Modified:
    webservices/axis/trunk/java/modules/wsdl/project.xml
    webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/codegen/CodeGenConfiguration.java
    webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/codegen/CodeGenerationEngine.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/template/java/CallbackHandlerTemplate.xsl
    webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl
    webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/template/java/InterfaceTemplate.xsl
    webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/template/java/TestClassTemplate.xsl

Modified: webservices/axis/trunk/java/modules/wsdl/project.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/project.xml?rev=230967&r1=230966&r2=230967&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/project.xml (original)
+++ webservices/axis/trunk/java/modules/wsdl/project.xml Mon Aug  8 21:52:16 2005
@@ -97,6 +97,15 @@
                 <module>true</module>
             </properties>
         </dependency>
+         <dependency>
+            <groupId>ant</groupId>
+            <artifactId>ant</artifactId>
+            <version>1.6.2</version>
+            <type>jar</type>
+            <properties>
+                <module>true</module>
+            </properties>
+        </dependency>
     </dependencies>
 
     <reports/>

Modified: webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/codegen/CodeGenConfiguration.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/codegen/CodeGenConfiguration.java?rev=230967&r1=230966&r2=230967&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/codegen/CodeGenConfiguration.java (original)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/codegen/CodeGenConfiguration.java Mon Aug  8 21:52:16 2005
@@ -78,7 +78,7 @@
         CommandLineOption clo =
                 ((CommandLineOption)optionMap.get(OUTPUT_LOCATION_OPTION));
         if (clo == null) {
-            //
+            throw new RuntimeException("Cannot codegenerate! WSDL file is missing!");
         }
         String outputLocation = clo.getOptionValue();
         this.outputLocation = new File(outputLocation);

Modified: webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/codegen/CodeGenerationEngine.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/codegen/CodeGenerationEngine.java?rev=230967&r1=230966&r2=230967&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/codegen/CodeGenerationEngine.java (original)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/codegen/CodeGenerationEngine.java Mon Aug  8 21:52:16 2005
@@ -30,8 +30,9 @@
 import org.apache.axis2.wsdl.codegen.extension.CodeGenExtension;
 import org.apache.axis2.wsdl.codegen.extension.PackageFinder;
 import org.apache.axis2.wsdl.codegen.extension.WSDLValidatorExtension;
-import org.apache.axis2.wsdl.codegen.extension.AbstractCodeGenerationExtension;
-import org.apache.axis2.wsdl.codegen.extension.SimpleDBExtension;
+import org.apache.axis2.wsdl.codegen.extension.XMLBeansExtension;
+//import org.apache.axis2.wsdl.codegen.extension.AbstractCodeGenerationExtension;
+//import org.apache.axis2.wsdl.codegen.extension.SimpleDBExtension;
 import org.apache.axis2.wsdl.databinding.TypeMapper;
 import org.apache.wsdl.WSDLDescription;
 
@@ -40,13 +41,13 @@
  */
 public class CodeGenerationEngine {
     private List moduleEndpoints = new ArrayList();
-    private AbstractCodeGenerationExtension dbExt = new SimpleDBExtension();
+
 
     private CodeGenConfiguration configuration;
 
     public CodeGenerationEngine(CodeGenConfiguration config) throws CodeGenerationException{
        this.configuration = config;
-       loadExtensions(dbExt);
+       loadExtensions();
     }
     
     public CodeGenerationEngine(CommandLineOptionParser parser) throws CodeGenerationException {
@@ -60,10 +61,13 @@
         }
 
         this.configuration = new CodeGenConfiguration(wom, parser);
-        loadExtensions(dbExt);
+        loadExtensions();
     }
 
-    private void loadExtensions(AbstractCodeGenerationExtension dbExt) {
+    private void loadExtensions() {
+        //Ideally these extensions should be loaded through a configuration taken
+        //from some external location. Say a config file.
+
         AxisBindingBuilder axisBindingBuilder = new AxisBindingBuilder();
         axisBindingBuilder.init(this.configuration);
         axisBindingBuilder.engage();
@@ -76,8 +80,15 @@
         packageFinder.init(this.configuration);
         this.moduleEndpoints.add(packageFinder);
 
-        dbExt.init(this.configuration);
-        this.moduleEndpoints.add(dbExt);
+        //Xbeans extension
+        XMLBeansExtension xbeansExtension = new XMLBeansExtension();
+        xbeansExtension.init(this.configuration);
+        this.moduleEndpoints. add(xbeansExtension);
+
+        //default databinding extension
+//        AbstractCodeGenerationExtension dbExt = new SimpleDBExtension();
+//        dbExt.init(this.configuration);
+//        this.moduleEndpoints.add(dbExt);
     }
 
     public void generate() throws CodeGenerationException {

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=230967&r1=230966&r2=230967&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 Mon Aug  8 21:52:16 2005
@@ -123,7 +123,7 @@
             if (bindings==null){
                 throw new CodeGenerationException("Binding needs to be present!");
             }
-            
+
             Collection bindingCollection = bindings.values();
             for (Iterator iterator = bindingCollection.iterator(); iterator.hasNext();) {
                 axisBinding  =  (WSDLBinding)iterator.next();
@@ -410,9 +410,9 @@
                 //write the local test classes
 //               writeLocalTestClasses(axisBinding);
                 //write a dummy implementation call for the tests to run.
-                writeTestSkeletonImpl(axisBinding);
+                //writeTestSkeletonImpl(axisBinding);
                 //write a testservice.xml that will load the dummy skeleton impl for testing
-                writeTestServiceXML(axisBinding);
+                //writeTestServiceXML(axisBinding);
                 //write a MessageReceiver for this particular service.
                 writeMessageReceiver(axisBinding);
             }
@@ -515,7 +515,9 @@
                                       WSDLOperation operation) {
         Element inputElt = doc.createElement("input");
         Element param = getInputParamElement(doc, operation);
-        inputElt.appendChild(param);
+        if (param!=null){
+            inputElt.appendChild(param);
+        }
         return inputElt;
     }
 
@@ -524,14 +526,18 @@
         //todo this should go in a loop
         Element param = doc.createElement("param");
         MessageReference inputMessage = operation.getInputMessage();
-        addAttribute(doc,
-                "name",
-                this.mapper.getParameterName(inputMessage.getElement()),
-                param);
-        String typeMapping = this.mapper.getTypeMapping(
-                inputMessage.getElement());
-        String typeMappingStr = typeMapping == null ? "" : typeMapping;
-        addAttribute(doc, "type", typeMappingStr, param);
+        if (inputMessage!=null){
+            addAttribute(doc,
+                    "name",
+                    this.mapper.getParameterName(inputMessage.getElement()),
+                    param);
+            String typeMapping = this.mapper.getTypeMapping(
+                    inputMessage.getElement());
+            String typeMappingStr = typeMapping == null ? "" : typeMapping;
+            addAttribute(doc, "type", typeMappingStr, param);
+        }else{
+            param = null;
+        }
         return param;
     }
 
@@ -546,7 +552,10 @@
                                        WSDLOperation operation) {
         Element outputElt = doc.createElement("output");
         Element param = getOutputParamElement(doc, operation);
-        outputElt.appendChild(param);
+        if (param!=null){
+            outputElt.appendChild(param);
+        }
+
         return outputElt;
     }
 
@@ -556,18 +565,20 @@
         MessageReference outputMessage = operation.getOutputMessage();
         String typeMappingStr = null;
         String parameterName = null;
+
         if (outputMessage!=null){
             parameterName =  this.mapper.getParameterName(
                     outputMessage.getElement()) ;
             String typeMapping = this.mapper.getTypeMapping(
                     operation.getOutputMessage().getElement());
             typeMappingStr = typeMapping == null ? "" : typeMapping;
+
         }else{
-            parameterName  = this.mapper.getParameterName(null);
-            typeMappingStr = "";        //set the empty string
+            parameterName = "" ;
+            typeMappingStr = "";
         }
-        addAttribute(doc,"name",parameterName,param);
-        addAttribute(doc,"type", typeMappingStr, param);
+          addAttribute(doc,"name",parameterName,param);
+          addAttribute(doc,"type", typeMappingStr, param);
 
         return param;
     }
@@ -582,7 +593,7 @@
     }
 
     protected Document createDOMDocumentForServiceXML(WSDLBinding binding,
-                                                       boolean forTesting) {
+                                                      boolean forTesting) {
         WSDLInterface boundInterface = binding.getBoundInterface();
 
         Document doc = getEmptyDocument();
@@ -888,8 +899,17 @@
                 "namespace",
                 operation.getName().getNamespaceURI(),
                 rootElement);
-        rootElement.appendChild(getInputParamElement(doc, operation));
-        rootElement.appendChild(getOutputParamElement(doc, operation));
+        Element inputParamElement = getInputParamElement(doc, operation);
+
+        if (inputParamElement!=null){
+            rootElement.appendChild(inputParamElement);
+        }
+
+        Element outputParamElement = getOutputParamElement(doc, operation);
+        if (outputParamElement!=null){
+            rootElement.appendChild(outputParamElement);
+        }
+
         doc.appendChild(rootElement);
         return doc;
     }

Modified: webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/template/java/CallbackHandlerTemplate.xsl
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/template/java/CallbackHandlerTemplate.xsl?rev=230967&r1=230966&r2=230967&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/template/java/CallbackHandlerTemplate.xsl (original)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/template/java/CallbackHandlerTemplate.xsl Mon Aug  8 21:52:16 2005
@@ -37,7 +37,8 @@
             * auto generated Axis2 call back method for <xsl:value-of select="@name"/> method
             *
             */
-           public void receiveResult<xsl:value-of select="@name"/>( <xsl:value-of select="$outParamType"/><xsl:text> </xsl:text><xsl:value-of select="$outParamName"/>) {
+           public void receiveResult<xsl:value-of select="@name"/>(
+                    <xsl:if test="$outParamType!=''"><xsl:value-of select="$outParamType"/><xsl:text> </xsl:text><xsl:value-of select="$outParamName"/></xsl:if>) {
 			        //Fill here with the code to handle the response
            }
 

Modified: webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl?rev=230967&r1=230966&r2=230967&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl (original)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl Mon Aug  8 21:52:16 2005
@@ -68,15 +68,14 @@
         /**
          * Auto generated method signature
          * @see <xsl:value-of select="$package"/>.<xsl:value-of select="$interfaceName"/>#<xsl:value-of select="@name"/>
-         <xsl:for-each select="input/param">
-            <xsl:if test="@type!=''">* @param <xsl:value-of select="@name"></xsl:value-of><xsl:text>
-         </xsl:text></xsl:if></xsl:for-each>
+         <xsl:for-each select="input/param[@type!='']">
+         * @param <xsl:value-of select="@name"></xsl:value-of><xsl:text>
+         </xsl:text></xsl:for-each>
          */
         public <xsl:choose><xsl:when test="$outputtype=''">void</xsl:when><xsl:otherwise><xsl:value-of select="$outputtype"/></xsl:otherwise></xsl:choose>
         <xsl:text> </xsl:text><xsl:value-of select="@name"/>(
-         <xsl:for-each select="input/param">
-            <xsl:if test="@type!=''"><xsl:if test="position()>1">,</xsl:if><xsl:value-of select="@type"/><xsl:text> </xsl:text><xsl:value-of select="@name"/>
-          </xsl:if>
+         <xsl:for-each select="input/param[@type!='']">
+            <xsl:if test="position()>1">,</xsl:if><xsl:value-of select="@type"/><xsl:text> </xsl:text><xsl:value-of select="@name"/>
          </xsl:for-each>) throws java.rmi.RemoteException{
 
 		    org.apache.axis2.clientapi.Call _call = new org.apache.axis2.clientapi.Call(_serviceContext);
@@ -88,16 +87,17 @@
             _call.setSoapAction("<xsl:value-of select="$soapAction"/>");
             org.apache.axis2.soap.SOAPEnvelope env = null;
             env = createEnvelope();
+            <xsl:variable name="count"><xsl:value-of select="count(input/param[@type!=''])"></xsl:value-of></xsl:variable>
             <xsl:choose>
             <!-- test the number of input parameters
 				  If the number of parameter is more then just run the normal test-->
-              <xsl:when test="count(input/param)>0">
+                <xsl:when test="$count>0">
                   <xsl:choose>
                       <xsl:when test="$style='rpc'">
                // Style is RPC
               setValueRPC(env,"<xsl:value-of select="@namespace"/>","<xsl:value-of select="@name"/>",
-              new String[]{<xsl:for-each select="input/param"><xsl:if test="count(input/param)>1">,</xsl:if>"<xsl:value-of select="@name"/>"</xsl:for-each>},
-              new Object[]{<xsl:for-each select="input/param"><xsl:if test="count(input/param)>1">,</xsl:if><xsl:value-of select="@name"/></xsl:for-each>});
+              new String[]{<xsl:for-each select="input/param[@type!='']"><xsl:if test="position()>1">,</xsl:if>"<xsl:value-of select="@name"/>"</xsl:for-each>},
+              new Object[]{<xsl:for-each select="input/param[@type!='']"><xsl:if test="position()>1">,</xsl:if><xsl:value-of select="@name"/></xsl:for-each>});
                       </xsl:when>
                       <xsl:when test="$style='doc'">
                       <!-- for the doc lit case there can be only one element. So take the first element -->
@@ -149,14 +149,15 @@
          /**
          * Auto generated method signature for Asynchronous Invocations
          * @see <xsl:value-of select="$package"/>.<xsl:value-of select="$interfaceName"/>#start<xsl:value-of select="@name"/>
-         <xsl:for-each select="input/param">
-            <xsl:if test="@type!=''">* @param <xsl:value-of select="@name"></xsl:value-of><xsl:text>
-         </xsl:text></xsl:if></xsl:for-each>
+          <xsl:for-each select="input/param[@type!='']">
+         * @param <xsl:value-of select="@name"></xsl:value-of><xsl:text>
+         </xsl:text></xsl:for-each>
          */
         public  void start<xsl:value-of select="@name"/>(
-         <xsl:for-each select="input/param">
-            <xsl:if test="@type!=''"><xsl:if test="position()>1">,</xsl:if><xsl:value-of select="@type"/><xsl:text> </xsl:text><xsl:value-of select="@name"></xsl:value-of></xsl:if></xsl:for-each>
-           <xsl:if test="count(input/param)>0">,</xsl:if>final <xsl:value-of select="$package"/>.<xsl:value-of select="$callbackname"/> callback) throws java.rmi.RemoteException{
+         <xsl:variable name="paramCount"><xsl:value-of select="count(input/param[@type!=''])"></xsl:value-of></xsl:variable>
+         <xsl:for-each select="input/param[@type!='']">
+            <xsl:if test="position()>1">,</xsl:if><xsl:value-of select="@type"/><xsl:text> </xsl:text><xsl:value-of select="@name"></xsl:value-of></xsl:for-each>
+            <xsl:if test="$paramCount>0">,</xsl:if>final <xsl:value-of select="$package"/>.<xsl:value-of select="$callbackname"/> callback) throws java.rmi.RemoteException{
 
              org.apache.axis2.clientapi.Call _call = new org.apache.axis2.clientapi.Call(_serviceContext);
  		     org.apache.axis2.context.MessageContext _messageContext = getMessageContext();
@@ -165,16 +166,17 @@
              org.apache.axis2.soap.SOAPEnvelope env = createEnvelope();
              <xsl:choose>
              <!-- There are more than 1 parameter in the input-->
-              <xsl:when test="count(input/param)>0">
+              <xsl:when test="$paramCount>0">
               <xsl:choose>
                <xsl:when test="$style='rpc'">
            // Style is RPC
            setValueRPC(env,
             "<xsl:value-of select="@namespace"/>",
             "<xsl:value-of select="@name"/>",
-             new String[]{<xsl:for-each select="input/param"><xsl:if test="count(input/param)>1">,</xsl:if>"<xsl:value-of select="@name"/>"</xsl:for-each>},
-             new Object[]{<xsl:for-each select="input/param"><xsl:if test="count(input/param)>1">,</xsl:if><xsl:value-of select="@name"/></xsl:for-each>});
+             new String[]{<xsl:for-each select="input/param[@type!='']"><xsl:if test="position()>1">,</xsl:if>"<xsl:value-of select="@name"/>"</xsl:for-each>},
+             new Object[]{<xsl:for-each select="input/param[@type!='']"><xsl:if test="position()>1">,</xsl:if><xsl:value-of select="@name"/></xsl:for-each>});
                       </xsl:when>
+
                       <xsl:when test="$style='doc'">
            //Style is Doc
             setValueDoc(env,<xsl:value-of select="$fullsupporterclassname"/>.toOM(<xsl:value-of select="input/param[1]/@name"/>));
@@ -205,25 +207,28 @@
           throw UnsupportedOperationException("Unknown Style");
                       </xsl:otherwise>
                   </xsl:choose>
-
-             </xsl:otherwise>
+              </xsl:otherwise>
             </xsl:choose>
              _messageContext.setEnvelope(env);
-		     _call.invokeNonBlocking(_operations[<xsl:value-of select="position()-1"/>], _messageContext, new org.apache.axis2.clientapi.Callback(){
-                   public void onComplete(org.apache.axis2.clientapi.AsyncResult result){
-
-					    java.lang.Object object = <xsl:value-of select="$fullsupporterclassname"/>.fromOM(getElement(result.getResponseEnvelope(),"<xsl:value-of select="$style"/>"),<xsl:value-of select="$outputtype"/>.class);
-
-                         callback.receiveResult<xsl:value-of select="@name"/>((<xsl:value-of select="$outputtype"/>)object);
-                   }
-                   public void reportError(java.lang.Exception e){
-                         callback.receiveError<xsl:value-of select="@name"/>(e);
-                   }
+             <xsl:choose>
+             <xsl:when test="$outputtype=''">
+              //Nothing to pass as the callback!!!   
+              _call.invokeNonBlocking(_operations[<xsl:value-of select="position()-1"/>], _messageContext,null);
+              </xsl:when>
+              <xsl:otherwise>
+               _call.invokeNonBlocking(_operations[<xsl:value-of select="position()-1"/>], _messageContext, new org.apache.axis2.clientapi.Callback(){
+                public void onComplete(org.apache.axis2.clientapi.AsyncResult result){
 
-              }
+			    java.lang.Object object = <xsl:value-of select="$fullsupporterclassname"/>.fromOM(getElement(result.getResponseEnvelope(),"<xsl:value-of select="$style"/>"),<xsl:value-of select="$outputtype"/>.class);
+                             callback.receiveResult<xsl:value-of select="@name"/>((<xsl:value-of select="$outputtype"/>)object);
+                }
+                public void reportError(java.lang.Exception e){
+                      callback.receiveError<xsl:value-of select="@name"/>(e);
+                }
+             }
             );
-
-            <!-- this needs to be changed -->
+              </xsl:otherwise>
+             </xsl:choose>
         }
       </xsl:if>
       <!-- End of in-out mep -->
@@ -232,9 +237,8 @@
       <xsl:if test="$mep='http://www.w3.org/2004/08/wsdl/in-only'">
       <!-- for the in only mep there is no notion of sync or async. And there is no return type also -->
       public void <xsl:text> </xsl:text><xsl:value-of select="@name"/>(
-         <xsl:for-each select="input/param">
-            <xsl:if test="@type!=''"><xsl:if test="position()>1">,</xsl:if><xsl:value-of select="@type"/><xsl:text> </xsl:text><xsl:value-of select="@name"/>
-          </xsl:if>
+         <xsl:for-each select="input/param[@type!='']">
+            <xsl:if test="position()>1">,</xsl:if><xsl:value-of select="@type"/><xsl:text> </xsl:text><xsl:value-of select="@name"/>
          </xsl:for-each>) throws java.rmi.RemoteException{
          org.apache.axis2.clientapi.Call _call = new org.apache.axis2.clientapi.Call(_serviceContext);
             _call.setTransportInfo(this.senderTransport,this.listenerTransport,this.useSeparateListener);
@@ -248,13 +252,13 @@
             <xsl:choose>
             <!-- test the number of input parameters
 				  If the number of parameter is more then just run the normal generation-->
-              <xsl:when test="count(input/param)>0">
+              <xsl:when test="count(input/param[@type!=''])>0">
                   <xsl:choose>
                       <xsl:when test="$style='rpc'">
                // Style is RPC
               setValueRPC(env,"<xsl:value-of select="@namespace"/>","<xsl:value-of select="@name"/>",
-              new String[]{<xsl:for-each select="input/param"><xsl:if test="count(input/param)>1">,</xsl:if>"<xsl:value-of select="@name"/>"</xsl:for-each>},
-              new Object[]{<xsl:for-each select="input/param"><xsl:if test="count(input/param)>1">,</xsl:if><xsl:value-of select="@name"/></xsl:for-each>});
+              new String[]{<xsl:for-each select="input/param[@type!='']"><xsl:if test="position()>1">,</xsl:if>"<xsl:value-of select="@name"/>"</xsl:for-each>},
+              new Object[]{<xsl:for-each select="input/param[@type!='']"><xsl:if test="position()>1">,</xsl:if><xsl:value-of select="@name"/></xsl:for-each>});
                       </xsl:when>
                       <xsl:when test="$style='doc'">
                       <!-- for the doc lit case there can be only one element. So take the first element -->

Modified: webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/template/java/InterfaceTemplate.xsl
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/template/java/InterfaceTemplate.xsl?rev=230967&r1=230966&r2=230967&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/template/java/InterfaceTemplate.xsl (original)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/template/java/InterfaceTemplate.xsl Mon Aug  8 21:52:16 2005
@@ -15,23 +15,22 @@
     public interface <xsl:value-of select="@name"></xsl:value-of> {
  		 <xsl:for-each select="method">
 		    <!-- Code for in-out mep -->
-          <xsl:if test="@mep='http://www.w3.org/2004/08/wsdl/in-out'">
+         <xsl:if test="@mep='http://www.w3.org/2004/08/wsdl/in-out'">
          <xsl:variable name="outputtype"><xsl:value-of select="output/param/@type"></xsl:value-of></xsl:variable>
 
-        <!-- start of the sync block -->
+        <!-- start of the sync block -->                                          
          <xsl:if test="$isSync='1'">
         /**
          * Auto generated method signature
-         <xsl:for-each select="input/param">
-         <xsl:if test="@type!=''">*@param <xsl:value-of select="@name"></xsl:value-of><xsl:text>
-         </xsl:text></xsl:if></xsl:for-each>
+         <xsl:for-each select="input/param[@type!='']">
+         *@param <xsl:value-of select="@name"></xsl:value-of><xsl:text>
+         </xsl:text></xsl:for-each>
          */
          public  <xsl:choose><xsl:when test="$outputtype=''">void</xsl:when><xsl:otherwise><xsl:value-of select="$outputtype"/></xsl:otherwise></xsl:choose>
         <xsl:text> </xsl:text><xsl:value-of select="@name"/>(
-         <xsl:for-each select="input/param">
-            <xsl:if test="@type!=''"><xsl:if test="position()>1">,</xsl:if><xsl:value-of select="@type"/><xsl:text> </xsl:text><xsl:value-of select="@name"/>
-            </xsl:if>
-         </xsl:for-each>) throws java.rmi.RemoteException;
+         <xsl:for-each select="input/param[@type!='']">
+            <xsl:if test="position()>1">,</xsl:if><xsl:value-of select="@type"/><xsl:text> </xsl:text><xsl:value-of select="@name"/>
+          </xsl:for-each>) throws java.rmi.RemoteException;
         <!-- end of the sync block -->
         </xsl:if>
 
@@ -43,10 +42,12 @@
             <xsl:if test="@type!=''">* @param <xsl:value-of select="@name"></xsl:value-of><xsl:text>
          </xsl:text></xsl:if></xsl:for-each>
          */
+
         public  void start<xsl:value-of select="@name"/>(
-         <xsl:for-each select="input/param">
+         <xsl:variable name="paramCount"><xsl:value-of select="count(input/param[@type!=''])"></xsl:value-of></xsl:variable>
+               <xsl:for-each select="input/param">
             <xsl:if test="@type!=''"><xsl:if test="position()>1">,</xsl:if><xsl:value-of select="@type"/><xsl:text> </xsl:text><xsl:value-of select="@name"></xsl:value-of></xsl:if></xsl:for-each>
-           <xsl:if test="count(input/param)>0">,</xsl:if>final <xsl:value-of select="$package"/>.<xsl:value-of select="$callbackname"/> callback) throws java.rmi.RemoteException;
+           <xsl:if test="$paramCount>0">,</xsl:if>final <xsl:value-of select="$package"/>.<xsl:value-of select="$callbackname"/> callback) throws java.rmi.RemoteException;
         </xsl:if>
 <!-- end of async block-->
 

Modified: webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/template/java/TestClassTemplate.xsl
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/template/java/TestClassTemplate.xsl?rev=230967&r1=230966&r2=230967&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/template/java/TestClassTemplate.xsl (original)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/template/java/TestClassTemplate.xsl Mon Aug  8 21:52:16 2005
@@ -35,12 +35,10 @@
     public class <xsl:value-of select="@name"/> extends junit.framework.TestCase{
 
      <xsl:for-each select="method">
-         <xsl:variable name="outputtype"><xsl:value-of select="output/param/@type"></xsl:value-of></xsl:variable>
-         <xsl:variable name="inputtype"><xsl:value-of select="input/param/@type"></xsl:value-of></xsl:variable>  <!-- this needs to change-->
-         <xsl:variable name="inputparam"><xsl:value-of select="input/param/@name"></xsl:value-of></xsl:variable>  <!-- this needs to change-->
-         <xsl:variable name="dbsupportclassname"><xsl:value-of select="@dbsupportname"></xsl:value-of></xsl:variable>
-         <xsl:if test="$isSync='1'">
-
+         <xsl:if test="@mep='http://www.w3.org/2004/08/wsdl/in-out'">
+          <xsl:variable name="outputtype"><xsl:value-of select="output/param/@type"></xsl:value-of></xsl:variable>
+          <xsl:variable name="dbsupportclassname"><xsl:value-of select="@dbsupportname"></xsl:value-of></xsl:variable>
+          <xsl:if test="$isSync='1'">
         /**
          * Auto generated test method
          */
@@ -53,15 +51,25 @@
         <xsl:value-of select="$fullsupporterclassname"/> databindSupporter = new <xsl:value-of select="$fullsupporterclassname"/>();
 
            <xsl:choose>
-             <xsl:when test="$inputtype!=''">
+             <xsl:when test="count(input/param)>0">
+<!--                //<xsl:variable name="firstInput"><xsl:value-of select="input/param[1]"/></xsl:variable>  -->
                 <xsl:choose>
                     <xsl:when test="$outputtype=''">
+                    <!-- for now think there is only one input element -->
                     //There is no output to be tested!
-                    stub.<xsl:value-of select="@name"/>((<xsl:value-of select="$inputtype"/>)databindSupporter.getTestObject(<xsl:value-of select="$inputtype"/>.class));
+                    stub.<xsl:value-of select="@name"/>(
+                        <xsl:for-each select="input/param">
+                             <xsl:if test="@type!=''"><xsl:if test="position()>1">,</xsl:if>(<xsl:value-of select="@type"/>)databindSupporter.getTestObject(<xsl:value-of select="@type"/>.class)
+                        </xsl:if>
+                        </xsl:for-each>);
                     </xsl:when>
                     <xsl:otherwise>
-                    assertNotNull(stub.<xsl:value-of select="@name"/>((<xsl:value-of select="$inputtype"/>)databindSupporter.getTestObject(<xsl:value-of select="$inputtype"/>.class)));
-                    </xsl:otherwise>
+                        assertNotNull(stub.<xsl:value-of select="@name"/>(
+                        <xsl:for-each select="input/param">
+                             <xsl:if test="@type!=''"><xsl:if test="position()>1">,</xsl:if>(<xsl:value-of select="@type"/>)databindSupporter.getTestObject(<xsl:value-of select="@type"/>.class)
+                        </xsl:if>
+                        </xsl:for-each>));
+                  </xsl:otherwise>
                 </xsl:choose>
               </xsl:when>
               <xsl:otherwise>
@@ -92,8 +100,12 @@
             <xsl:variable name="fullsupporterclassname"><xsl:value-of select="$dbpackage"/>.<xsl:value-of select="$dbsupportclassname"/></xsl:variable>
             <xsl:value-of select="$fullsupporterclassname"/> databindSupporter = new <xsl:value-of select="$fullsupporterclassname"/>();
              <xsl:choose>
-             <xsl:when test="$inputtype!=''">
-                stub.start<xsl:value-of select="@name"/>((<xsl:value-of select="$inputtype"/>)databindSupporter.getTestObject(<xsl:value-of select="$inputtype"/>.class),
+             <xsl:when test="count(input/param)>0">
+                stub.start<xsl:value-of select="@name"/>(
+                         <xsl:for-each select="input/param">
+                             <xsl:if test="@type!=''"><xsl:if test="position()>1">,</xsl:if>(<xsl:value-of select="@type"/>)databindSupporter.getTestObject(<xsl:value-of select="@type"/>.class)
+                        </xsl:if>
+                        </xsl:for-each>,
                     new <xsl:value-of select="$tempCallbackName"/>()
                 );
               </xsl:when>
@@ -120,19 +132,9 @@
 
         }
       </xsl:if>
+      <!-- end of in-out mep -->
+      </xsl:if>
      </xsl:for-each>
 
-
-     public static Object createTestInput(Class paramClass){
-
-      OMFactory factory = OMAbstractFactory.getOMFactory();
-		OMElement element = factory.createOMElement(new QName("http://soapinterop.org/", "<xsl:value-of select="generate-id()"/>"), null);
-		OMElement element1 = factory.createOMElement(new QName("http://soapinterop.org/","<xsl:value-of select="generate-id()"/>"), element);
-		element.addChild(element1);
-    	OMTextImpl text = new OMTextImpl("<xsl:value-of select="generate-id()"/>");
-    	element1.addChild(text);
-    	return element;
-    }
-    }
     </xsl:template>
  </xsl:stylesheet>

Added: webservices/axis/trunk/java/modules/wsdl/test-resources/wsat.wsdl
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/test-resources/wsat.wsdl?rev=230967&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/test-resources/wsat.wsdl (added)
+++ webservices/axis/trunk/java/modules/wsdl/test-resources/wsat.wsdl Mon Aug  8 21:52:16 2005
@@ -0,0 +1,353 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 
+Legal Disclaimer
+
+The presentation, distribution or other dissemination of the information 
+contained in this specification is not a license, either expressly or impliedly, 
+to any intellectual property owned or controlled by BEA or IBM or Microsoft and\or any other 
+third party.  BEA and IBM and Microsoft and\or any other third party may have patents, patent 
+applications, trademarks, copyrights, or other intellectual property rights 
+covering subject matter in this document.  The furnishing of this document 
+does not give you any license to BEA's and IBM's and Microsoft's or any other third party's patents, trademarks, copyrights, or other intellectual property.
+
+This specification and the information contained herein is provided on an "AS IS"
+ basis and to the maximum extent permitted by applicable law, BEA and IBM and Microsoft provides 
+the document AS IS AND WITH ALL FAULTS, and hereby disclaims all other warranties 
+and conditions, either express, implied or statutory, including, but not limited 
+to, any (if any) implied warranties, duties or conditions of merchantability, of 
+fitness for a particular purpose, of accuracy or completeness of responses, of 
+results, of workmanlike effort, of lack of viruses, and of lack of negligence, 
+all with regard to the document. ALSO, THERE IS NO WARRANTY OR CONDITION OF 
+TITLE, QUIET ENJOYMENT, QUIET POSSESSION, CORRESPONDENCE TO DESCRIPTION OR 
+NON-INFRINGEMENT OF ANY INTELLECTUAL PROPERTY RIGHTS WITH REGARD TO THE DOCUMENT.
+
+IN NO EVENT WILL BEA or IBM or MICROSOFT BE LIABLE TO ANY OTHER PARTY FOR THE COST OF PROCURING 
+SUBSTITUTE GOODS OR SERVICES, LOST PROFITS, LOSS OF USE, LOSS OF DATA, OR ANY 
+INCIDENTAL, CONSEQUENTIAL, DIRECT, INDIRECT, OR SPECIAL DAMAGES WHETHER UNDER 
+CONTRACT, TORT, WARRANTY, OR OTHERWISE, ARISING IN ANY WAY OUT OF THIS OR ANY 
+OTHER AGREEMENT RELATING TO THIS DOCUMENT, WHETHER OR NOT SUCH PARTY HAD ADVANCE 
+NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.
+
+Copyright Notice
+
+Copyright 2001, 2002 BEA Systems and IBM Corporation and Microsoft Corporation. All rights reserved.
+-->
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsat="http://schemas.xmlsoap.org/ws/2003/09/wsat" targetNamespace="http://schemas.xmlsoap.org/ws/2003/09/wsat">
+	<wsdl:import namespace="http://schemas.xmlsoap.org/ws/2003/09/wsat" location="wsat.xsd"/>
+	<!-- location="http://schemas.xmlsoap.org/ws/2003/09/wsat" -->
+	<!-- Messages -->
+	<wsdl:message name="Prepare">
+		<wsdl:part name="parameters" element="wsat:Prepare"/>
+	</wsdl:message>
+	<wsdl:message name="Prepared">
+		<wsdl:part name="parameters" element="wsat:Prepared"/>
+	</wsdl:message>
+	<wsdl:message name="Aborted">
+		<wsdl:part name="parameters" element="wsat:Aborted"/>
+	</wsdl:message>
+	<wsdl:message name="ReadOnly">
+		<wsdl:part name="parameters" element="wsat:ReadOnly"/>
+	</wsdl:message>
+	<wsdl:message name="Commit">
+		<wsdl:part name="parameters" element="wsat:Commit"/>
+	</wsdl:message>
+	<wsdl:message name="Rollback">
+		<wsdl:part name="parameters" element="wsat:Rollback"/>
+	</wsdl:message>
+	<wsdl:message name="Committed">
+		<wsdl:part name="parameters" element="wsat:Committed"/>
+	</wsdl:message>
+	<wsdl:message name="Replay">
+		<wsdl:part name="parameters" element="wsat:Replay"/>
+	</wsdl:message>
+	<wsdl:message name="PrepareResponse">
+		<wsdl:part name="parameters" element="wsat:PrepareResponse"/>
+	</wsdl:message>
+	<wsdl:message name="ReplayResponse">
+		<wsdl:part name="parameters" element="wsat:ReplayResponse"/>
+	</wsdl:message>
+	<!-- Mandatory Asynchronous Messaging PortTypes -->
+	<wsdl:portType name="CompletionCoordinatorPortType">
+		<wsdl:operation name="CommitOperation">
+			<wsdl:input message="wsat:Commit"/>
+		</wsdl:operation>
+		<wsdl:operation name="RollbackOperation">
+			<wsdl:input message="wsat:Rollback"/>
+		</wsdl:operation>
+	</wsdl:portType>
+	<wsdl:portType name="CompletionInitiatorPortType">
+		<wsdl:operation name="CommittedOperation">
+			<wsdl:input message="wsat:Committed"/>
+		</wsdl:operation>
+		<wsdl:operation name="AbortedOperation">
+			<wsdl:input message="wsat:Aborted"/>
+		</wsdl:operation>
+	</wsdl:portType>
+	<wsdl:portType name="CoordinatorPortType">
+		<wsdl:operation name="PreparedOperation">
+			<wsdl:input message="wsat:Prepared"/>
+		</wsdl:operation>
+		<wsdl:operation name="AbortedOperation">
+			<wsdl:input message="wsat:Aborted"/>
+		</wsdl:operation>
+		<wsdl:operation name="ReadOnlyOperation">
+			<wsdl:input message="wsat:ReadOnly"/>
+		</wsdl:operation>
+		<wsdl:operation name="CommittedOperation">
+			<wsdl:input message="wsat:Committed"/>
+		</wsdl:operation>
+		<wsdl:operation name="ReplayOperation">
+			<wsdl:input message="wsat:Replay"/>
+		</wsdl:operation>
+	</wsdl:portType>
+	<wsdl:portType name="ParticipantPortType">
+		<wsdl:operation name="PrepareOperation">
+			<wsdl:input message="wsat:Prepare"/>
+		</wsdl:operation>
+		<wsdl:operation name="CommitOperation">
+			<wsdl:input message="wsat:Commit"/>
+		</wsdl:operation>
+		<wsdl:operation name="RollbackOperation">
+			<wsdl:input message="wsat:Rollback"/>
+		</wsdl:operation>
+	</wsdl:portType>
+	<!-- Optional Syncronous RPC Port Types -->
+	<wsdl:portType name="CompletionPortTypeRPC">
+		<wsdl:operation name="CommitOperation">
+			<wsdl:input message="wsat:Commit"/>
+			<wsdl:output message="wsat:Committed"/>
+		</wsdl:operation>
+		<wsdl:operation name="RollbackOperation">
+			<wsdl:input message="wsat:Rollback"/>
+			<wsdl:output message="wsat:Aborted"/>
+		</wsdl:operation>
+	</wsdl:portType>
+	<wsdl:portType name="ParticipantPortTypeRPC">
+		<wsdl:operation name="PrepareOperation">
+			<wsdl:input message="wsat:Prepare"/>
+			<wsdl:output message="wsat:PrepareResponse"/>
+		</wsdl:operation>
+		<wsdl:operation name="CommitOperation">
+			<wsdl:input message="wsat:Commit"/>
+			<wsdl:output message="wsat:Committed"/>
+		</wsdl:operation>
+		<wsdl:operation name="RollbackOperation">
+			<wsdl:input message="wsat:Rollback"/>
+			<wsdl:output message="wsat:Aborted"/>
+		</wsdl:operation>
+	</wsdl:portType>
+	<wsdl:portType name="CoordinatorPortTypeRPC">
+		<wsdl:operation name="ReplayOperation">
+			<wsdl:input message="wsat:Replay"/>
+			<wsdl:output message="wsat:ReplayResponse"/>
+		</wsdl:operation>
+		<wsdl:operation name="AbortedOperation">
+			<wsdl:input message="wsat:Aborted"/>
+		</wsdl:operation>
+		<wsdl:operation name="ReadOnlyOperation">
+			<wsdl:input message="wsat:ReadOnly"/>
+		</wsdl:operation>
+	</wsdl:portType>
+
+<!--
+
+<wsdl:binding name="CompletionCoordinatorPortTypeBinding" type="wsat:CompletionCoordinatorPortType">
+		<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+		<wsdl:operation name="CommitOperation">
+			<soap:operation soapAction="http://xxx"/>
+			<wsdl:input>
+				<soap:body use="literal"/>
+			</wsdl:input>
+		</wsdl:operation>
+		<wsdl:operation name="RollbackOperation">
+			<soap:operation soapAction="http://xxx"/>
+			<wsdl:input>
+				<soap:body use="literal"/>
+			</wsdl:input>
+		</wsdl:operation>
+</wsdl:binding>
+<wsdl:binding name="CompletionInitiatorPortTypeBinding" type="wsat:CompletionInitiatorPortType">
+		<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+		<wsdl:operation name="CommittedOperation">
+			<soap:operation soapAction="http://xxx"/>
+			<wsdl:input>
+				<soap:body use="literal"/>
+			</wsdl:input>
+		</wsdl:operation>
+		<wsdl:operation name="AbortedOperation">
+			<soap:operation soapAction="http://xxx"/>
+			<wsdl:input>
+				<soap:body use="literal"/>
+			</wsdl:input>
+		</wsdl:operation>
+</wsdl:binding>
+<wsdl:binding name="CoordinatorPortTypeBinding" type="wsat:CoordinatorPortType">
+		<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+		<wsdl:operation name="PreparedOperation">
+			<soap:operation soapAction="http://xxx"/>
+			<wsdl:input>
+				<soap:body use="literal"/>
+			</wsdl:input>
+		</wsdl:operation>
+		<wsdl:operation name="AbortedOperation">
+			<soap:operation soapAction="http://xxx"/>
+			<wsdl:input>
+				<soap:body use="literal"/>
+			</wsdl:input>
+		</wsdl:operation>
+		<wsdl:operation name="ReadOnlyOperation">
+			<soap:operation soapAction="http://xxx"/>
+			<wsdl:input>
+				<soap:body use="literal"/>
+			</wsdl:input>
+		</wsdl:operation>
+		<wsdl:operation name="CommittedOperation">
+			<soap:operation soapAction="http://xxx"/>
+			<wsdl:input>
+				<soap:body use="literal"/>
+			</wsdl:input>
+		</wsdl:operation>
+		<wsdl:operation name="ReplayOperation">
+			<soap:operation soapAction="http://xxx"/>
+			<wsdl:input>
+				<soap:body use="literal"/>
+			</wsdl:input>
+		</wsdl:operation>
+</wsdl:binding>
+<wsdl:binding name="ParticipantPortTypeBinding" type="wsat:ParticipantPortType">
+		<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+		<wsdl:operation name="PrepareOperation">
+			<soap:operation soapAction="http://xxx"/>
+			<wsdl:input>
+				<soap:body use="literal"/>
+			</wsdl:input>
+		</wsdl:operation>
+		<wsdl:operation name="CommitOperation">
+			<soap:operation soapAction="http://xxx"/>
+			<wsdl:input>
+				<soap:body use="literal"/>
+			</wsdl:input>
+		</wsdl:operation>
+		<wsdl:operation name="RollbackOperation">
+			<soap:operation soapAction="http://xxx"/>
+			<wsdl:input>
+				<soap:body use="literal"/>
+			</wsdl:input>
+		</wsdl:operation>
+</wsdl:binding>
+
+-->
+
+<wsdl:binding name="CompletionPortTypeRPCBinding" type="wsat:CompletionPortTypeRPC">
+		<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+		<wsdl:operation name="CommitOperation">
+			<soap:operation soapAction="http://xxx"/>
+			<wsdl:input>
+				<soap:body use="literal"/>
+			</wsdl:input>
+			<wsdl:output>
+				<soap:body use="literal"/>
+			</wsdl:output>
+		</wsdl:operation>
+		<wsdl:operation name="RollbackOperation">
+			<soap:operation soapAction="http://xxx"/>
+			<wsdl:input>
+				<soap:body use="literal"/>
+			</wsdl:input>
+			<wsdl:output>
+				<soap:body use="literal"/>
+			</wsdl:output>
+		</wsdl:operation>
+</wsdl:binding>
+
+<wsdl:binding name="CoordinatorPortTypeRPCBinding" type="wsat:CoordinatorPortTypeRPC">
+		<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+		<wsdl:operation name="ReplayOperation">
+			<soap:operation soapAction="http://xxx"/>
+			<wsdl:input>
+				<soap:body use="literal"/>
+			</wsdl:input>
+			<wsdl:output>
+				<soap:body use="literal"/>
+			</wsdl:output>
+		</wsdl:operation>
+		<wsdl:operation name="AbortedOperation">
+			<soap:operation soapAction="http://xxx"/>
+			<wsdl:input>
+				<soap:body use="literal"/>
+			</wsdl:input>
+			<wsdl:output>
+				<soap:body use="literal"/>
+			</wsdl:output>
+		</wsdl:operation>
+		<wsdl:operation name="ReadOnlyOperation">
+			<soap:operation soapAction="http://xxx"/>
+			<wsdl:input>
+				<soap:body use="literal"/>
+			</wsdl:input>
+			<wsdl:output>
+				<soap:body use="literal"/>
+			</wsdl:output>
+		</wsdl:operation>
+</wsdl:binding>
+
+<wsdl:binding name="ParticipantPortTypeRPCBinding" type="wsat:ParticipantPortTypeRPC">
+		<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+		<wsdl:operation name="PrepareOperation">
+			<soap:operation soapAction="http://xxx"/>
+			<wsdl:input>
+				<soap:body use="literal"/>
+			</wsdl:input>
+			<wsdl:output>
+				<soap:body use="literal"/>
+			</wsdl:output>
+		</wsdl:operation>
+		<wsdl:operation name="CommitOperation">
+			<soap:operation soapAction="http://xxx"/>
+			<wsdl:input>
+				<soap:body use="literal"/>
+			</wsdl:input>
+			<wsdl:output>
+				<soap:body use="literal"/>
+			</wsdl:output>
+		</wsdl:operation>
+		<wsdl:operation name="RollbackOperation">
+			<soap:operation soapAction="http://xxx"/>
+			<wsdl:input>
+				<soap:body use="literal"/>
+			</wsdl:input>
+			<wsdl:output>
+				<soap:body use="literal"/>
+			</wsdl:output>
+		</wsdl:operation>
+</wsdl:binding>
+
+
+
+<wsdl:service name="xxx">
+<!--
+   		<wsdl:port binding="wsat:CompletionCoordinatorPortTypeBinding" name="CompletionCoordinator">
+      			<soap:address location="http://localhost:8081/axis/services/CompletionCoordinator"/>
+    		</wsdl:port>
+		<wsdl:port binding="wsat:CompletionInitiatorPortTypeBinding" name="CompletionInitiator">
+      			<soap:address location="http://localhost:8081/axis/services/CompletionInitiator"/>
+    		</wsdl:port>
+		<wsdl:port binding="wsat:CoordinatorPortTypeBinding" name="Coordinator">
+      			<soap:address location="http://localhost:8081/axis/services/Coordinator"/>
+    		</wsdl:port>
+		<wsdl:port binding="wsat:ParticipantPortTypeBinding" name="Participant">
+      			<soap:address location="http://localhost:8081/axis/services/Participant"/>
+    		</wsdl:port>
+-->    		
+		<wsdl:port binding="wsat:ParticipantPortTypeRPCBinding" name="ParticipantRPC">
+      			<soap:address location="http://localhost:8081/axis/services/ParticipantRPC"/>
+   		</wsdl:port>
+		<wsdl:port binding="wsat:CoordinatorPortTypeRPCBinding" name="CoordinatorRPC">
+      			<soap:address location="http://localhost:8081/axis/services/CoordinatorRPC"/>
+   		</wsdl:port>
+		<wsdl:port binding="wsat:CompletionPortTypeRPCBinding" name="CompletionRPC">
+   			<soap:address location="http://localhost:8081/axis/services/CompletionRPC"/>
+   		</wsdl:port>
+</wsdl:service>
+
+</wsdl:definitions>

Added: webservices/axis/trunk/java/modules/wsdl/test-resources/wsat.xsd
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/test-resources/wsat.xsd?rev=230967&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/test-resources/wsat.xsd (added)
+++ webservices/axis/trunk/java/modules/wsdl/test-resources/wsat.xsd Mon Aug  8 21:52:16 2005
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- 
+Legal Disclaimer
+
+The presentation, distribution or other dissemination of the information 
+contained in this specification is not a license, either expressly or impliedly, 
+to any intellectual property owned or controlled by BEA or IBM or Microsoft and\or any other 
+third party.  BEA and IBM and Microsoft and\or any other third party may have patents, patent 
+applications, trademarks, copyrights, or other intellectual property rights 
+covering subject matter in this document.  The furnishing of this document 
+does not give you any license to BEA's and IBM's and Microsoft's or any other third party's patents, 
+trademarks, copyrights, or other intellectual property.
+
+This specification and the information contained herein is provided on an "AS IS"
+ basis and to the maximum extent permitted by applicable law, BEA and IBM and Microsoft provides 
+the document AS IS AND WITH ALL FAULTS, and hereby disclaims all other warranties 
+and conditions, either express, implied or statutory, including, but not limited 
+to, any (if any) implied warranties, duties or conditions of merchantability, of 
+fitness for a particular purpose, of accuracy or completeness of responses, of 
+results, of workmanlike effort, of lack of viruses, and of lack of negligence, 
+all with regard to the document. ALSO, THERE IS NO WARRANTY OR CONDITION OF 
+TITLE, QUIET ENJOYMENT, QUIET POSSESSION, CORRESPONDENCE TO DESCRIPTION OR 
+NON-INFRINGEMENT OF ANY INTELLECTUAL PROPERTY RIGHTS WITH REGARD TO THE DOCUMENT.
+
+IN NO EVENT WILL BEA or IBM or MICROSOFT BE LIABLE TO ANY OTHER PARTY FOR THE COST OF PROCURING 
+SUBSTITUTE GOODS OR SERVICES, LOST PROFITS, LOSS OF USE, LOSS OF DATA, OR ANY 
+INCIDENTAL, CONSEQUENTIAL, DIRECT, INDIRECT, OR SPECIAL DAMAGES WHETHER UNDER 
+CONTRACT, TORT, WARRANTY, OR OTHERWISE, ARISING IN ANY WAY OUT OF THIS OR ANY 
+OTHER AGREEMENT RELATING TO THIS DOCUMENT, WHETHER OR NOT SUCH PARTY HAD ADVANCE 
+NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.
+
+Copyright Notice
+
+Copyright 2001, 2002 BEA Systems and IBM Corporation and Microsoft Corporation. All rights reserved.
+-->
+<xsd:schema targetNamespace="http://schemas.xmlsoap.org/ws/2003/09/wsat" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsat="http://schemas.xmlsoap.org/ws/2003/09/wsat" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0">
+	<xsd:complexType name="Notification">
+		<xsd:sequence>
+			<xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
+		</xsd:sequence>
+		<xsd:anyAttribute namespace="##other" processContents="lax"/>
+	</xsd:complexType>
+	<xsd:element name="Prepare" type="wsat:Notification"/>
+	<xsd:element name="Prepared" type="wsat:Notification"/>
+	<xsd:element name="Aborted" type="wsat:Notification"/>
+	<xsd:element name="ReadOnly" type="wsat:Notification"/>
+	<xsd:element name="Commit" type="wsat:Notification"/>
+	<xsd:element name="Rollback" type="wsat:Notification"/>
+	<xsd:element name="Committed" type="wsat:Notification"/>
+	<xsd:element name="Replay" type="wsat:Notification"/>
+	<xsd:simpleType name="Vote">
+		<xsd:restriction base="xsd:string">
+			<xsd:enumeration value="VoteCommit"/>
+			<xsd:enumeration value="VoteRollback"/>
+			<xsd:enumeration value="VoteReadOnly"/>
+		</xsd:restriction>
+	</xsd:simpleType>
+	<xsd:element name="PrepareResponse">
+		<xsd:complexType>
+			<xsd:attribute name="vote" type="wsat:Vote"/>
+		</xsd:complexType>
+	</xsd:element>
+	<xsd:simpleType name="Outcome">
+		<xsd:restriction base="xsd:string">
+			<xsd:enumeration value="Commit"/>
+			<xsd:enumeration value="Rollback"/>
+		</xsd:restriction>
+	</xsd:simpleType>
+	<xsd:element name="ReplayResponse">
+		<xsd:complexType>
+			<xsd:attribute name="outcome" type="wsat:Outcome"/>
+		</xsd:complexType>
+	</xsd:element>
+	<xsd:simpleType name="ErrorCodes">
+		<xsd:restriction base="xsd:QName">
+			<xsd:enumeration value="wsat:InconsistentInternalState"/>
+		</xsd:restriction>
+	</xsd:simpleType>
+</xsd:schema>

Added: 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=230967&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/test/org/apache/axis2/wsdl/codegen/WSDL2JavaTest.java (added)
+++ webservices/axis/trunk/java/modules/wsdl/test/org/apache/axis2/wsdl/codegen/WSDL2JavaTest.java Mon Aug  8 21:52:16 2005
@@ -0,0 +1,194 @@
+package org.apache.axis2.wsdl.codegen;
+
+import junit.framework.TestCase;
+
+import java.util.Map;
+import java.util.HashMap;
+import java.io.File;
+
+import org.apache.tools.ant.taskdefs.Javac;
+import org.apache.tools.ant.types.Path;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.Target;
+
+/*
+* 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 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 WSDL_BASE_DIR = "./test-resources/";
+    public static final String CLASSES_DIR = "/target/classes/";
+    private String[] moduleNames={"xml","common","core"};
+
+
+    protected void setUp() throws Exception {
+        File outputFile = new File(OUTPUT_LOCATION);
+        if (outputFile.exists() && outputFile.isDirectory()){
+            deleteDir(outputFile);
+            outputFile.mkdir();
+        }else{
+            outputFile.mkdir();
+        }
+    }
+
+    protected void tearDown() throws Exception {
+        File outputFile = new File(OUTPUT_LOCATION);
+        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.
+    private boolean deleteDir(File dir) {
+        if (dir.isDirectory()) {
+            String[] children = dir.list();
+            for (int i=0; i<children.length; i++) {
+                boolean success = deleteDir(new File(dir, children[i]));
+                if (!success) {
+                    return false;
+                }
+            }
+        }
+
+        // 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 interoptestdoclit.wsdl
+     */
+    public void testCodeGenerationWSCOOR(){
+
+        try {
+            generateAndCompile("interoptestdoclit.wsdl");
+        } catch (CodeGenerationException e) {
+            fail("Exception while codegeneration 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();
+    }
+    private void codeGenerate(String wsdlFile) throws CodeGenerationException {
+        //create the option map
+        Map optionMap = fillOptionMap(wsdlFile);
+        CommandLineOptionParser parser =
+                new CommandLineOptionParser(optionMap);
+        new CodeGenerationEngine(parser).generate();
+    }
+
+    private void compile(){
+        //using the ant javac task for compilation
+        Javac javaCompiler = new Javac();
+        Project codeGenProject = new Project();
+        Target compileTarget = new Target();
+
+        compileTarget.setName("compile");
+        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) ;
+        classPath.addExisting(classPath.concatSystemClasspath(),false);
+        for (int i = 0; i < moduleNames.length; i++) {
+            classPath.add(new Path(codeGenProject,"../modules/"+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) ;
+        sourcePath.setLocation(outputLocationFile);
+        javaCompiler.setSrcdir(sourcePath);
+
+        javaCompiler.setDestdir(outputLocationFile);
+
+        codeGenProject.executeTarget("compile");
+
+    }
+
+    /**
+     *
+     */
+    private Map fillOptionMap(String wsdlFileName) {
+        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}));
+        //server side option is on
+        optionMap.put(
+                CommandLineOptionConstants.SERVER_SIDE_CODE_OPTION,
+                new CommandLineOption(
+                        CommandLineOptionConstants.SERVER_SIDE_CODE_OPTION,
+                        new String[0]));
+        // descriptor option is on
+        optionMap.put(
+                CommandLineOptionConstants.GENERATE_SERVICE_DESCRIPTION_OPTION,
+                new CommandLineOption(CommandLineOptionConstants.GENERATE_SERVICE_DESCRIPTION_OPTION,
+                        new String[0]));
+
+        //todo Make this work
+        //test case option is on
+//        optionMap.put(
+//                CommandLineOptionConstants.GENERATE_TEST_CASE_OPTION,
+//                new CommandLineOption(
+//                        CommandLineOptionConstants.GENERATE_TEST_CASE_OPTION,
+//                        new String[0]));
+        //databinding is default
+
+        return optionMap;
+    }
+
+
+}