axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aj...@apache.org
Subject svn commit: r392576 - in /webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl: codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java template/java/SkeletonTemplate.xsl
Date Sat, 08 Apr 2006 18:43:40 GMT
Author: ajith
Date: Sat Apr  8 11:43:39 2006
New Revision: 392576

URL: http://svn.apache.org/viewcvs?rev=392576&view=rev
Log:
Fixing a fatal error in the codegen where the wrong meps were tested to get the input
1. made the corrections and refactored the check into a method
2. made a slight change in the SkeletonTemplate.xsl to have the proper void setup

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/SkeletonTemplate.xsl

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java?rev=392576&r1=392575&r2=392576&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java
(original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java
Sat Apr  8 11:43:39 2006
@@ -775,24 +775,14 @@
 
             // process the input parameters
             String MEP = axisOperation.getMessageExchangePattern();
-            if (WSDLConstants.MEP_URI_IN_ONLY.equals(MEP) ||
-                    WSDLConstants.MEP_URI_IN_OPTIONAL_OUT.equals(MEP) ||
-                    WSDLConstants.MEP_URI_OUT_OPTIONAL_IN.equals(MEP) ||
-                    WSDLConstants.MEP_URI_ROBUST_OUT_ONLY.equals(MEP) ||
-                    WSDLConstants.MEP_URI_ROBUST_IN_ONLY.equals(MEP) ||
-                    WSDLConstants.MEP_URI_IN_OUT.equals(MEP)) {
+            if (isInputPresentForMEP(MEP)) {
                 Element inputParamElement = getInputParamElement(doc, axisOperation);
                 if (inputParamElement != null) {
                     parameterMap.put(inputParamElement.getAttribute("type"), inputParamElement);
                 }
             }
             // process output parameters
-            if (WSDLConstants.MEP_URI_OUT_ONLY.equals(MEP) ||
-                    WSDLConstants.MEP_URI_OUT_OPTIONAL_IN.equals(MEP) ||
-                    WSDLConstants.MEP_URI_IN_OPTIONAL_OUT.equals(MEP) ||
-                    WSDLConstants.MEP_URI_ROBUST_OUT_ONLY.equals(MEP) ||
-                    WSDLConstants.MEP_URI_ROBUST_IN_ONLY.equals(MEP) ||
-                    WSDLConstants.MEP_URI_IN_OUT.equals(MEP)) {
+            if (isOutputPresentForMEP(MEP)) {
                 Element outputParamElement = getOutputParamElement(doc, axisOperation);
                 if (outputParamElement != null) {
                     parameterMap.put(outputParamElement.getAttribute("type"), outputParamElement);
@@ -848,6 +838,15 @@
         return rootElement;
     }
 
+    private boolean isInputPresentForMEP(String MEP) {
+        return WSDLConstants.MEP_URI_IN_ONLY.equals(MEP) ||
+                WSDLConstants.MEP_URI_IN_OPTIONAL_OUT.equals(MEP) ||
+                WSDLConstants.MEP_URI_OUT_OPTIONAL_IN.equals(MEP) ||
+                WSDLConstants.MEP_URI_ROBUST_OUT_ONLY.equals(MEP) ||
+                WSDLConstants.MEP_URI_ROBUST_IN_ONLY.equals(MEP) ||
+                WSDLConstants.MEP_URI_IN_OUT.equals(MEP);
+    }
+
     /**
      * Gets the base64 types. If not available this will be empty!!!
      *
@@ -998,6 +997,10 @@
         loadOperations(doc, rootElement, null);
         doc.appendChild(rootElement);
 
+        /////////////////////////////////////////////////////
+        System.out.println(DOM2Writer.nodeToString(rootElement));
+        /////////////////////////////////////////////////////
+
         return doc;
 
     }
@@ -1235,12 +1238,7 @@
         ArrayList headerparamList = new ArrayList();
         String MEP = axisOperation.getMessageExchangePattern();
         if (input){
-            if (WSDLConstants.MEP_URI_IN_ONLY.equals(MEP) ||
-                    WSDLConstants.MEP_URI_IN_OPTIONAL_OUT.equals(MEP) ||
-                    WSDLConstants.MEP_URI_OUT_OPTIONAL_IN.equals(MEP) ||
-                    WSDLConstants.MEP_URI_ROBUST_OUT_ONLY.equals(MEP) ||
-                    WSDLConstants.MEP_URI_ROBUST_IN_ONLY.equals(MEP) ||
-                    WSDLConstants.MEP_URI_IN_OUT.equals(MEP)) {
+            if (isInputPresentForMEP(MEP)) {
                 AxisMessage inaxisMessage = axisOperation
                         .getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
                 if (inaxisMessage != null) {
@@ -1249,12 +1247,7 @@
                 }
             }
         }else{
-            if (WSDLConstants.MEP_URI_OUT_ONLY.equals(MEP) ||
-                    WSDLConstants.MEP_URI_OUT_OPTIONAL_IN.equals(MEP) ||
-                    WSDLConstants.MEP_URI_IN_OPTIONAL_OUT.equals(MEP) ||
-                    WSDLConstants.MEP_URI_ROBUST_OUT_ONLY.equals(MEP) ||
-                    WSDLConstants.MEP_URI_ROBUST_IN_ONLY.equals(MEP) ||
-                    WSDLConstants.MEP_URI_IN_OUT.equals(MEP)) {
+            if (isOutputPresentForMEP(MEP)) {
                 AxisMessage outAxisMessage = axisOperation
                         .getMessage(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
                 if (outAxisMessage != null) {
@@ -1269,15 +1262,19 @@
         }
     }
 
-    protected Element getInputElement(Document doc, AxisOperation operation, List headerParameterQNameList)
{
-        Element inputElt = doc.createElement("input");
-        String MEP = operation.getMessageExchangePattern();
-        if (WSDLConstants.MEP_URI_OUT_ONLY.equals(MEP) ||
+    private boolean isOutputPresentForMEP(String MEP) {
+        return WSDLConstants.MEP_URI_OUT_ONLY.equals(MEP) ||
                 WSDLConstants.MEP_URI_OUT_OPTIONAL_IN.equals(MEP) ||
                 WSDLConstants.MEP_URI_IN_OPTIONAL_OUT.equals(MEP) ||
                 WSDLConstants.MEP_URI_ROBUST_OUT_ONLY.equals(MEP) ||
                 WSDLConstants.MEP_URI_ROBUST_IN_ONLY.equals(MEP) ||
-                WSDLConstants.MEP_URI_IN_OUT.equals(MEP)) {
+                WSDLConstants.MEP_URI_IN_OUT.equals(MEP);
+    }
+
+    protected Element getInputElement(Document doc, AxisOperation operation, List headerParameterQNameList)
{
+        Element inputElt = doc.createElement("input");
+        String MEP = operation.getMessageExchangePattern();
+        if (isInputPresentForMEP(MEP)) {
             Element param = getInputParamElement(doc, operation);
 
             if (param != null) {
@@ -1319,12 +1316,7 @@
     protected Element getOutputElement(Document doc, AxisOperation operation, List headerParameterQNameList)
{
         Element outputElt = doc.createElement("output");
         String MEP = operation.getMessageExchangePattern();
-        if (WSDLConstants.MEP_URI_OUT_ONLY.equals(MEP) ||
-                WSDLConstants.MEP_URI_OUT_OPTIONAL_IN.equals(MEP) ||
-                WSDLConstants.MEP_URI_IN_OPTIONAL_OUT.equals(MEP) ||
-                WSDLConstants.MEP_URI_ROBUST_OUT_ONLY.equals(MEP) ||
-                WSDLConstants.MEP_URI_ROBUST_IN_ONLY.equals(MEP) ||
-                WSDLConstants.MEP_URI_IN_OUT.equals(MEP)) {
+        if (isOutputPresentForMEP(MEP)) {
             Element param = getOutputParamElement(doc, operation);
 
             if (param != null) {

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/SkeletonTemplate.xsl
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/SkeletonTemplate.xsl?rev=392576&r1=392575&r2=392576&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/SkeletonTemplate.xsl
(original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/SkeletonTemplate.xsl
Sat Apr  8 11:43:39 2006
@@ -13,7 +13,8 @@
      */
     public class <xsl:value-of select="@name"></xsl:value-of> {
      <xsl:for-each select="method">
-         <xsl:variable name="outputtype"><xsl:value-of select="output/param/@type"></xsl:value-of></xsl:variable>
+         <xsl:variable name="count"><xsl:value-of select="count(output/param)"/></xsl:variable>
+         <xsl:variable name="outputtype"><xsl:value-of select="output/param/@type"/></xsl:variable>
 		 <!-- regardless of the sync or async status, the generated method signature would be
just a usual
 	           java method -->
         /**
@@ -23,7 +24,7 @@
             <xsl:if test="@type!=''">* @param <xsl:value-of select="@name"></xsl:value-of><xsl:text>
          </xsl:text></xsl:if></xsl:for-each>
          */
-        public  <xsl:if test="$outputtype=''">void</xsl:if><xsl:if test="$outputtype!=''"><xsl:value-of
select="$outputtype"/></xsl:if><xsl:text> </xsl:text><xsl:value-of
select="@name"/>
+        public  <xsl:if test="$count=0">void</xsl:if><xsl:if test="$outputtype!=''"><xsl:value-of
select="$outputtype"/></xsl:if><xsl:text> </xsl:text><xsl:value-of
select="@name"/>
                   (<xsl:for-each select="input/param[@location='body']">
             <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> )



Mime
View raw message