You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by na...@apache.org on 2008/05/21 04:03:31 UTC

svn commit: r658529 - in /webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws: c/literal/ClientStubWriter.java cpp/literal/ClientStubWriter.java

Author: nadiramra
Date: Tue May 20 19:03:30 2008
New Revision: 658529

URL: http://svn.apache.org/viewvc?rev=658529&view=rev
Log:
Simplify logic...

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

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/ClientStubWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/ClientStubWriter.java?rev=658529&r1=658528&r2=658529&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/ClientStubWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/ClientStubWriter.java Tue May 20 19:03:30 2008
@@ -74,25 +74,29 @@
         String outparamType = null;
         
         if (returntype != null)
-            retType = wscontext.getTypemap().getType(returntype.getSchemaName());
-    
-        if (retType != null)
         {
-            if (retType.isSimpleType())
-                outparamType = CUtils.getclass4qname(retType.getBaseType());
+            retType = wscontext.getTypemap().getType(returntype.getSchemaName());
+            if (retType != null)
+            {
+                if (retType.isSimpleType())
+                {
+                    outparamType = CUtils.getclass4qname(retType.getBaseType());
+                }
+                else
+                {
+                    outparamType = WrapperUtils.getClassNameFromParamInfoConsideringArrays(returntype,wscontext);
+                    returntypeisarray = (outparamType.lastIndexOf("_Array") > 0);
+                }
+            
+                returntypeisarray |= retType.isArray();
+            }
             else
             {
-                outparamType = WrapperUtils.getClassNameFromParamInfoConsideringArrays(returntype,wscontext);
-                returntypeisarray = (outparamType.lastIndexOf("_Array") > 0);
+                outparamType = returntype.getLangName();
             }
-            
-            returntypeisarray |= retType.isArray();
-        }
-        else if (returntype != null)
-            outparamType = returntype.getLangName();
         
-        if (returntype != null)
             returntypeissimple = CUtils.isSimpleType(outparamType);
+        }
 
         //=============================================================================
         // Generate method prototype

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubWriter.java?rev=658529&r1=658528&r2=658529&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubWriter.java Tue May 20 19:03:30 2008
@@ -81,42 +81,46 @@
         if (0 == noOfOutParams)
             returntype = null;
         else if (1 == noOfOutParams)
-            returntype = (ParameterInfo) minfo.getOutputParameterTypes().iterator().next();
+            returntype = (ParameterInfo)minfo.getOutputParameterTypes().iterator().next();
         else
             isAllTreatedAsOutParams = true;
-      
-        Collection params = minfo.getInputParameterTypes ();
-        String methodName = minfo.getMethodname ();
+
+        Collection params = minfo.getInputParameterTypes();
+        String methodName = minfo.getMethodname();
         Type retType = null;
         boolean returntypeissimple = false;
         boolean returntypeisarray = false;
         String outparamType = null;
         
         if (returntype != null)
-            retType = wscontext.getTypemap ().getType (returntype.getSchemaName ());
-        
-        if (retType != null)
         {
-            if (retType.isSimpleType ())
-                outparamType = CUtils.getclass4qname (retType.getBaseType ());
+            retType = wscontext.getTypemap().getType(returntype.getSchemaName());
+            if (retType != null)
+            {
+                if (retType.isSimpleType())
+                {
+                    outparamType = CUtils.getclass4qname(retType.getBaseType());
+                }
+                else
+                {
+                    outparamType = WrapperUtils.getClassNameFromParamInfoConsideringArrays(returntype,wscontext);
+                    returntypeisarray = (outparamType.lastIndexOf("_Array") > 0);
+                }
+            
+                returntypeisarray |= retType.isArray();
+            }
             else
             {
-                outparamType = WrapperUtils.getClassNameFromParamInfoConsideringArrays (returntype, wscontext);
-                returntypeisarray = (outparamType.lastIndexOf ("_Array") > 0);
+                outparamType = returntype.getLangName();
             }
-            
-            returntypeisarray |= retType.isArray ();
-        }
-        else if (returntype != null)
-            outparamType = returntype.getLangName ();
         
-        if (returntype != null)
-            returntypeissimple = CUtils.isSimpleType (outparamType);
+            returntypeissimple = CUtils.isSimpleType(outparamType);
+        }
 
         //=============================================================================
         // Generate method prototype
         //=============================================================================        
-
+        
         CUtils.printMethodComment(writer, "This method wraps the service method " + methodName + ".");
         
         //method signature
@@ -126,15 +130,15 @@
         Type type;
         
         if (returntype == null)
-            writer.write ("void");
+            writer.write("void");
         else if (returntypeissimple
                     && (!(returntype.isNillable() || returntype.isOptional()) 
                             || CUtils.isPointerType(outparamType)))
-            writer.write (outparamType);
-        else if (outparamType.lastIndexOf ("*") > 0)
-            writer.write (outparamType);
+            writer.write(outparamType);
+        else if (outparamType.lastIndexOf("*") > 0)
+            writer.write(outparamType);
         else 
-            writer.write (outparamType + "*");
+            writer.write(outparamType + "*");
 
         writer.write (" " + classname + "::\n" + methodName + "(");
         ArrayList paramsB = (ArrayList) params;
@@ -239,9 +243,9 @@
                     writer.write (", " + paramTypeName + "* Value" + i);
             } // end for loop
         } // end if (0 < paramsB.size ())
-    
+        
         // Multiples parameters so fill the methods prototype
-        ArrayList paramsC = (ArrayList) minfo.getOutputParameterTypes ();
+        ArrayList paramsC = (ArrayList) minfo.getOutputParameterTypes();
         if (isAllTreatedAsOutParams)
             for (int i = 0; i < paramsC.size (); i++)
             {