axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r453486 [1/4] - in /webservices/axis2/trunk/java/modules: codegen/src/org/apache/axis2/wsdl/codegen/emitter/ codegen/src/org/apache/axis2/wsdl/template/java/ kernel/src/org/apache/axis2/description/ kernel/src/org/apache/axis2/wsdl/
Date Fri, 06 Oct 2006 04:07:52 GMT
Author: dims
Date: Thu Oct  5 21:07:51 2006
New Revision: 453486

URL: http://svn.apache.org/viewvc?view=rev&rev=453486
Log:
Fix for AXIS2-1277 - Exceptions of void-operations will not get delivered by the client

Ended up fixing w2j/codegen for Robust-In.



Modified:
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceTemplate.xsl
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/MessageReceiverTemplate.xsl
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/TestClassTemplate.xsl
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisOperationFactory.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService2OM.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/wsdl/WSDLUtil.java

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java?view=diff&rev=453486&r1=453485&r2=453486
==============================================================================
--- 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 Thu Oct  5 21:07:51 2006
@@ -112,6 +112,8 @@
         mepToClassMap = new HashMap();
         mepToClassMap.put(WSDLConstants.WSDL20_2004Constants.MEP_URI_IN_ONLY, "org.apache.axis2.receivers.AbstractInMessageReceiver");
         mepToClassMap.put(WSDLConstants.WSDL20_2006Constants.MEP_URI_IN_ONLY, "org.apache.axis2.receivers.AbstractInMessageReceiver");
+        mepToClassMap.put(WSDLConstants.WSDL20_2004Constants.MEP_URI_ROBUST_IN_ONLY, "org.apache.axis2.receivers.AbstractRobustInMessageReceiver");
+        mepToClassMap.put(WSDLConstants.WSDL20_2006Constants.MEP_URI_ROBUST_IN_ONLY, "org.apache.axis2.receivers.AbstractRobustInMessageReceiver");
         mepToClassMap.put(WSDLConstants.WSDL20_2004Constants.MEP_URI_IN_OUT, "org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver");
         mepToClassMap.put(WSDLConstants.WSDL20_2006Constants.MEP_URI_IN_OUT, "org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver");
 
@@ -119,6 +121,8 @@
         mepToSuffixMap = new HashMap();
         mepToSuffixMap.put(WSDLConstants.WSDL20_2004Constants.MEP_URI_IN_ONLY, MESSAGE_RECEIVER_SUFFIX + "InOnly");
         mepToSuffixMap.put(WSDLConstants.WSDL20_2006Constants.MEP_URI_IN_ONLY, MESSAGE_RECEIVER_SUFFIX + "InOnly");
+        mepToSuffixMap.put(WSDLConstants.WSDL20_2004Constants.MEP_URI_ROBUST_IN_ONLY, MESSAGE_RECEIVER_SUFFIX + "InOnly");
+        mepToSuffixMap.put(WSDLConstants.WSDL20_2006Constants.MEP_URI_ROBUST_IN_ONLY, MESSAGE_RECEIVER_SUFFIX + "InOnly");
         mepToSuffixMap.put(WSDLConstants.WSDL20_2004Constants.MEP_URI_IN_OUT, MESSAGE_RECEIVER_SUFFIX + "InOut");
         mepToSuffixMap.put(WSDLConstants.WSDL20_2006Constants.MEP_URI_IN_OUT, MESSAGE_RECEIVER_SUFFIX + "InOut");
         //register the other types as necessary
@@ -1538,8 +1542,10 @@
 
         methodElement.appendChild(getInputElement(doc,
                 axisOperation, soapHeaderInputParameterList));
-        methodElement.appendChild(getOutputElement(doc,
-                axisOperation, soapHeaderOutputParameterList));
+        if(WSDLUtil.isOutputPresentForMEP(axisOperation.getMessageExchangePattern())){
+            methodElement.appendChild(getOutputElement(doc,
+                    axisOperation, soapHeaderOutputParameterList));
+        }
         methodElement.appendChild(getFaultElement(doc,
                 axisOperation));
         return methodElement;

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl?view=diff&rev=453486&r1=453485&r2=453486
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl Thu Oct  5 21:07:51 2006
@@ -68,6 +68,9 @@
                 <xsl:when test="@mep='10'">
                     __operation = new org.apache.axis2.description.OutOnlyAxisOperation();
                 </xsl:when>
+                <xsl:when test="@mep='11'">
+                    __operation = new org.apache.axis2.description.RobustOutOnlyAxisOperation();
+                </xsl:when>
                 <xsl:otherwise>
                    __operation = new org.apache.axis2.description.OutInAxisOperation();
                 </xsl:otherwise>
@@ -553,7 +556,7 @@
 
 
             <!-- Start of in only mep-->
-            <xsl:if test="$mep='10'"> <!-- These constants can be found in org.apache.axis2.wsdl.WSDLConstants -->
+            <xsl:if test="$mep='10' or $mep='11'"> <!-- These constants can be found in org.apache.axis2.wsdl.WSDLConstants -->
                 <!-- 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:variable name="inputcount" select="count(input/param[@location='body' and @type!=''])"/>
@@ -581,8 +584,16 @@
                         <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{
+                ) throws java.rmi.RemoteException
+                <!--add the faults-->
+                <xsl:if test="$mep='11'">
+                    <xsl:for-each select="fault/param[@type!='']">
+                        ,<xsl:value-of select="@name"/>
+                    </xsl:for-each>
+                </xsl:if>
+                {
 
+                <xsl:if test="$mep='11'">try {</xsl:if>
                 org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[<xsl:value-of select="position()-1"/>].getName());
                 _operationClient.getOptions().setAction("<xsl:value-of select="$soapAction"/>");
                 _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true);
@@ -669,6 +680,58 @@
             _operationClient.addMessageContext(_messageContext);
 
              _operationClient.execute(true);
