axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nadira...@apache.org
Subject svn commit: r392491 - in /webservices/axis/trunk/c: src/common/AxisUserAPI.cpp src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ArrayParamWriter.java tests/auto_build/testcases/client/c/AxisBenchClient.c
Date Sat, 08 Apr 2006 07:38:05 GMT
Author: nadiramra
Date: Sat Apr  8 00:38:02 2006
New Revision: 392491

URL: http://svn.apache.org/viewcvs?rev=392491&view=rev
Log:
C support fixes/enhancements.

Modified:
    webservices/axis/trunk/c/src/common/AxisUserAPI.cpp
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ArrayParamWriter.java
    webservices/axis/trunk/c/tests/auto_build/testcases/client/c/AxisBenchClient.c

Modified: webservices/axis/trunk/c/src/common/AxisUserAPI.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/common/AxisUserAPI.cpp?rev=392491&r1=392490&r2=392491&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/common/AxisUserAPI.cpp (original)
+++ webservices/axis/trunk/c/src/common/AxisUserAPI.cpp Sat Apr  8 00:38:02 2006
@@ -475,10 +475,12 @@
             case XSD_ARRAY:
             {
                 ((Axis_Array**) m_Array)[count] = new Axis_Array(*((Axis_Array**) array)[count]);
+                break;
             }
             case USER_TYPE:
             {
-                ((int*) m_Array)[count] = ((int*) array)[count];
+                m_Array[count] = array[count];
+                break;
             }
             case XSD_UNKNOWN:
             case XSD_ANY:
@@ -782,10 +784,12 @@
             case XSD_ARRAY:
             {
                 ((Axis_Array**) m_Array)[m_Size] = new Axis_Array(*(Axis_Array*) element);
+                break;
             }
             case USER_TYPE:
             {
                 m_Array[m_Size] = element;
+                break;
             }
             case XSD_UNKNOWN:
             case XSD_ANY:

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ArrayParamWriter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ArrayParamWriter.java?rev=392491&r1=392490&r2=392491&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ArrayParamWriter.java
(original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ArrayParamWriter.java
Sat Apr  8 00:38:02 2006
@@ -60,8 +60,14 @@
         {
             this.writer = new BufferedWriter(new FileWriter(getFilePath(), false));
             
-            writeClassComment();  
+            // Write prolog
+            writeClassComment(); 
+
+            // include system header files
+            writer.write("#include <stdlib.h>\n");
+            writer.write("\n");
             
+            // include header file for datatype
             writer.write("#include \"" + classname + ".h\"\n");
             writer.write("\n");
             
@@ -122,10 +128,22 @@
         {
             writer.write("extern void* Axis_Create_" + classname + "(int nSize)\n");
             writer.write("{\n");
+            
+            // Begin function body
+            
+            writer.write("\t" + classname + " *pArray = (" + classname + "*)malloc(sizeof("
+ classname + "));\n");
+            writer.write("\tmemset(pArray, 0, sizeof(" + classname + "));\n");
+            writer.write("\tpArray->m_Type = USER_TYPE;\n");
+            writer.write("\n");
 
-//            writer.write("\tm_Type = USER_TYPE;\n");
+            writer.write("\tif (nSize > 0)\n");
+            writer.write("\t{\n");
+            writer.write("\t\tpArray->m_Array = Axis_Create_" + attribs[0].getTypeName()

+                    + "(NULL, 1, nSize);\n");
+            writer.write("\t\tpArray->m_Size = nSize;\n"); 
+            writer.write("\t}\n");
             
-            writer.write("\treturn NULL;");
+            // End function body
 
             writer.write("}\n");
             writer.write("\n");
@@ -145,22 +163,16 @@
                     + "(" + classname + "* param)\n");
             writer.write("{\n");
             
-            writer.write("\tif (m_Array != NULL)\n");
+            writer.write("\tif (param == NULL)\n");
+            writer.write("\t\treturn;\n");
+            writer.write("\n");
+            writer.write("\tif (param->m_Array != NULL)\n");
             writer.write("\t{\n");
-            writer.write("\t\tif (m_Size > 0)\n");
-            writer.write("\t\t{\n");
-            writer.write("\t\t\tfor (int count = 0 ; count < m_Size ; count++)\n");
-            writer.write("\t\t\t{\n");
-            writer.write("\t\t\t\tif (m_Array[count] != NULL)\n");
-            writer.write("\t\t\t\t{\n");
-            writer.write("\t\t\t\t\tdelete ((" + attribs[0].getTypeName() + "**) m_Array)[count];\n");
-            writer.write("\t\t\t\t\tm_Array[count] = NULL;\n");
-            writer.write("\t\t\t\t}\n");
-            writer.write("\t\t\t}\n");
-            writer.write("\t\t}\n");
-            writer.write("\t\t\tdelete [] m_Array;\n");
+            writer.write("\t\tAxis_Delete_" +  attribs[0].getTypeName() 
+                    + "((" + attribs[0].getTypeName() + " *)param->m_Array, 1, param->m_Size);\n");
+            writer.write("\t\tfree(param->m_Array);\n");
             writer.write("\t}\n");
-            
+            writer.write("\tfree(param);\n");
             writer.write("}\n");
             writer.write("\n");            
         }

Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/c/AxisBenchClient.c
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/c/AxisBenchClient.c?rev=392491&r1=392490&r2=392491&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/c/AxisBenchClient.c (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/c/AxisBenchClient.c Sat Apr
 8 00:38:02 2006
@@ -108,6 +108,7 @@
 
     arrayIn.m_Array = ppBBDT;
     arrayIn.m_Size  = input->count;
+    arrayIn.m_Type  = USER_TYPE;
     
     input->infos =  &arrayIn;
     
@@ -129,6 +130,10 @@
         }
 
         output = doBenchRequest(ws, input);
+        if (exceptionOccurred == C_TRUE 
+              || output == NULL 
+              || get_AxisBench_Status(ws) == AXISC_FAIL )
+            break;
     }
 
     for( i = 0; i < input->count; i++)
@@ -140,8 +145,6 @@
       free(ppBBDT);
     if (buffer)
 	  free( buffer);
-    
-  	output = doBenchRequest(ws,input);
 
   	if (exceptionOccurred == C_TRUE 
   			|| output == NULL 



Mime
View raw message