axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nadira...@apache.org
Subject svn commit: r658564 - in /webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp: WrapWriter.java literal/WrapWriter.java
Date Wed, 21 May 2008 06:26:01 GMT
Author: nadiramra
Date: Tue May 20 23:26:01 2008
New Revision: 658564

URL: http://svn.apache.org/viewvc?rev=658564&view=rev
Log:
AXISCPP-1048 - pointer type not being generation for optional return value.

Modified:
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/WrapWriter.java
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/WrapWriter.java

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/WrapWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/WrapWriter.java?rev=658564&r1=658563&r2=658564&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/WrapWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/WrapWriter.java Tue
May 20 23:26:01 2008
@@ -122,28 +122,17 @@
     {
         try
         {
-            writer.write(
-                "/*implementation of WrapperClassHandler interface*/\n");
+            CUtils.printMethodComment(writer, "This method handles faults.");
+
 
             writer.write(
                 "void "
                     + classname
                     + "::\nonFault(void *pMsg)\n{"
                     + "\n\tpWs->onFault();\n}\n\n");
-            /*writer.write(
-                "int "
-                    + classname
-                    + "::\ninit()\n{\n"
-                    + "\tpWs->init();\n\treturn AXIS_SUCCESS;\n}\n\n");
-            writer.write(
-                "int "
-                    + classname
-                    + "::\nfini()\n{\n"
-                    + "\tpWs->fini();\n\treturn AXIS_SUCCESS;\n}\n\n");
-					*/
+
             writeInvoke();
-            writer.write(
-                "\n/*Methods corresponding to the web service methods*/\n");
+
             MethodInfo minfo;
             for (int i = 0; i < methods.size(); i++)
             {
@@ -184,37 +173,34 @@
      */
     private void writeInvoke() throws IOException
     {
-        writer.write("\n/*\n");
-        writer.write(" * This method invokes the right service method \n");
-        writer.write(" */\n");
+        CUtils.printMethodComment(writer, "This method invokes the right service method.");
+
         writer.write("int " + classname + "::\ninvoke(void *pMsg)\n{\n");
         writer.write("\tIMessageData* mc = (IMessageData*)pMsg;\n");
-        //msgdata.setSoapFault(new SOAPFault(new AxisFault()))
         writer.write("\tconst AxisChar *method = mc->getOperationName();\n");
+        
         //if no methods in the service simply return
-        if (methods.size() == 0)
-        {
-            writer.write("}\n");
-            return;
-        }
-        MethodInfo minfo = (MethodInfo) methods.get(0);
-        //if conditions (if parts)		
-        writer.write(
-            "\tif( (0 == strcmp(method, \"" + minfo.getInputMessage().getLocalPart() + "\"))
|| (0 == strcmp(method, \"" + minfo.getMethodname() + "\")) )\n");
-        writer.write("\t\treturn " + minfo.getMethodname() + "(mc);\n");
-        //(else if parts)
-        if (methods.size() > 1)
+        if (methods.size() != 0)
         {
-            for (int i = 1; i < methods.size(); i++)
+            MethodInfo minfo = (MethodInfo) methods.get(0);
+            //if conditions (if parts)		
+            writer.write(
+                "\tif( (0 == strcmp(method, \"" + minfo.getInputMessage().getLocalPart()
+ "\")) || (0 == strcmp(method, \"" + minfo.getMethodname() + "\")) )\n");
+            writer.write("\t\treturn " + minfo.getMethodname() + "(mc);\n");
+            //(else if parts)
+            if (methods.size() > 1)
             {
-                minfo = (MethodInfo) methods.get(i);
-                writer.write(
-                    "\telse if ( (0 == strcmp(method, \"" + minfo.getInputMessage().getLocalPart()
+ "\")) || (0 == strcmp(method, \"" + minfo.getMethodname() + "\")) )\n");
-                writer.write("\t\treturn " + minfo.getMethodname() + "(mc);\n");
+                for (int i = 1; i < methods.size(); i++)
+                {
+                    minfo = (MethodInfo) methods.get(i);
+                    writer.write(
+                        "\telse if ( (0 == strcmp(method, \"" + minfo.getInputMessage().getLocalPart()
+ "\")) || (0 == strcmp(method, \"" + minfo.getMethodname() + "\")) )\n");
+                    writer.write("\t\treturn " + minfo.getMethodname() + "(mc);\n");
+                }
             }
+            //(else part)
+            writer.write("\telse return AXIS_FAIL;\n");
         }
-        //(else part)
-        writer.write("\telse return AXIS_FAIL;\n");
         //end of method
         writer.write("}\n\n");
     }

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/WrapWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/WrapWriter.java?rev=658564&r1=658563&r2=658564&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/WrapWriter.java
(original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/WrapWriter.java
Tue May 20 23:26:01 2008
@@ -107,32 +107,29 @@
             }
         }
         
-        writer.write("\n/*\n");
-        writer.write(" * This method wrap the service method \n");
-        writer.write(" */\n");
+        CUtils.printMethodComment(writer, "This method wraps the service method " + methodName
+ ".");
+
         //method signature
         writer.write("int " + classname + "::" + methodName + "(void* pMsg)\n{\n");
         writer.write("\tIMessageData* mc = (IMessageData*)pMsg;\n");
-        writer.write("\tint nStatus;\n");
+        writer.write("\tint nStatus;\n\n");
+        
         writer.write("\tIWrapperSoapSerializer* pIWSSZ = NULL;\n");
         writer.write("\tmc->getSoapSerializer(&pIWSSZ);\n");
         writer.write("\tif (!pIWSSZ)\n");
-        writer.write("\t{\n");
-        writer.write("\t\treturn AXIS_FAIL;\n");
-        writer.write("\t}\n");
+        writer.write("\t\treturn AXIS_FAIL;\n\n");
+        
         writer.write("\tIWrapperSoapDeSerializer* pIWSDZ = NULL;\n");
         writer.write("\tmc->getSoapDeSerializer(&pIWSDZ);\n");
         writer.write("\tif (!pIWSDZ)\n");
-        writer.write("\t{\n");
-        writer.write("\t\treturn AXIS_FAIL;\n");
-        writer.write("\t}\n");
-        writer.write("\t/* check whether we have got correct message */\n");
+        writer.write("\t\treturn AXIS_FAIL;\n\n");
+
+        writer.write("\t// check whether we have got correct message\n");
         writer.write("\tif (AXIS_SUCCESS != pIWSDZ->checkMessageBody(\""
                 + minfo.getInputMessage().getLocalPart() + "\", \""
                 + minfo.getInputMessage().getNamespaceURI() + "\"))\n");
-        writer.write("\t{\n");
-        writer.write("\t\treturn AXIS_FAIL;\n");
-        writer.write("\t}\n");
+        writer.write("\t\treturn AXIS_FAIL;\n\n");
+
         if (minfo.getOutputMessage() != null)
         {
             writer.write("\tpIWSSZ->createSoapMethod(\""
@@ -307,9 +304,7 @@
         } // for loop
         
         writer.write("\n\tif (AXIS_SUCCESS != (nStatus = pIWSDZ->getStatus()))\n");
-        writer.write("\t{\n");
-        writer.write("\t\treturn nStatus;\n");
-        writer.write("\t}\n\n");
+        writer.write("\t\treturn nStatus;\n\n");
         
         // Multiples parameters so fill the methods prototype
         if (isAllTreatedAsOutParams)
@@ -340,7 +335,7 @@
                     ||(!returntypeisarray 
                             && (!returntypeissimple
                                     || (returntypeissimple 
-                                            && returntype.isNillable()
+                                            && (returntype.isNillable() || returntype.isOptional())
                                             && !(CUtils.isPointerType(retType.getLanguageSpecificName()))))))
                 writer.write(" *");
             
@@ -370,6 +365,7 @@
                 {
                     String returnParamTypeName = retType.getLanguageSpecificName();
                     if (returntype.isNillable()
+                            || returntype.isOptional()
                             || CUtils.isPointerType(returnParamTypeName))
                     {
                         writer.write("\t\treturn pIWSSZ->addOutputParam(\"" + returnParamName



Mime
View raw message