+           <xsl:if test="$mep='11'">
+               }catch(org.apache.axis2.AxisFault f){
+                  org.apache.axiom.om.OMElement faultElt = f.getDetail();
+                  if (faultElt!=null){
+                      if (faultExeptionNameMap.containsKey(faultElt.getQName())){
+                          //make the fault by reflection
+                          try{
+                              java.lang.String exceptionClassName = (java.lang.String)faultExeptionClassNameMap.get(faultElt.getQName());
+                              java.lang.Class exceptionClass = java.lang.Class.forName(exceptionClassName);
+                              java.lang.Exception ex=
+                                      (java.lang.Exception) exceptionClass.newInstance();
+                              //message class
+                              java.lang.String messageClassName = (java.lang.String)faultMessageMap.get(faultElt.getQName());
+                              java.lang.Class messageClass = java.lang.Class.forName(messageClassName);
+                              java.lang.Object messageObject = fromOM(faultElt,messageClass,null);
+                              java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage",
+                                         new java.lang.Class[]{messageClass});
+                              m.invoke(ex,new java.lang.Object[]{messageObject});
+                              <xsl:for-each select="fault/param">
+                              if (ex instanceof <xsl:value-of select="@name"/>){
+                                throw (<xsl:value-of select="@name"/>)ex;
+                              }
+                              </xsl:for-each>
+
+                              throw new java.rmi.RemoteException(ex.getMessage(), ex);
+                          }catch(java.lang.ClassCastException e){
+                             // we cannot intantiate the class - throw the original Axis fault
+                              throw f;
+                          } catch (java.lang.ClassNotFoundException e) {
+                              // we cannot intantiate the class - throw the original Axis fault
+                              throw f;
+                          }catch (java.lang.NoSuchMethodException e) {
+                              // we cannot intantiate the class - throw the original Axis fault
+                              throw f;
+                          } catch (java.lang.reflect.InvocationTargetException e) {
+                              // we cannot intantiate the class - throw the original Axis fault
+                              throw f;
+                          }  catch (java.lang.IllegalAccessException e) {
+                              // we cannot intantiate the class - throw the original Axis fault
+                              throw f;
+                          }   catch (java.lang.InstantiationException e) {
+                              // we cannot intantiate the class - throw the original Axis fault
+                              throw f;
+                          }
+                      }else{
+                          throw f;
+                      }
+                  }else{
+                      throw f;
+                  }
+              }
+           </xsl:if>
              return;
            }
             </xsl:if>

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceTemplate.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceTemplate.xsl?view=diff&rev=453486&r1=453485&r2=453486
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceTemplate.xsl (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceTemplate.xsl Thu Oct  5 21:07:51 2006
@@ -1,149 +1,162 @@
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-    <xsl:output method="text"/>
-
-     <!-- import the databinding template-->
-    <xsl:include href="databindsupporter"/>
-    <!-- import the other templates for databinding
-         Note  -  these names would be handled by a special
-         URI resolver during the xslt transformations
-     -->
-    <xsl:include href="externalTemplate"/>
-
-
-    <xsl:template match="/interface">
-    <xsl:variable name="isSync"><xsl:value-of select="@isSync"/></xsl:variable>
-    <xsl:variable name="isAsync"><xsl:value-of select="@isAsync"/></xsl:variable>
-    <xsl:variable name="callbackname"><xsl:value-of select="@callbackname"/></xsl:variable>
-    <xsl:variable name="package"><xsl:value-of select="@package"/></xsl:variable>
-
-    /**
-     * <xsl:value-of select="@name"/>.java
-     *
-     * This file was auto-generated from WSDL
-     * by the Apache Axis2 version: #axisVersion# #today#
-     */
-    package <xsl:value-of select="$package"/>;
-
-    /*
-     *  <xsl:value-of select="@name"/> java interface
-     */
-
-    public interface <xsl:value-of select="@name"></xsl:value-of> {
-          <xsl:for-each select="method">
-            <!-- Code for in-out mep -->
-         <xsl:if test="@mep='12'">
-         <xsl:variable name="outputtype"><xsl:value-of select="output/param/@type"></xsl:value-of></xsl:variable>
-
-        <!-- start of the sync block -->                                          
-         <xsl:if test="$isSync='1'">
-           <xsl:choose>
-             <xsl:when test="@usdbimpl='true'">
-             <!-- Unwrap input parameters to match databinding generated method -->
-        /**
-         * Auto generated method signatures
-         <xsl:for-each select="input/param/param[@type!='']">* @param <xsl:value-of select="@name"></xsl:value-of></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/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
-          <!--add the faults-->
-          <xsl:for-each select="fault/param/param[@type!='']">
-          ,<xsl:value-of select="@name"/>
-          </xsl:for-each>             
-             ;
-             </xsl:when>
-             <xsl:otherwise>
-             <!-- Use object as wrapper for input parameters -->
-        /**
-         * Auto generated method signatures
-         <xsl:for-each select="input/param[@type!='']">* @param <xsl:value-of select="@name"></xsl:value-of></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[@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
-          <!--add the faults-->
-          <xsl:for-each select="fault/param[@type!='']">
-          ,<xsl:value-of select="@name"/>
-          </xsl:for-each>             
-             ;
-             </xsl:otherwise>
-           </xsl:choose>
-        <!-- end of the sync block -->
-        </xsl:if>
-
-       <!-- start of the async block -->
-        <xsl:if test="$isAsync='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:if></xsl:for-each>
-          */
-
-        public void start<xsl:value-of select="@name"/>(
-         <xsl:choose>
-           <xsl:when test="@usdbimpl='true'">
-           <!-- Unwrap input parameters to match databinding generated method -->
-         <xsl:variable name="paramCount"><xsl:value-of select="count(input/param/param[@type!=''])"></xsl:value-of></xsl:variable>
-               <xsl:for-each select="input/param/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="$paramCount>0">,</xsl:if>final <xsl:value-of select="$package"/>.<xsl:value-of select="$callbackname"/> callback) throws java.rmi.RemoteException;
-           </xsl:when>
-           <xsl:otherwise>
-           <!-- Use object as wrapper for input parameters -->
-         <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="$paramCount>0">,</xsl:if>final <xsl:value-of select="$package"/>.<xsl:value-of select="$callbackname"/> callback) throws java.rmi.RemoteException;
-           </xsl:otherwise>
-         </xsl:choose>
-<!-- end of async block-->
-
-     </xsl:if>
-     </xsl:if>
-        <!-- Code for in-only mep -->
-       <xsl:if test="@mep='10'">
-
-       <!-- For in-only meps there would not be any asynchronous methods since there is no output -->
-         /**
-         * Auto generated method signature
-         <xsl:choose>
-           <xsl:when test="@usdbimpl='true'">
-           <!-- Unwrap input parameters to match databinding generated method -->
-         <xsl:for-each select="input/param/param">
-         <xsl:if test="@type!=''">*@param <xsl:value-of select="@name"></xsl:value-of><xsl:text>
-         </xsl:text></xsl:if></xsl:for-each>
-         */
-         public  void
-        <xsl:text> </xsl:text><xsl:value-of select="@name"/>(
-         <xsl:for-each select="input/param/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:when>
-           <xsl:otherwise>
-           <!-- Use object as wrapper for input parameters -->
-         <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>
-         */
-         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>) throws java.rmi.RemoteException;
-
-           </xsl:otherwise>
-         </xsl:choose>
-        </xsl:if>
-
-      </xsl:for-each>
-
-       <!-- Apply other templates --> 
-       //<xsl:apply-templates/>
-       }
-    </xsl:template>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+    <xsl:output method="text"/>
+
+     <!-- import the databinding template-->
+    <xsl:include href="databindsupporter"/>
+    <!-- import the other templates for databinding
+         Note  -  these names would be handled by a special
+         URI resolver during the xslt transformations
+     -->
+    <xsl:include href="externalTemplate"/>
+
+
+    <xsl:template match="/interface">
+    <xsl:variable name="isSync"><xsl:value-of select="@isSync"/></xsl:variable>
+    <xsl:variable name="isAsync"><xsl:value-of select="@isAsync"/></xsl:variable>
+    <xsl:variable name="callbackname"><xsl:value-of select="@callbackname"/></xsl:variable>
+    <xsl:variable name="package"><xsl:value-of select="@package"/></xsl:variable>
+
+    /**
+     * <xsl:value-of select="@name"/>.java
+     *
+     * This file was auto-generated from WSDL
+     * by the Apache Axis2 version: #axisVersion# #today#
+     */
+    package <xsl:value-of select="$package"/>;
+
+    /*
+     *  <xsl:value-of select="@name"/> java interface
+     */
+
+    public interface <xsl:value-of select="@name"></xsl:value-of> {
+          <xsl:for-each select="method">
+            <!-- Code for in-out mep -->
+         <xsl:if test="@mep='12'">
+         <xsl:variable name="outputtype"><xsl:value-of select="output/param/@type"></xsl:value-of></xsl:variable>
+
+        <!-- start of the sync block -->                                          
+         <xsl:if test="$isSync='1'">
+           <xsl:choose>
+             <xsl:when test="@usdbimpl='true'">
+             <!-- Unwrap input parameters to match databinding generated method -->
+        /**
+         * Auto generated method signatures
+         <xsl:for-each select="input/param/param[@type!='']">* @param <xsl:value-of select="@name"></xsl:value-of></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/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
+          <!--add the faults-->
+          <xsl:for-each select="fault/param/param[@type!='']">
+          ,<xsl:value-of select="@name"/>
+          </xsl:for-each>             
+             ;
+             </xsl:when>
+             <xsl:otherwise>
+             <!-- Use object as wrapper for input parameters -->
+        /**
+         * Auto generated method signatures
+         <xsl:for-each select="input/param[@type!='']">* @param <xsl:value-of select="@name"></xsl:value-of></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[@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
+          <!--add the faults-->
+          <xsl:for-each select="fault/param[@type!='']">
+          ,<xsl:value-of select="@name"/>
+          </xsl:for-each>             
+             ;
+             </xsl:otherwise>
+           </xsl:choose>
+        <!-- end of the sync block -->
+        </xsl:if>
+
+       <!-- start of the async block -->
+        <xsl:if test="$isAsync='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:if></xsl:for-each>
+          */
+
+        public void start<xsl:value-of select="@name"/>(
+         <xsl:choose>
+           <xsl:when test="@usdbimpl='true'">
+           <!-- Unwrap input parameters to match databinding generated method -->
+         <xsl:variable name="paramCount"><xsl:value-of select="count(input/param/param[@type!=''])"></xsl:value-of></xsl:variable>
+               <xsl:for-each select="input/param/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="$paramCount>0">,</xsl:if>final <xsl:value-of select="$package"/>.<xsl:value-of select="$callbackname"/> callback) throws java.rmi.RemoteException;
+           </xsl:when>
+           <xsl:otherwise>
+           <!-- Use object as wrapper for input parameters -->
+         <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="$paramCount>0">,</xsl:if>final <xsl:value-of select="$package"/>.<xsl:value-of select="$callbackname"/> callback) throws java.rmi.RemoteException;
+           </xsl:otherwise>
+         </xsl:choose>
+<!-- end of async block-->
+
+     </xsl:if>
+     </xsl:if>
+        <!-- Code for in-only mep -->
+       <xsl:if test="@mep='10' or @mep='11'">
+       <xsl:variable name="mep"><xsl:value-of select="@mep"/></xsl:variable>
+
+       <!-- For in-only meps there would not be any asynchronous methods since there is no output -->
+         /**
+         * Auto generated method signature
+         <xsl:choose>
+           <xsl:when test="@usdbimpl='true'">
+           <!-- Unwrap input parameters to match databinding generated method -->
+         <xsl:for-each select="input/param/param">
+         <xsl:if test="@type!=''">*@param <xsl:value-of select="@name"></xsl:value-of><xsl:text>
+         </xsl:text></xsl:if></xsl:for-each>
+         */
+         public  void
+        <xsl:text> </xsl:text><xsl:value-of select="@name"/>(
+         <xsl:for-each select="input/param/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:if test="$mep='11'"><!--add the faults-->
+               <xsl:for-each select="fault/param[@type!='']">
+               ,<xsl:value-of select="@name"/>
+               </xsl:for-each>
+               </xsl:if>
+               ;
+           </xsl:when>
+           <xsl:otherwise>
+           <!-- Use object as wrapper for input parameters -->
+         <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>
+         */
+         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>) throws java.rmi.RemoteException
+               <xsl:if test="$mep='11'"><!--add the faults-->
+               <xsl:for-each select="fault/param[@type!='']">
+               ,<xsl:value-of select="@name"/>
+               </xsl:for-each>
+               </xsl:if>
+               ;
+
+           </xsl:otherwise>
+         </xsl:choose>
+        </xsl:if>
+
+      </xsl:for-each>
+
+       <!-- Apply other templates --> 
+       //<xsl:apply-templates/>
+       }
+    </xsl:template>
    </xsl:stylesheet>

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/MessageReceiverTemplate.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/MessageReceiverTemplate.xsl?view=diff&rev=453486&r1=453485&r2=453486
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/MessageReceiverTemplate.xsl (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/MessageReceiverTemplate.xsl Thu Oct  5 21:07:51 2006
@@ -1,330 +1,495 @@
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-    <xsl:output method="text"/>
-
-    <!-- include the databind supporters  -->
-    <xsl:include href="databindsupporter"/>
-    <!-- import the other templates for databinding
-           Note  -  these names would be handled by a special
-           URI resolver during the xslt transformations
-       -->
-    <xsl:include href="externalTemplate"/>
-
-
-    <!--Template for in out message receiver -->
-    <xsl:template match="/interface[@basereceiver='org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver']">
-
-        <xsl:variable name="skeletonname"><xsl:value-of select="@skeletonInterfaceName"/></xsl:variable>
-        <xsl:variable name="dbsupportpackage"><xsl:value-of select="@dbsupportpackage"/></xsl:variable>
-
-        /**
-        * <xsl:value-of select="@name"/>.java
-        *
-        * This file was auto-generated from WSDL
-        * by the Apache Axis2 version: #axisVersion# #today#
-        */
-        package <xsl:value-of select="@package"/>;
-
-        /**
-        *  <xsl:value-of select="@name"/> message receiver
-        */
-
-        public class <xsl:value-of select="@name"/> extends <xsl:value-of select="@basereceiver"/>{
-
-
-        public void invokeBusinessLogic(org.apache.axis2.context.MessageContext msgContext, org.apache.axis2.context.MessageContext newMsgContext)
-        throws org.apache.axis2.AxisFault{
-
-        try {
-
-        // get the implementation class for the Web Service
-        Object obj = getTheImplementationObject(msgContext);
-
-        //Inject the Message Context if it is asked for
-        org.apache.axis2.engine.DependencyManager.configureBusinessLogicProvider(obj, msgContext.getOperationContext());
-
-        <xsl:value-of select="$skeletonname"/> skel = (<xsl:value-of select="$skeletonname"/>)obj;
-        //Out Envelop
-        org.apache.axiom.soap.SOAPEnvelope envelope = null;
-        //Find the axisOperation that has been set by the Dispatch phase.
-        org.apache.axis2.description.AxisOperation op = msgContext.getOperationContext().getAxisOperation();
-        if (op == null) {
-        throw new org.apache.axis2.AxisFault("Operation is not located, if this is doclit style the SOAP-ACTION should specified via the SOAP Action to use the RawXMLProvider");
-        }
-
-        java.lang.String methodName;
-        if(op.getName() != null &amp; (methodName = op.getName().getLocalPart()) != null){
-
-        <xsl:for-each select="method">
-
-            if("<xsl:value-of select="@name"/>".equals(methodName)){
-
-            <!-- If usedbmethod attribute present, gives name of method to call for implementation -->
-            <xsl:variable name="usedbmethod"><xsl:value-of select="@usedbmethod"/></xsl:variable>
-
-
-
-            <xsl:choose>
-                <xsl:when test="string-length(normalize-space($usedbmethod))=0">
-
-                    <xsl:variable name="namespace"><xsl:value-of select="@namespace"/></xsl:variable>
-
-                    <xsl:variable name="name"><xsl:value-of select="@name"/></xsl:variable>
-                    <xsl:variable name="style"><xsl:value-of select="@style"/></xsl:variable>
-
-                    <xsl:variable name="returntype"><xsl:value-of select="output/param/@type"/></xsl:variable>
-                    <xsl:variable name="returnvariable"><xsl:value-of select="output/param/@name"/></xsl:variable>
-
-                    <xsl:if test="$returntype!=''">
-                        <xsl:value-of select="$returntype"/>
-                        <xsl:text> </xsl:text>
-                        <xsl:value-of select="$returnvariable"/> = null;
-                    </xsl:if>
-
-                    <xsl:choose>
-                        <!-- We really don't need to make a difference between these-->
-                        <xsl:when test="$style='document' or $style='rpc'">
-                            //doc style
-                            <xsl:variable name="inputcount" select="count(input/param[@location='body' and @type!=''])"/>
-                            <xsl:variable name="inputtype" select="input/param[@location='body' and @type!='']/@type"/>
-
-                            <xsl:choose>
-                                <xsl:when test="$inputcount=1">
-                                     <xsl:value-of select="$inputtype"/> wrappedParam =
-                                                 (<xsl:value-of select="$inputtype"/>)fromOM(
-                        msgContext.getEnvelope().getBody().getFirstElement(),
-                        <xsl:value-of select="$inputtype"/>.class,
-                        getEnvelopeNamespaces(msgContext.getEnvelope()));
-                                    <!-- Even when the parameters are 1 we have to see whether we have the
-                                  wrapped parameters -->
-                                   <xsl:variable name="inputWrappedCount" select="count(input/param[@location='body' and @type!='']/param)"/>
-                                    <xsl:choose>
-                                        <xsl:when test="$inputWrappedCount &gt; 0">
-                                            <!-- generate the references. the getters need to be
-                                                generated by the databinding-->
-                                            <!--<xsl:for-each select="input/param[@location='body' and @type!='']/param">-->
-                                                <!--<xsl:value-of select="@type"/> param<xsl:value-of select="position()"/>-->
-                                                        <!--= get<xsl:value-of select="@partname"/>(wrappedParam);-->
-                                            <!--</xsl:for-each>-->
-
-                                            <xsl:if test="$returntype!=''"><xsl:value-of select="$returnvariable"/> =</xsl:if>
-                                       skel.<xsl:value-of select="@name"/>(
-                                            <xsl:for-each select="input/param[@location='body' and @type!='']/param">
-                                                <xsl:if test="position() &gt; 1">,</xsl:if>
-                                                get<xsl:value-of select="@partname"/>(wrappedParam)
-                                            </xsl:for-each>
-
-                                        );
-
-                                        </xsl:when>
-                                        <xsl:otherwise>
-                                            <xsl:if test="$returntype!=''"><xsl:value-of select="$returnvariable"/> =</xsl:if>
-                                             skel.<xsl:value-of select="@name"/>(wrappedParam) ;
-                                        </xsl:otherwise>
-                                    </xsl:choose>
-                                </xsl:when>
-                                <xsl:otherwise>
-                                     <xsl:if test="$returntype!=''"><xsl:value-of select="$returnvariable"/> =</xsl:if>
-                                     skel.<xsl:value-of select="@name"/>();
-                                </xsl:otherwise>
-                            </xsl:choose>
-
-                            <xsl:choose>
-                                <xsl:when test="$returntype!=''">
-                                    envelope = toEnvelope(getSOAPFactory(msgContext), <xsl:value-of select="$returnvariable"/>, false);
-                                </xsl:when>
-                                <xsl:otherwise>
-                                    envelope = getSOAPFactory(msgContext).getDefaultEnvelope();
-                                </xsl:otherwise>
-                            </xsl:choose>
-                        </xsl:when>
-
-                        <xsl:otherwise>
-                            //Unknown style!! No code is generated
-                            throw new UnsupportedOperationException("Unknown Style");
-                        </xsl:otherwise>
-                    </xsl:choose>
-                </xsl:when>
-
-                <xsl:otherwise>
-                    envelope = <xsl:value-of select="$usedbmethod"/>(msgContext.getEnvelope().getBody().getFirstElement(), skel, getSOAPFactory(msgContext));
-                </xsl:otherwise>
-
-            </xsl:choose>
-
-            }
-        </xsl:for-each>
-
-        newMsgContext.setEnvelope(envelope);
-        }
-        <xsl:for-each select="fault-list/fault">
-            <xsl:if test="position()=1">}</xsl:if>catch (<xsl:value-of select="@name"/> e) {
-
-            org.apache.axis2.AxisFault f = createAxisFault(e);
-
-            f.setDetail(toOM(e.getFaultMessage(),false));
-
-            throw f;
-            }
-        </xsl:for-each>
-        <!-- put the extra bracket-->
-        <xsl:if test="count(fault-list/fault)=0">}</xsl:if>
-        catch (Exception e) {
-        throw org.apache.axis2.AxisFault.makeFault(e);
-        }
-        }
-        <!-- Call templates recursively-->
-        //<xsl:apply-templates><xsl:with-param name="context">message-receiver</xsl:with-param></xsl:apply-templates>
-
-        /**
-        *  A utility method that copies the namepaces from the SOAPEnvelope
-        */
-        private java.util.Map getEnvelopeNamespaces(org.apache.axiom.soap.SOAPEnvelope env){
-        java.util.Map returnMap = new java.util.HashMap();
-        java.util.Iterator namespaceIterator = env.getAllDeclaredNamespaces();
-        while (namespaceIterator.hasNext()) {
-        org.apache.axiom.om.OMNamespace ns = (org.apache.axiom.om.OMNamespace) namespaceIterator.next();
-        returnMap.put(ns.getPrefix(),ns.getNamespaceURI());
-        }
-        return returnMap;
-        }
-
-        private org.apache.axis2.AxisFault createAxisFault(java.lang.Exception e) {
-        org.apache.axis2.AxisFault f;
-        Throwable cause = e.getCause();
-        if (cause != null) {
-            f = new org.apache.axis2.AxisFault(e.getMessage(), cause);
-        } else {
-            f = new org.apache.axis2.AxisFault(e.getMessage());
-        }
-
-        return f;
-    }
-
-        }//end of class
-    </xsl:template>
-    <!-- end of template for in-out message receiver -->
-
-    <!-- start of in-only -->
-    <xsl:template match="/interface[@basereceiver='org.apache.axis2.receivers.AbstractInMessageReceiver']">
-        <xsl:variable name="skeletonname"><xsl:value-of select="@skeletonInterfaceName"/></xsl:variable>
-        <xsl:variable name="dbsupportpackage"><xsl:value-of select="@dbsupportpackage"/></xsl:variable>
-
-        /**
-        * <xsl:value-of select="@name"/>.java
-        *
-        * This file was auto-generated from WSDL
-        * by the Apache Axis2 version: #axisVersion# #today#
-        */
-        package <xsl:value-of select="@package"/>;
-
-        /**
-        *  <xsl:value-of select="@name"/> message receiver
-        */
-
-        public class <xsl:value-of select="@name"/> extends <xsl:value-of select="@basereceiver"/>{
-
-        public void invokeBusinessLogic(org.apache.axis2.context.MessageContext inMessage) throws org.apache.axis2.AxisFault{
-
-        try {
-
-        // get the implementation class for the Web Service
-        Object obj = getTheImplementationObject(inMessage);
-
-        //Inject the Message Context if it is asked for
-        org.apache.axis2.engine.DependencyManager.configureBusinessLogicProvider(obj, inMessage.getOperationContext());
-
-        <xsl:value-of select="$skeletonname"/> skel = (<xsl:value-of select="$skeletonname"/>)obj;
-        //Out Envelop
-        org.apache.axiom.soap.SOAPEnvelope envelope = null;
-        //Find the axisOperation that has been set by the Dispatch phase.
-        org.apache.axis2.description.AxisOperation op = inMessage.getOperationContext().getAxisOperation();
-        if (op == null) {
-        throw new org.apache.axis2.AxisFault("Operation is not located, if this is doclit style the SOAP-ACTION should specified via the SOAP Action to use the RawXMLProvider");
-        }
-
-        java.lang.String methodName;
-        if(op.getName() != null &amp; (methodName = op.getName().getLocalPart()) != null){
-
-        <xsl:for-each select="method">
-
-            <xsl:variable name="namespace"><xsl:value-of select="@namespace"/></xsl:variable>
-            <xsl:variable name="name"><xsl:value-of select="@name"/></xsl:variable>
-            <xsl:variable name="style"><xsl:value-of select="@style"/></xsl:variable>
-
-            if("<xsl:value-of select="@name"/>".equals(methodName)){
-
-            <!-- If usedbmethod attribute present, gives name of method to call for implementation -->
-            <xsl:variable name="usedbmethod"><xsl:value-of select="@usedbmethod"/></xsl:variable>
-            <xsl:choose>
-                <xsl:when test="string-length(normalize-space($usedbmethod))=0">
-                    <xsl:choose>
-                        <xsl:when test="$style='rpc'">
-    
-                            //rpc style  -- this needs to be filled
-    
-                        </xsl:when>
-                        <xsl:when test="$style='document'">
-                            //doc style
-                            <xsl:variable name="paramCount"><xsl:value-of select="count(input/param[@location='body'])"/></xsl:variable>
-                            <xsl:choose>
-                                <xsl:when test="$paramCount &gt; 0"> skel.<xsl:value-of select="@name"/>(
-                                    <xsl:for-each select="input/param[@location='body']">
-                                        <xsl:if test="@type!=''">(<xsl:value-of select="@type"/>)fromOM(
-                                            inMessage.getEnvelope().getBody().getFirstElement(),
-                                            <xsl:value-of select="@type"/>.class,
-                                            getEnvelopeNamespaces(inMessage.getEnvelope())
-                                            )<xsl:if test="position() &gt; 1">,</xsl:if></xsl:if>
-                                    </xsl:for-each>);
-                                </xsl:when>
-                                <xsl:otherwise>skel.<xsl:value-of select="@name"/>();</xsl:otherwise>
-                            </xsl:choose>
-                        </xsl:when>
-    
-                        <xsl:otherwise>
-                            //Unknown style!! No code is generated
-                            throw new UnsupportedOperationException("Unknown Style");
-                        </xsl:otherwise>
-                    </xsl:choose>
-                </xsl:when>
-
-                <xsl:otherwise>
-                    <xsl:value-of select="$usedbmethod"/>(msgContext.getEnvelope().getBody().getFirstElement(), skel, null);
-                </xsl:otherwise>
-
-            </xsl:choose>
-
-            }
-        </xsl:for-each>
-
-        }
-        } catch (Exception e) {
-        throw org.apache.axis2.AxisFault.makeFault(e);
-        }
-        }
-
-
-        <!-- Call templates recursively-->
-        //<xsl:apply-templates><xsl:with-param name="context">message-receiver</xsl:with-param></xsl:apply-templates>
-
-
-
-        /**
-        *  A utility method that copies the namepaces from the SOAPEnvelope
-        */
-        private java.util.Map getEnvelopeNamespaces(org.apache.axiom.soap.SOAPEnvelope env){
-        java.util.Map returnMap = new java.util.HashMap();
-        java.util.Iterator namespaceIterator = env.getAllDeclaredNamespaces();
-        while (namespaceIterator.hasNext()) {
-        org.apache.axiom.om.OMNamespace ns = (org.apache.axiom.om.OMNamespace) namespaceIterator.next();
-        returnMap.put(ns.getPrefix(),ns.getNamespaceURI());
-        }
-        return returnMap;
-        }
-
-
-
-        }//end of class
-
-    </xsl:template>
-
-</xsl:stylesheet>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+    <xsl:output method="text"/>
+
+    <!-- include the databind supporters  -->
+    <xsl:include href="databindsupporter"/>
+    <!-- import the other templates for databinding
+           Note  -  these names would be handled by a special
+           URI resolver during the xslt transformations
+       -->
+    <xsl:include href="externalTemplate"/>
+
+
+    <!--Template for in out message receiver -->
+    <xsl:template match="/interface[@basereceiver='org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver']">
+
+        <xsl:variable name="skeletonname"><xsl:value-of select="@skeletonInterfaceName"/></xsl:variable>
+        <xsl:variable name="dbsupportpackage"><xsl:value-of select="@dbsupportpackage"/></xsl:variable>
+
+        /**
+        * <xsl:value-of select="@name"/>.java
+        *
+        * This file was auto-generated from WSDL
+        * by the Apache Axis2 version: #axisVersion# #today#
+        */
+        package <xsl:value-of select="@package"/>;
+
+        /**
+        *  <xsl:value-of select="@name"/> message receiver
+        */
+
+        public class <xsl:value-of select="@name"/> extends <xsl:value-of select="@basereceiver"/>{
+
+
+        public void invokeBusinessLogic(org.apache.axis2.context.MessageContext msgContext, org.apache.axis2.context.MessageContext newMsgContext)
+        throws org.apache.axis2.AxisFault{
+
+        try {
+
+        // get the implementation class for the Web Service
+        Object obj = getTheImplementationObject(msgContext);
+
+        //Inject the Message Context if it is asked for
+        org.apache.axis2.engine.DependencyManager.configureBusinessLogicProvider(obj, msgContext.getOperationContext());
+
+        <xsl:value-of select="$skeletonname"/> skel = (<xsl:value-of select="$skeletonname"/>)obj;
+        //Out Envelop
+        org.apache.axiom.soap.SOAPEnvelope envelope = null;
+        //Find the axisOperation that has been set by the Dispatch phase.
+        org.apache.axis2.description.AxisOperation op = msgContext.getOperationContext().getAxisOperation();
+        if (op == null) {
+        throw new org.apache.axis2.AxisFault("Operation is not located, if this is doclit style the SOAP-ACTION should specified via the SOAP Action to use the RawXMLProvider");
+        }
+
+        java.lang.String methodName;
+        if(op.getName() != null &amp; (methodName = op.getName().getLocalPart()) != null){
+
+        <xsl:for-each select="method">
+
+            if("<xsl:value-of select="@name"/>".equals(methodName)){
+
+            <!-- If usedbmethod attribute present, gives name of method to call for implementation -->
+            <xsl:variable name="usedbmethod"><xsl:value-of select="@usedbmethod"/></xsl:variable>
+
+
+
+            <xsl:choose>
+                <xsl:when test="string-length(normalize-space($usedbmethod))=0">
+
+                    <xsl:variable name="namespace"><xsl:value-of select="@namespace"/></xsl:variable>
+
+                    <xsl:variable name="name"><xsl:value-of select="@name"/></xsl:variable>
+                    <xsl:variable name="style"><xsl:value-of select="@style"/></xsl:variable>
+
+                    <xsl:variable name="returntype"><xsl:value-of select="output/param/@type"/></xsl:variable>
+                    <xsl:variable name="returnvariable"><xsl:value-of select="output/param/@name"/></xsl:variable>
+
+                    <xsl:if test="$returntype!=''">
+                        <xsl:value-of select="$returntype"/>
+                        <xsl:text> </xsl:text>
+                        <xsl:value-of select="$returnvariable"/> = null;
+                    </xsl:if>
+
+                    <xsl:choose>
+                        <!-- We really don't need to make a difference between these-->
+                        <xsl:when test="$style='document' or $style='rpc'">
+                            //doc style
+                            <xsl:variable name="inputcount" select="count(input/param[@location='body' and @type!=''])"/>
+                            <xsl:variable name="inputtype" select="input/param[@location='body' and @type!='']/@type"/>
+
+                            <xsl:choose>
+                                <xsl:when test="$inputcount=1">
+                                     <xsl:value-of select="$inputtype"/> wrappedParam =
+                                                 (<xsl:value-of select="$inputtype"/>)fromOM(
+                        msgContext.getEnvelope().getBody().getFirstElement(),
+                        <xsl:value-of select="$inputtype"/>.class,
+                        getEnvelopeNamespaces(msgContext.getEnvelope()));
+                                    <!-- Even when the parameters are 1 we have to see whether we have the
+                                  wrapped parameters -->
+                                   <xsl:variable name="inputWrappedCount" select="count(input/param[@location='body' and @type!='']/param)"/>
+                                    <xsl:choose>
+                                        <xsl:when test="$inputWrappedCount &gt; 0">
+                                            <!-- generate the references. the getters need to be
+                                                generated by the databinding-->
+                                            <!--<xsl:for-each select="input/param[@location='body' and @type!='']/param">-->
+                                                <!--<xsl:value-of select="@type"/> param<xsl:value-of select="position()"/>-->
+                                                        <!--= get<xsl:value-of select="@partname"/>(wrappedParam);-->
+                                            <!--</xsl:for-each>-->
+
+                                            <xsl:if test="$returntype!=''"><xsl:value-of select="$returnvariable"/> =</xsl:if>
+                                       skel.<xsl:value-of select="@name"/>(
+                                            <xsl:for-each select="input/param[@location='body' and @type!='']/param">
+                                                <xsl:if test="position() &gt; 1">,</xsl:if>
+                                                get<xsl:value-of select="@partname"/>(wrappedParam)
+                                            </xsl:for-each>
+
+                                        );
+
+                                        </xsl:when>
+                                        <xsl:otherwise>
+                                            <xsl:if test="$returntype!=''"><xsl:value-of select="$returnvariable"/> =</xsl:if>
+                                             skel.<xsl:value-of select="@name"/>(wrappedParam) ;
+                                        </xsl:otherwise>
+                                    </xsl:choose>
+                                </xsl:when>
+                                <xsl:otherwise>
+                                     <xsl:if test="$returntype!=''"><xsl:value-of select="$returnvariable"/> =</xsl:if>
+                                     skel.<xsl:value-of select="@name"/>();
+                                </xsl:otherwise>
+                            </xsl:choose>
+
+                            <xsl:choose>
+                                <xsl:when test="$returntype!=''">
+                                    envelope = toEnvelope(getSOAPFactory(msgContext), <xsl:value-of select="$returnvariable"/>, false);
+                                </xsl:when>
+                                <xsl:otherwise>
+                                    envelope = getSOAPFactory(msgContext).getDefaultEnvelope();
+                                </xsl:otherwise>
+                            </xsl:choose>
+                        </xsl:when>
+
+                        <xsl:otherwise>
+                            //Unknown style!! No code is generated
+                            throw new UnsupportedOperationException("Unknown Style");
+                        </xsl:otherwise>
+                    </xsl:choose>
+                </xsl:when>
+
+                <xsl:otherwise>
+                    envelope = <xsl:value-of select="$usedbmethod"/>(msgContext.getEnvelope().getBody().getFirstElement(), skel, getSOAPFactory(msgContext));
+                </xsl:otherwise>
+
+            </xsl:choose>
+
+            }
+        </xsl:for-each>
+
+        newMsgContext.setEnvelope(envelope);
+        }
+        <xsl:for-each select="fault-list/fault">
+            <xsl:if test="position()=1">}</xsl:if>catch (<xsl:value-of select="@name"/> e) {
+
+            org.apache.axis2.AxisFault f = createAxisFault(e);
+
+            f.setDetail(toOM(e.getFaultMessage(),false));
+
+            throw f;
+            }
+        </xsl:for-each>
+        <!-- put the extra bracket-->
+        <xsl:if test="count(fault-list/fault)=0">}</xsl:if>
+        catch (Exception e) {
+        throw org.apache.axis2.AxisFault.makeFault(e);
+        }
+        }
+        <!-- Call templates recursively-->
+        //<xsl:apply-templates><xsl:with-param name="context">message-receiver</xsl:with-param></xsl:apply-templates>
+
+        /**
+        *  A utility method that copies the namepaces from the SOAPEnvelope
+        */
+        private java.util.Map getEnvelopeNamespaces(org.apache.axiom.soap.SOAPEnvelope env){
+        java.util.Map returnMap = new java.util.HashMap();
+        java.util.Iterator namespaceIterator = env.getAllDeclaredNamespaces();
+        while (namespaceIterator.hasNext()) {
+        org.apache.axiom.om.OMNamespace ns = (org.apache.axiom.om.OMNamespace) namespaceIterator.next();
+        returnMap.put(ns.getPrefix(),ns.getNamespaceURI());
+        }
+        return returnMap;
+        }
+
+        private org.apache.axis2.AxisFault createAxisFault(java.lang.Exception e) {
+        org.apache.axis2.AxisFault f;
+        Throwable cause = e.getCause();
+        if (cause != null) {
+            f = new org.apache.axis2.AxisFault(e.getMessage(), cause);
+        } else {
+            f = new org.apache.axis2.AxisFault(e.getMessage());
+        }
+
+        return f;
+    }
+
+        }//end of class
+    </xsl:template>
+    <!-- end of template for in-out message receiver -->
+
+    <!-- start of in-only -->
+    <xsl:template match="/interface[@basereceiver='org.apache.axis2.receivers.AbstractInMessageReceiver']">
+        <xsl:variable name="skeletonname"><xsl:value-of select="@skeletonInterfaceName"/></xsl:variable>
+        <xsl:variable name="dbsupportpackage"><xsl:value-of select="@dbsupportpackage"/></xsl:variable>
+
+        /**
+        * <xsl:value-of select="@name"/>.java
+        *
+        * This file was auto-generated from WSDL
+        * by the Apache Axis2 version: #axisVersion# #today#
+        */
+        package <xsl:value-of select="@package"/>;
+
+        /**
+        *  <xsl:value-of select="@name"/> message receiver
+        */
+
+        public class <xsl:value-of select="@name"/> extends <xsl:value-of select="@basereceiver"/>{
+
+        public void invokeBusinessLogic(org.apache.axis2.context.MessageContext inMessage) throws org.apache.axis2.AxisFault{
+
+        try {
+
+        // get the implementation class for the Web Service
+        Object obj = getTheImplementationObject(inMessage);
+
+        //Inject the Message Context if it is asked for
+        org.apache.axis2.engine.DependencyManager.configureBusinessLogicProvider(obj, inMessage.getOperationContext());
+
+        <xsl:value-of select="$skeletonname"/> skel = (<xsl:value-of select="$skeletonname"/>)obj;
+        //Out Envelop
+        org.apache.axiom.soap.SOAPEnvelope envelope = null;
+        //Find the axisOperation that has been set by the Dispatch phase.
+        org.apache.axis2.description.AxisOperation op = inMessage.getOperationContext().getAxisOperation();
+        if (op == null) {
+        throw new org.apache.axis2.AxisFault("Operation is not located, if this is doclit style the SOAP-ACTION should specified via the SOAP Action to use the RawXMLProvider");
+        }
+
+        java.lang.String methodName;
+        if(op.getName() != null &amp; (methodName = op.getName().getLocalPart()) != null){
+
+        <xsl:for-each select="method">
+
+            <xsl:variable name="namespace"><xsl:value-of select="@namespace"/></xsl:variable>
+            <xsl:variable name="name"><xsl:value-of select="@name"/></xsl:variable>
+            <xsl:variable name="style"><xsl:value-of select="@style"/></xsl:variable>
+
+            if("<xsl:value-of select="@name"/>".equals(methodName)){
+
+            <!-- If usedbmethod attribute present, gives name of method to call for implementation -->
+            <xsl:variable name="usedbmethod"><xsl:value-of select="@usedbmethod"/></xsl:variable>
+            <xsl:choose>
+                <xsl:when test="string-length(normalize-space($usedbmethod))=0">
+                    <xsl:choose>
+                        <xsl:when test="$style='rpc'">
+    
+                            //rpc style  -- this needs to be filled
+    
+                        </xsl:when>
+                        <xsl:when test="$style='document'">
+                            //doc style
+                            <xsl:variable name="paramCount"><xsl:value-of select="count(input/param[@location='body'])"/></xsl:variable>
+                            <xsl:choose>
+                                <xsl:when test="$paramCount &gt; 0"> skel.<xsl:value-of select="@name"/>(
+                                    <xsl:for-each select="input/param[@location='body']">
+                                        <xsl:if test="@type!=''">(<xsl:value-of select="@type"/>)fromOM(
+                                            inMessage.getEnvelope().getBody().getFirstElement(),
+                                            <xsl:value-of select="@type"/>.class,
+                                            getEnvelopeNamespaces(inMessage.getEnvelope())
+                                            )<xsl:if test="position() &gt; 1">,</xsl:if></xsl:if>
+                                    </xsl:for-each>);
+                                </xsl:when>
+                                <xsl:otherwise>skel.<xsl:value-of select="@name"/>();</xsl:otherwise>
+                            </xsl:choose>
+                        </xsl:when>
+    
+                        <xsl:otherwise>
+                            //Unknown style!! No code is generated
+                            throw new UnsupportedOperationException("Unknown Style");
+                        </xsl:otherwise>
+                    </xsl:choose>
+                </xsl:when>
+
+                <xsl:otherwise>
+                    <xsl:value-of select="$usedbmethod"/>(msgContext.getEnvelope().getBody().getFirstElement(), skel, null);
+                </xsl:otherwise>
+
+            </xsl:choose>
+
+            }
+        </xsl:for-each>
+
+        }
+        } catch (Exception e) {
+        throw org.apache.axis2.AxisFault.makeFault(e);
+        }
+        }
+
+
+        <!-- Call templates recursively-->
+        //<xsl:apply-templates><xsl:with-param name="context">message-receiver</xsl:with-param></xsl:apply-templates>
+
+
+
+        /**
+        *  A utility method that copies the namepaces from the SOAPEnvelope
+        */
+        private java.util.Map getEnvelopeNamespaces(org.apache.axiom.soap.SOAPEnvelope env){
+        java.util.Map returnMap = new java.util.HashMap();
+        java.util.Iterator namespaceIterator = env.getAllDeclaredNamespaces();
+        while (namespaceIterator.hasNext()) {
+        org.apache.axiom.om.OMNamespace ns = (org.apache.axiom.om.OMNamespace) namespaceIterator.next();
+        returnMap.put(ns.getPrefix(),ns.getNamespaceURI());
+        }
+        return returnMap;
+        }
+
+
+
+        }//end of class
+
+    </xsl:template>
+
+    <!--Template for robust in message receiver -->
+    <xsl:template match="/interface[@basereceiver='org.apache.axis2.receivers.AbstractRobustInMessageReceiver']">
+
+        <xsl:variable name="skeletonname"><xsl:value-of select="@skeletonInterfaceName"/></xsl:variable>
+        <xsl:variable name="dbsupportpackage"><xsl:value-of select="@dbsupportpackage"/></xsl:variable>
+
+        /**
+        * <xsl:value-of select="@name"/>.java
+        *
+        * This file was auto-generated from WSDL
+        * by the Apache Axis2 version: #axisVersion# #today#
+        */
+        package <xsl:value-of select="@package"/>;
+
+        /**
+        *  <xsl:value-of select="@name"/> message receiver
+        */
+
+        public class <xsl:value-of select="@name"/> extends <xsl:value-of select="@basereceiver"/>{
+
+
+        public void invokeBusinessLogic(org.apache.axis2.context.MessageContext msgContext)
+        throws org.apache.axis2.AxisFault{
+
+        try {
+
+        // get the implementation class for the Web Service
+        Object obj = getTheImplementationObject(msgContext);
+
+        //Inject the Message Context if it is asked for
+        org.apache.axis2.engine.DependencyManager.configureBusinessLogicProvider(obj, msgContext.getOperationContext());
+
+        <xsl:value-of select="$skeletonname"/> skel = (<xsl:value-of select="$skeletonname"/>)obj;
+        //Out Envelop
+        org.apache.axiom.soap.SOAPEnvelope envelope = null;
+        //Find the axisOperation that has been set by the Dispatch phase.
+        org.apache.axis2.description.AxisOperation op = msgContext.getOperationContext().getAxisOperation();
+        if (op == null) {
+        throw new org.apache.axis2.AxisFault("Operation is not located, if this is doclit style the SOAP-ACTION should specified via the SOAP Action to use the RawXMLProvider");
+        }
+
+        java.lang.String methodName;
+        if(op.getName() != null &amp; (methodName = op.getName().getLocalPart()) != null){
+
+        <xsl:for-each select="method">
+
+            if("<xsl:value-of select="@name"/>".equals(methodName)){
+
+            <!-- If usedbmethod attribute present, gives name of method to call for implementation -->
+            <xsl:variable name="usedbmethod"><xsl:value-of select="@usedbmethod"/></xsl:variable>
+
+
+
+            <xsl:choose>
+                <xsl:when test="string-length(normalize-space($usedbmethod))=0">
+
+                    <xsl:variable name="namespace"><xsl:value-of select="@namespace"/></xsl:variable>
+
+                    <xsl:variable name="name"><xsl:value-of select="@name"/></xsl:variable>
+                    <xsl:variable name="style"><xsl:value-of select="@style"/></xsl:variable>
+
+                    <xsl:choose>
+                        <!-- We really don't need to make a difference between these-->
+                        <xsl:when test="$style='document' or $style='rpc'">
+                            //doc style
+                            <xsl:variable name="inputcount" select="count(input/param[@location='body' and @type!=''])"/>
+                            <xsl:variable name="inputtype" select="input/param[@location='body' and @type!='']/@type"/>
+
+                            <xsl:choose>
+                                <xsl:when test="$inputcount=1">
+                                     <xsl:value-of select="$inputtype"/> wrappedParam =
+                                                 (<xsl:value-of select="$inputtype"/>)fromOM(
+                        msgContext.getEnvelope().getBody().getFirstElement(),
+                        <xsl:value-of select="$inputtype"/>.class,
+                        getEnvelopeNamespaces(msgContext.getEnvelope()));
+                                    <!-- Even when the parameters are 1 we have to see whether we have the
+                                  wrapped parameters -->
+                                   <xsl:variable name="inputWrappedCount" select="count(input/param[@location='body' and @type!='']/param)"/>
+                                    <xsl:choose>
+                                        <xsl:when test="$inputWrappedCount &gt; 0">
+                                       skel.<xsl:value-of select="@name"/>(
+                                            <xsl:for-each select="input/param[@location='body' and @type!='']/param">
+                                                <xsl:if test="position() &gt; 1">,</xsl:if>
+                                                get<xsl:value-of select="@partname"/>(wrappedParam)
+                                            </xsl:for-each>
+
+                                        );
+
+                                        </xsl:when>
+                                        <xsl:otherwise>
+                                             skel.<xsl:value-of select="@name"/>(wrappedParam) ;
+                                        </xsl:otherwise>
+                                    </xsl:choose>
+                                </xsl:when>
+                                <xsl:otherwise>
+                                     skel.<xsl:value-of select="@name"/>();
+                                </xsl:otherwise>
+                            </xsl:choose>
+                                    envelope = getSOAPFactory(msgContext).getDefaultEnvelope();
+                        </xsl:when>
+
+                        <xsl:otherwise>
+                            //Unknown style!! No code is generated
+                            throw new UnsupportedOperationException("Unknown Style");
+                        </xsl:otherwise>
+                    </xsl:choose>
+                </xsl:when>
+
+                <xsl:otherwise>
+                    envelope = <xsl:value-of select="$usedbmethod"/>(msgContext.getEnvelope().getBody().getFirstElement(), skel, getSOAPFactory(msgContext));
+                </xsl:otherwise>
+
+            </xsl:choose>
+
+            }
+        </xsl:for-each>
+        }
+        <xsl:for-each select="fault-list/fault">
+            <xsl:if test="position()=1">}</xsl:if>catch (<xsl:value-of select="@name"/> e) {
+
+            org.apache.axis2.AxisFault f = createAxisFault(e);
+
+            f.setDetail(toOM(e.getFaultMessage(),false));
+
+            throw f;
+            }
+        </xsl:for-each>
+        <!-- put the extra bracket-->
+        <xsl:if test="count(fault-list/fault)=0">}</xsl:if>
+        catch (Exception e) {
+        throw org.apache.axis2.AxisFault.makeFault(e);
+        }
+        }
+        <!-- Call templates recursively-->
+        //<xsl:apply-templates><xsl:with-param name="context">message-receiver</xsl:with-param></xsl:apply-templates>
+
+        /**
+        *  A utility method that copies the namepaces from the SOAPEnvelope
+        */
+        private java.util.Map getEnvelopeNamespaces(org.apache.axiom.soap.SOAPEnvelope env){
+        java.util.Map returnMap = new java.util.HashMap();
+        java.util.Iterator namespaceIterator = env.getAllDeclaredNamespaces();
+        while (namespaceIterator.hasNext()) {
+        org.apache.axiom.om.OMNamespace ns = (org.apache.axiom.om.OMNamespace) namespaceIterator.next();
+        returnMap.put(ns.getPrefix(),ns.getNamespaceURI());
+        }
+        return returnMap;
+        }
+
+        private org.apache.axis2.AxisFault createAxisFault(java.lang.Exception e) {
+        org.apache.axis2.AxisFault f;
+        Throwable cause = e.getCause();
+        if (cause != null) {
+            f = new org.apache.axis2.AxisFault(e.getMessage(), cause);
+        } else {
+            f = new org.apache.axis2.AxisFault(e.getMessage());
+        }
+
+        return f;
+    }
+
+        }//end of class
+    </xsl:template>
+    <!-- end of template for robust in message receiver -->
+
+</xsl:stylesheet>



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


Mime
View raw message