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 di...@apache.org on 2005/12/05 18:43:39 UTC

svn commit: r354107 - in /webservices/axis/trunk/c: src/soap/ tests/auto_build/testcases/ tests/auto_build/testcases/client/cpp/ tests/auto_build/testcases/output/ tests/auto_build/testcases/wsdls/

Author: dicka
Date: Mon Dec  5 09:43:21 2005
New Revision: 354107

URL: http://svn.apache.org/viewcvs?rev=354107&view=rev
Log:
Re-work the logic for deserializing arrays to use peek when determinining if any more elements are present, otherwise we're unable to correctly use the peek afterwards until a complete element has been read.

I took this is as an opportunity to get the array deserialization to simply use the element deserialization methods (reducing maintenance overhead).

Including latest fixes for ElementFormDefaultTest which initially highlighted this problem, and added into unitTest.list.
Also updated NillableArraysClient.cpp to thoroughly check all return parameters - this test also highlighted a small problem with deserializing elements containing xsi:nil="true".

Modified:
    webservices/axis/trunk/c/src/soap/SoapDeSerializer.cpp
    webservices/axis/trunk/c/src/soap/SoapDeSerializer.h
    webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ElementFormDefaultTestClient.cpp
    webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/NillableArraysClient.cpp
    webservices/axis/trunk/c/tests/auto_build/testcases/output/ElementFormDefaultTestRequest.out
    webservices/axis/trunk/c/tests/auto_build/testcases/unitTest.list
    webservices/axis/trunk/c/tests/auto_build/testcases/wsdls/ElementFormDefaultTest.wsdl

Modified: webservices/axis/trunk/c/src/soap/SoapDeSerializer.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/soap/SoapDeSerializer.cpp?rev=354107&r1=354106&r2=354107&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/soap/SoapDeSerializer.cpp (original)
+++ webservices/axis/trunk/c/src/soap/SoapDeSerializer.cpp Mon Dec  5 09:43:21 2005
@@ -66,6 +66,7 @@
 #include "AxisSoapException.h"
 #include "../common/AxisGenException.h"
 #include "../common/AxisTrace.h"
+#include <axis/Axis.hpp>
 
 #include <list>
 #include <iostream>
@@ -582,10 +583,47 @@
  *    <points><x>7</x><y>8</y></points>
  *
  */
+ 
+void SoapDeSerializer::deserializeLiteralComplexArray(Axis_Array * pArray, void *pDZFunct,
+                void *pCreFunct, void *pDelFunct, void* pSizeFunct,
+                const AxisChar * pName, const AxisChar * pNamespace)
+{
+    while(true)
+    {
+        const char* elementName = peekNextElementName();
+        if(strcmp(elementName, pName) == 0)
+        {
+            pArray->addElement(getCmplxObject(pDZFunct, pCreFunct, pDelFunct, pName, pNamespace));
+        }
+        else
+        {
+            return;
+        }
+    }
+}
+
+void SoapDeSerializer::deserializeEncodedComplexArray(Axis_Array * pArray, void *pDZFunct,
+                void *pCreFunct, void *pDelFunct, void* pSizeFunct,
+                const AxisChar * pName, const AxisChar * pNamespace, int size)
+{
+    for (int count = 0 ; count < size; count++)
+    {
+        const char* elementName = peekNextElementName();
+        if(strcmp(elementName, pName) == 0)
+        {
+            pArray->addElement(getCmplxObject(pDZFunct, pCreFunct, pDelFunct, pName, pNamespace));
+        }
+        else
+        {
+            return;
+        }
+    }
+}
+
 Axis_Array*
 SoapDeSerializer::getCmplxArray ( Axis_Array* pArray, void *pDZFunct,
                 void *pCreFunct, void *pDelFunct, void *pSizeFunct,
-				 const AxisChar * pName, const AxisChar * pNamespace)
+                const AxisChar * pName, const AxisChar * pNamespace)
 {
     int nIndex = 0;
     void *pItem;
@@ -594,209 +632,54 @@
 
     if (AXIS_SUCCESS != m_nStatus)
     {
-	   return pArray;		/* if anything has gone wrong
-				 * earlier just do nothing */
+        return pArray;
+        /* if anything has gone wrong
+         * earlier just do nothing */
     }
 
     if (RPC_ENCODED == m_nStyle)
     {
-    	m_pNode = m_pParser->next ();
-    	/* just skip wrapper node with type info
-    	 * Ex:<tns:QuoteInfoTypeArray xmlns:tns="http://www.getquote.org/test">
-    	 */
-    	if (!m_pNode)
-    	{
-    	    return pArray;
-    	}
-    
-            if (END_ELEMENT == m_pNode->m_type2)
-    	{
-    	    return pArray;
-    	}
-    
-    	int arraySize = getArraySize (m_pNode);
+        m_pNode = m_pParser->next ();
+        /* just skip wrapper node with type info
+         * Ex:<tns:QuoteInfoTypeArray xmlns:tns="http://www.getquote.org/test">
+         */
+        if (!m_pNode)
+        {
+            return pArray;
+        }
     
-    	if (arraySize == 0)
-    	{
-    		m_pNode = m_pParser->next ();	/* skip end element node too */
-    		return pArray;
-    	}
-    	else if (arraySize > 0)
-    	{
-    	    for (; nIndex < arraySize; nIndex++)
-    	    {
-        		m_pNode = m_pParser->next ();
-        		/* wrapper node without type info  Ex: <item> */
-        		if (!m_pNode)
-        		{
-        			for (int deleteCount = 0 ; deleteCount < nIndex ; deleteCount++)
-					{
-        				TRACE_OBJECT_DELETE_FUNCT_ENTRY(pDelFunct, pArray->m_Array[deleteCount], false, 0);
-        				((AXIS_OBJECT_DELETE_FUNCT) pDelFunct) (pArray->m_Array[deleteCount], false, 0);
-        				TRACE_OBJECT_DELETE_FUNCT_EXIT(pDelFunct);
-					}
-					delete [] pArray->m_Array;
-        
-        		    pArray->m_Array = NULL;
-        		    pArray->m_Size = 0;
-        		    return pArray;
-        		}
-        
-        		if (C_RPC_PROVIDER == getCurrentProviderType ())
-        		{
-        		    // Disable C support
-        		    //IWrapperSoapDeSerializer_C cWSD;
-        		    //cWSD._object = this;
-        		    //cWSD._functions = &IWrapperSoapDeSerializer::ms_VFtable;
-        		    //((AXIS_DESERIALIZE_FUNCT)pDZFunct)(pItem, &cWSD);
-        		}
-        		else
-        		{
-					TRACE_OBJECT_CREATE_FUNCT_ENTRY(pCreFunct, NULL, false, 0);
-    				pArray->addElement(((AXIS_OBJECT_CREATE_FUNCT) pCreFunct) (NULL, false, 0));
-    				TRACE_OBJECT_CREATE_FUNCT_EXIT(pCreFunct, pArray->m_Array[nIndex]);
-
-        			TRACE_DESERIALIZE_FUNCT_ENTRY(pDZFunct, pArray->m_Array[nIndex], this);
-        		    m_nStatus =	((AXIS_DESERIALIZE_FUNCT) pDZFunct) (pArray->m_Array[nIndex], this);
-        			TRACE_DESERIALIZE_FUNCT_EXIT(pDZFunct, m_nStatus);
-        		}
-        
-        		m_pNode = m_pParser->next ();	/* skip end element node too */
-        
-        		if (!m_pNode)
-        		{
-        			for (int deleteCount = 0 ; deleteCount < nIndex ; deleteCount++)
-					{
-        				TRACE_OBJECT_DELETE_FUNCT_ENTRY(pDelFunct, pArray->m_Array[deleteCount], false, 0);
-        				((AXIS_OBJECT_DELETE_FUNCT) pDelFunct) (pArray->m_Array[deleteCount], false, 0);
-        				TRACE_OBJECT_DELETE_FUNCT_EXIT(pDelFunct);
-					}
-					delete [] pArray->m_Array;
-        
-        		    pArray->m_Array = NULL;
-        		    pArray->m_Size = 0;
-        		    return pArray;
-        		}
-    	    }
+        if (END_ELEMENT == m_pNode->m_type2)
+        {
+            return pArray;
+        }
     
-    	    m_pNode = m_pParser->next ();	/* skip end element node too */
+        int arraySize = getArraySize (m_pNode);
     
-    	    return pArray;
-    	}
+        if (arraySize == 0)
+        {
+            m_pNode = m_pParser->next ();   /* skip end element node too */
+            return pArray;
+        }
+        else if (arraySize > 0)
+        {
+            deserializeEncodedComplexArray(pArray, pDZFunct, pCreFunct, pDelFunct,
+                pSizeFunct, pName, pNamespace, arraySize);
+            
+            if (m_nStatus != AXIS_FAIL)
+            {
+                return pArray;
+            }
+        }
     }
     else
-    {   // doc/literal
-        while (true)
+    {
+        deserializeLiteralComplexArray(pArray, pDZFunct, pCreFunct, pDelFunct,
+            pSizeFunct, pName, pNamespace);
+
+        if (m_nStatus != AXIS_FAIL)
         {
-    		if (!m_pNode)
-    		{
-               /* if there is an unprocessed node that may be
-                * one left from last array deserialization 
-                */
-    		    m_pNode = m_pParser->next ();
-    		}
-    
-    		/* wrapper node without type info  Ex: <phonenumbers> */
-    		if (!m_pNode)
-    		{
-				for (int deleteCount = 0 ; deleteCount < pArray->m_Size ; deleteCount++)
-				{
-    				TRACE_OBJECT_DELETE_FUNCT_ENTRY(pDelFunct, pArray->m_Array[deleteCount], false, 0);
-    				((AXIS_OBJECT_DELETE_FUNCT) pDelFunct) (pArray->m_Array[deleteCount], false, 0);
-    				TRACE_OBJECT_DELETE_FUNCT_EXIT(pDelFunct);
-				}
-				delete [] pArray->m_Array;
-    		    pArray->m_Array = NULL;
-    		    pArray->m_Size = 0;
-    		    return pArray;
-    		}
-    
-    		if (0 == strcmp (pName, m_pNode->m_pchNameOrValue))
-    		{
-    		    /* if this node contain attributes let them be used by the
-    		     * complex type's deserializer
-    		     */
-    		    if (0 != m_pNode->m_pchAttributes[0])
-    		    {
-    			     m_pCurrNode = m_pNode;
-    		    }
-    
-    		    m_pNode = NULL;	/* recognized and used the node */
-    
-    		    if (C_DOC_PROVIDER == getCurrentProviderType ())
-    		    {
-    			// Disable C support
-    			//IWrapperSoapDeSerializer_C cWSD;
-    			//cWSD._object = this;
-    			//cWSD._functions = &IWrapperSoapDeSerializer::ms_VFtable;
-    			//m_nStatus = ((AXIS_DESERIALIZE_FUNCT)pDZFunct)
-    			//   (pItem, &cWSD);
-    		    }
-    		    else
-    		    {
-					TRACE_OBJECT_CREATE_FUNCT_ENTRY(pCreFunct, NULL, false, INITIAL_ARRAY_SIZE);
-					void* object = ((AXIS_OBJECT_CREATE_FUNCT) pCreFunct) (NULL,
-							false,
-							INITIAL_ARRAY_SIZE);
-					TRACE_OBJECT_CREATE_FUNCT_EXIT(pCreFunct, object);
-
-    				TRACE_DESERIALIZE_FUNCT_ENTRY(pDZFunct, object, this);
-    			    m_nStatus =	((AXIS_DESERIALIZE_FUNCT) pDZFunct) (object, this);
-    				TRACE_DESERIALIZE_FUNCT_EXIT(pDZFunct, m_nStatus);
-                    pArray->addElement(object);
-    		    }
-    
-    		    if (AXIS_SUCCESS == m_nStatus)
-    		    {
-                    /* skip end element of the array item */
-                    m_pNode = m_pParser->next ();
-    
-                    if (m_pNode->m_type == END_ELEMENT)
-                    {
-                        //Skip past end of item
-                        //m_pNode = m_pParser->next ();
-    
-                        if (0 == strcmp (pName, m_pNode->m_pchNameOrValue))
-                        {
-                            if (m_pNode->m_type != START_ELEMENT)
-                            {
-                                m_pNode = NULL;
-                            }
-                        }
-                    }
-    // < FJP
-                    continue;
-                }
-    		}
-    		else
-    		{
-    		    return pArray;
-    		}
-    		/* if we come here it is an error situation */
-    		/*
-    		 * not an  error for self referenced array or empty array
-    		 * TODO: Need to verify what WS-I 1.0 say
-    		 * <xsd:complexType name="Type1">
-    		 *  <xsd:sequence>
-    		 *    <xsd:element name="types" maxOccurs="unbounded" minOccurs="0"
-    		 *         type="tns:Type1"/>
-    		 *    <xsd:element name="type" minOccurs="0" type="xsd:string"/>
-    		 *  </xsd:sequence>
-    		 * </xsd:complexType>        
-    		 */
-			for (int deleteCount = 0 ; deleteCount < pArray->m_Size ; deleteCount++)
-			{
-    			TRACE_OBJECT_DELETE_FUNCT_ENTRY(pDelFunct, pArray->m_Array[deleteCount], false, 0);
-    			((AXIS_OBJECT_DELETE_FUNCT) pDelFunct) (pArray->m_Array[deleteCount], false, 0);
-    			TRACE_OBJECT_DELETE_FUNCT_EXIT(pDelFunct);
-			}
-			delete [] pArray->m_Array;
-    
-    		pArray->m_Array = 0;
-    		pArray->m_Size = 0;
-    
-    		return pArray;
-    	}
+            return pArray;
+        }
     }
     m_nStatus = AXIS_FAIL;
     m_pNode = NULL;
@@ -804,6 +687,7 @@
     return pArray;
 }
 
+
 /*
  * Get Size of the single dimension array from arrayType attribute
  * Ex : enc:arrayType="xs:string[6]"
@@ -853,144 +737,41 @@
  *
  *
  */
-
-void SoapDeSerializer::deserializeEncodedArray (Axis_Array* pArray, IAnySimpleType* pSimpleType, const AxisChar* pName, const AxisChar* pNamespace)
+void SoapDeSerializer::deserializeEncodedArray (Axis_Array* pArray, IAnySimpleType* pSimpleType, const AxisChar* pName, const AxisChar* pNamespace, int size)
 {
-    pArray->m_Array = new void*[pArray->m_Size];
-    if (!pArray->m_Array)
-    {
-        pArray->m_Size = 0;
-        m_nStatus = AXIS_FAIL;
-        return;
-    }
-    for (int nIndex = 0; nIndex < pArray->m_Size; nIndex++)
+    for (int count = 0 ; count < size; count++)
     {
-        /* wrapper node without type info  Ex: <item>*/
-        m_pNode = m_pParser->next();
-        m_pNode = m_pParser->next(true); /* charactor node */
-        if (m_pNode && (CHARACTER_ELEMENT == m_pNode->m_type))
+        const char* elementName = peekNextElementName();
+        if(strcmp(elementName, pName) == 0)
         {
-            pSimpleType->deserialize(m_pNode->m_pchNameOrValue);
-            pArray->m_Array[nIndex] = pSimpleType->getValue();
-            m_pNode = m_pParser->next(); /* skip end element node too */
-            continue;
+            getElement(pName, pNamespace, pSimpleType);
+            void * pValue = pSimpleType->getValue();
+            pArray->addElement(pValue);
+            Axis::AxisDelete(pValue, pSimpleType->getType());
         }
-        else if (m_pNode && (END_ELEMENT == m_pNode->m_type))
+        else
         {
-            pSimpleType->deserialize("");
-            pArray->m_Array[nIndex] = pSimpleType->getValue();
-            continue;
+            return;
         }
-        /* error : unexpected element type or end of stream */
-        m_nStatus = AXIS_FAIL;
-        delete [] pArray->m_Array;
-        pArray->m_Array = 0;
-        pArray->m_Size = 0;
-        return;
     }
-    m_pNode = m_pParser->next(); /* skip end element node too */
-    return;
 }
 
 void SoapDeSerializer::deserializeLiteralArray (Axis_Array* pArray, IAnySimpleType* pSimpleType, const AxisChar* pName, const AxisChar* pNamespace)
 {
-    pArray->m_Array = new void*[INITIAL_ARRAY_SIZE];
-    if (!pArray->m_Array)
-        return;
-    pArray->m_Size = INITIAL_ARRAY_SIZE;
-    int nIndex = 0;
     while(true)
     {
-        for (; nIndex < pArray->m_Size ; nIndex++)
+        const char* elementName = peekNextElementName();
+        if(strcmp(elementName, pName) == 0)
         {
-            if (!m_pNode)
-                /* if there is an unprocessed node that may be one left */
-                /* from last array deserialization */
-                m_pNode = m_pParser->next();
-                /* wrapper node without type info Ex: <phonenumbers>*/
-            if (!m_pNode)
-            {
-                m_nStatus = AXIS_FAIL;
-                delete [] pArray->m_Array;
-                pArray->m_Array = 0;
-                pArray->m_Size = 0;
-                return;
-            }
-            if (0 == strcmp(pName, m_pNode->m_pchNameOrValue))
-            {
-                bool    bNillFound = false;
-                for (int i = 0; m_pNode->m_pchAttributes[i] && !bNillFound; i += 3)
-                {
-                    string sLocalName = m_pNode->m_pchAttributes[i];
-                    string sValue = m_pNode->m_pchAttributes[i + 2];
-        
-                    if( strcmp( "nil", sLocalName.c_str()) == 0 &&
-                        strcmp( "true", sValue.c_str()) == 0)
-                    {
-                        bNillFound = true;
-                    }
-                }
-                
-                m_pNode = m_pParser->next(true); /* charactor node */
-                if (m_pNode && (CHARACTER_ELEMENT == m_pNode->m_type))
-                {
-                    pSimpleType->deserialize(m_pNode->m_pchNameOrValue);
-                    pArray->m_Array[nIndex] =  pSimpleType->getValue();
-                    m_pNode = m_pParser->next();
-                    /* skip end element node too */
-                    m_pNode = NULL;
-                    /* this is important in doc/lit style when */
-                    /* deserializing arrays */
-                    continue;
-                }
-                else if (m_pNode && (END_ELEMENT == m_pNode->m_type) && bNillFound)
-                {
-                    pArray->m_Array[nIndex] = NULL;
-                    m_pNode = NULL;
-                    continue;
-                }
-                else if (m_pNode && (END_ELEMENT == m_pNode->m_type))
-                {
-                    pSimpleType->deserialize("");
-                    pArray->m_Array[nIndex] = pSimpleType->getValue();
-                    m_pNode = NULL;
-                    continue;
-                }
-                /* error : unexpected element type or */
-                /* end of the stream */
-            }
-            else
-            {
-                if (nIndex > 0)
-                {
-                    pArray->m_Size = nIndex; 
-                    /* put the actual deserialized item size */
-                    /* note we do not make m_pNode = NULL because */
-                    /* this node doesnot belong to this array */
-                    return;
-                }
-                /* error : no elements deserialized */
-            }
-            /* if we come here it is an error situation */
-            m_nStatus = AXIS_FAIL;
-            m_pNode = NULL;
-            delete [] pArray->m_Array;
-            pArray->m_Array = 0;
-            pArray->m_Size = 0;
-            return;
+    		getElement(pName, pNamespace, pSimpleType);
+            void * pValue = pSimpleType->getValue();
+            pArray->addElement(pValue);
+            Axis::AxisDelete(pValue, pSimpleType->getType());
         }
-        /* if we come here that means the array allocated is */
-        /* not enough. So double it */
-        void** tmp = pArray->m_Array;
-        pArray->m_Array = new void*[pArray->m_Size*2];
-        if (!pArray->m_Array) 
+        else
         {
-            pArray->m_Size = 0;
             return;
         }
-        memcpy(pArray->m_Array,tmp,pArray->m_Size*sizeof(void*));
-        delete [] tmp;
-        pArray->m_Size *= 2;
     }
 }
 
@@ -1020,17 +801,17 @@
 		    return Array;
 		}
 	
-		Array->m_Size = getArraySize (m_pNode);
+		int size = getArraySize (m_pNode);
 	
-		if (Array->m_Size == 0)
+		if (size == 0)
 		{
 			m_pNode = m_pParser->next ();	/* skip end element node too */
 			return Array;
 		}
-		else if (Array->m_Size > 0)
+		else if (size > 0)
         {
             IAnySimpleType* pSimpleType = AxisUtils::createSimpleTypeObject(nType);
-            deserializeEncodedArray(Array, pSimpleType, pName, pNamespace);
+            deserializeEncodedArray(Array, pSimpleType, pName, pNamespace, size);
             delete pSimpleType;
             
             if ( m_nStatus != AXIS_FAIL)
@@ -1904,7 +1685,8 @@
 				}
 				else if (m_pNode && (END_ELEMENT == m_pNode->m_type) && bNillFound  ) //xsi:nil="true"
 				{
-					m_pNode = m_pParser->next();
+                    pSimpleType->deserialize(NULL);
+					m_pNode = NULL
 					return;
 				} 
 
@@ -2008,7 +1790,8 @@
         }
         else if (m_pNode && (END_ELEMENT == m_pNode->m_type) && bNillFound ) //xsi:nil="true"
         {
-            m_pNode = m_pParser->next();
+            pSimpleType->deserialize(NULL);
+            m_pNode = NULL;
             return;
         }        
         else if (m_pNode && (END_ELEMENT == m_pNode->m_type) ) // empty tag case <tag/>

Modified: webservices/axis/trunk/c/src/soap/SoapDeSerializer.h
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/soap/SoapDeSerializer.h?rev=354107&r1=354106&r2=354107&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/soap/SoapDeSerializer.h (original)
+++ webservices/axis/trunk/c/src/soap/SoapDeSerializer.h Mon Dec  5 09:43:21 2005
@@ -361,7 +361,9 @@
     xsd__base64Binary decodeFromBase64Binary(const AxisChar* pValue);
     xsd__hexBinary decodeFromHexBinary(const AxisChar* pValue);
     void deserializeLiteralArray (Axis_Array* pArray, IAnySimpleType* pSimpleType, const AxisChar* pName, const AxisChar* pNamespace);
-    void deserializeEncodedArray (Axis_Array* pArray, IAnySimpleType* pSimpleType, const AxisChar* pName, const AxisChar* pNamespace);
+    void deserializeEncodedArray (Axis_Array* pArray, IAnySimpleType* pSimpleType, const AxisChar* pName, const AxisChar* pNamespace, int size);
+	void deserializeLiteralComplexArray(Axis_Array * pArray, void *pDZFunct, void *pCreFunct, void *pDelFunct, void* pSizeFunct, const AxisChar * pName, const AxisChar * pNamespace);
+	void deserializeEncodedComplexArray(Axis_Array * pArray, void *pDZFunct, void *pCreFunct, void *pDelFunct, void* pSizeFunct, const AxisChar * pName, const AxisChar * pNamespace, int size);
 
 	LONGLONG strtoll(const char *);
 };

Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ElementFormDefaultTestClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ElementFormDefaultTestClient.cpp?rev=354107&r1=354106&r2=354107&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ElementFormDefaultTestClient.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ElementFormDefaultTestClient.cpp Mon Dec  5 09:43:21 2005
@@ -72,7 +72,7 @@
 				complexType->setsomeData(345);
 
 				UnqualifiedSimpleComplexType_Array * arrayOfComplexType = new UnqualifiedSimpleComplexType_Array();
-				UnqualifiedSimpleComplexType** complexTypeArray = new UnqualifiedSimpleComplexType*();
+				UnqualifiedSimpleComplexType** complexTypeArray = new UnqualifiedSimpleComplexType*[arraySize];
 				for (count = 0 ; count < arraySize ; count++ )
 				{
 					complexTypeArray[count] = new UnqualifiedSimpleComplexType();
@@ -105,9 +105,29 @@
 					&outComplexType, 
 					&outArrayOfComplexType);
 
+				// Clean up inputs
+				delete [] stringElement;
+				for (count = 0 ; count < arraySize ; count++ )
+				{
+					delete arrayOfInteger[count];
+				}
+				delete [] arrayOfInteger;
+				delete integerArrayElement;
+				delete optionalInteger;
+				delete complexType;
+				for (count = 0 ; count < arraySize ; count++ )
+				{
+					delete complexTypeArray[count];
+				}
+				delete [] complexTypeArray;
+				delete arrayOfComplexType;
+				
+
 				// Print output values
 				cout << "String element = " << outStringElement << endl;
+				delete [] outStringElement;
 				cout << "Integer element = " << *outIntegerElement << endl;
+				delete outIntegerElement;
 				cout << "Array of integer elements" << endl;
 				outputSize = 0;
 				const xsd__integer** outArrayOfIntegers = outIntegerArrayElement->get(outputSize);
@@ -122,9 +142,11 @@
 						cout << " element[" << count << "] = NULL" << endl;
 					}
 				}
+				delete outIntegerArrayElement;
 				if (outOptionalIntegerElement != NULL)
 				{
 					cout << "Optional integer element = " << *outOptionalIntegerElement << endl;
+					delete outOptionalIntegerElement;
 				}
 				else
 				{
@@ -133,12 +155,14 @@
 				if (outNillableIntegerElement != NULL)
 				{
 					cout << "Nillable integer element = " << *outNillableIntegerElement << endl;
+					delete outNillableIntegerElement;
 				}
 				else
 				{
 					cout << "Nillable integer element = NULL" << endl;
 				}
 				cout << "SimpleComplexType->someData = " << outComplexType->someData << endl;
+				delete outComplexType;
 				cout << "Array of complex elements" << endl;
 				outputSize = 0;
 				UnqualifiedSimpleComplexType** outComplexArray = outArrayOfComplexType->get(outputSize);
@@ -153,6 +177,7 @@
 						cout << " element[" << count << "] = NULL" << endl;
 					}
 				}
+				delete outArrayOfComplexType;
 			}
 
 
@@ -177,7 +202,7 @@
 				complexType->setsomeData(345);
 
 				QualifiedSimpleComplexType_Array * arrayOfComplexType = new QualifiedSimpleComplexType_Array();
-				QualifiedSimpleComplexType** complexTypeArray = new QualifiedSimpleComplexType*();
+				QualifiedSimpleComplexType** complexTypeArray = new QualifiedSimpleComplexType*[arraySize];
 				for (count = 0 ; count < arraySize ; count++ )
 				{
 					complexTypeArray[count] = new QualifiedSimpleComplexType();
@@ -210,9 +235,28 @@
 					&outComplexType, 
 					&outArrayOfComplexType);
 
+				// Clean up inputs
+				delete [] stringElement;
+				for (count = 0 ; count < arraySize ; count++ )
+				{
+					delete arrayOfInteger[count];
+				}
+				delete [] arrayOfInteger;
+				delete integerArrayElement;
+				delete optionalInteger;
+				delete complexType;
+				for (count = 0 ; count < arraySize ; count++ )
+				{
+					delete complexTypeArray[count];
+				}
+				delete [] complexTypeArray;
+				delete arrayOfComplexType;
+
 				// Print output values
 				cout << "String element = " << outStringElement << endl;
+				delete [] outStringElement;
 				cout << "Integer element = " << *outIntegerElement << endl;
+				delete outIntegerElement;
 				cout << "Array of integer elements" << endl;
 				outputSize = 0;
 				const xsd__integer** outArrayOfIntegers = outIntegerArrayElement->get(outputSize);
@@ -227,9 +271,11 @@
 						cout << " element[" << count << "] = NULL" << endl;
 					}
 				}
+				delete outIntegerArrayElement;
 				if (outOptionalIntegerElement != NULL)
 				{
 					cout << "Optional integer element = " << *outOptionalIntegerElement << endl;
+					delete outOptionalIntegerElement;
 				}
 				else
 				{
@@ -238,12 +284,14 @@
 				if (outNillableIntegerElement != NULL)
 				{
 					cout << "Nillable integer element = " << *outNillableIntegerElement << endl;
+					delete outNillableIntegerElement;
 				}
 				else
 				{
 					cout << "Nillable integer element = NULL" << endl;
 				}
 				cout << "SimpleComplexType->someData = " << outComplexType->someData << endl;
+				delete outComplexType;
 				cout << "Array of complex elements" << endl;
 				outputSize = 0;
 				QualifiedSimpleComplexType** outComplexArray = outArrayOfComplexType->get(outputSize);
@@ -258,6 +306,7 @@
 						cout << " element[" << count << "] = NULL" << endl;
 					}
 				}
+				delete outArrayOfComplexType;
 			}
 
 			// Nested within a Complex Type
@@ -282,7 +331,7 @@
 				complexType->setsomeData(345);
 
 				UnqualifiedSimpleComplexType_Array * arrayOfComplexType = new UnqualifiedSimpleComplexType_Array();
-				UnqualifiedSimpleComplexType** complexTypeArray = new UnqualifiedSimpleComplexType*();
+				UnqualifiedSimpleComplexType** complexTypeArray = new UnqualifiedSimpleComplexType*[arraySize];
 				for (count = 0 ; count < arraySize ; count++ )
 				{
 					complexTypeArray[count] = new UnqualifiedSimpleComplexType();
@@ -301,7 +350,20 @@
 
 				// Call method on web service
 				ElementFormDefaultIsUnqualified * output = ws.nestedElementFormDefaultIsUnqualified(&input);
-				
+
+				// Clean up inputs
+				for (count = 0 ; count < arraySize ; count++ )
+				{
+					delete arrayOfInteger[count];
+				}
+				delete [] arrayOfInteger;
+				delete integerArrayElement;
+				for (count = 0 ; count < arraySize ; count++ )
+				{
+					delete complexTypeArray[count];
+				}
+				delete [] complexTypeArray;
+				delete arrayOfComplexType;
 
 				// Print output values
 				cout << "String element = " << output->aStringType << endl;
@@ -351,6 +413,7 @@
 						cout << " element[" << count << "] = NULL" << endl;
 					}
 				}
+				delete output;
 			}
 
 			// form="qualified"
@@ -374,7 +437,7 @@
 				complexType->setsomeData(345);
 
 				QualifiedSimpleComplexType_Array * arrayOfComplexType = new QualifiedSimpleComplexType_Array();
-				QualifiedSimpleComplexType** complexTypeArray = new QualifiedSimpleComplexType*();
+				QualifiedSimpleComplexType** complexTypeArray = new QualifiedSimpleComplexType*[arraySize];
 				for (count = 0 ; count < arraySize ; count++ )
 				{
 					complexTypeArray[count] = new QualifiedSimpleComplexType();
@@ -393,7 +456,20 @@
 
 				// Call method on web service
 				ElementFormDefaultIsQualified * output = ws.nestedElementFormDefaultIsQualified(&input);
-				
+
+				// Clean up inputs
+				for (count = 0 ; count < arraySize ; count++ )
+				{
+					delete arrayOfInteger[count];
+				}
+				delete [] arrayOfInteger;
+				delete integerArrayElement;
+				for (count = 0 ; count < arraySize ; count++ )
+				{
+					delete complexTypeArray[count];
+				}
+				delete [] complexTypeArray;
+				delete arrayOfComplexType;
 
 				// Print output values
 				cout << "String element = " << output->aStringType << endl;
@@ -443,6 +519,7 @@
 						cout << " element[" << count << "] = NULL" << endl;
 					}
 				}
+				delete output;
 			}
 
 

Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/NillableArraysClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/NillableArraysClient.cpp?rev=354107&r1=354106&r2=354107&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/NillableArraysClient.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/NillableArraysClient.cpp Mon Dec  5 09:43:21 2005
@@ -37,6 +37,7 @@
 
 	try
 	{
+		int outputSize = 0;
 		sprintf(endpoint, "%s", url);
 		NillableArrays ws(endpoint);
 
@@ -66,18 +67,28 @@
 		boolean_in.set(booleanInArray,ARRAYSIZE);
 		cout << "invoking echoBooleanArray..."<<endl;
 		boolean_out = ws.echoBooleanArray(&boolean_in);
-				cout << "successful "<<endl;
-/* The response is not being checked at present
-		if(boolean_out.m_Size == ARRAYSIZE) {
-			if(boolean_out.m_Array[1])
-				cout << "failed "<<endl;		
-			else if(*(boolean_out.m_Array[0]) == (xsd__boolean)0 && *(boolean_out.m_Array[2]) == (xsd__boolean)1)
-				cout << "successful "<<endl;
-			else
-				cout << "failed "<<endl;		
-		} else
-			cout << "failed "<<endl;		
-*/
+
+		outputSize = 0;
+		const xsd__boolean ** booleanArray = boolean_out->get(outputSize);
+		if(outputSize ==ARRAYSIZE)
+		{
+			if(booleanArray[1])
+			{
+				cout << "failed "<<endl;		
+			}
+			else if( (*booleanArray[0] == b1) && (*booleanArray[2] == b3) )
+			{
+				cout << "successful "<<endl;
+			}
+			else
+			{
+				cout << "failed "<<endl;
+			}
+		}
+		else
+		{
+			cout << "failed "<<endl;
+		}
 
 		/* Test an short array */
 		xsd__short s1 = (xsd__short)252;
@@ -89,18 +100,29 @@
 		short_in.set(shortInArray,ARRAYSIZE);
 		cout << "invoking echoShortArray..."<<endl;
 		short_out = ws.echoShortArray(&short_in);
-				cout << "successful "<<endl;
-/* The response is not being checked at present
-		if(short_out.m_Size == ARRAYSIZE) {
-			if(short_out.m_Array[1])
-				cout << "failed "<<endl;		
-			else if(*(short_out.m_Array[0]) == 252 && *(short_out.m_Array[2]) == 254)
-				cout << "successful "<<endl;
-			else
-				cout << "failed "<<endl;		
-		} else
-			cout << "failed "<<endl;		
-*/
+
+		outputSize = 0;
+		const xsd__short ** shortArray = short_out->get(outputSize);
+		if(outputSize ==ARRAYSIZE)
+		{
+			if(shortArray[1])
+			{
+				cout << "failed "<<endl;		
+			}
+			else if( (*shortArray[0] == s1) && (*shortArray[2] == s3) )
+			{
+				cout << "successful "<<endl;
+			}
+			else
+			{
+				cout << "failed "<<endl;
+			}
+		}
+		else
+		{
+			cout << "failed "<<endl;
+		}
+
 		/* Test an int array */
 		xsd__int val1 = 1000000;
 		xsd__int val3 = 1000002;
@@ -111,18 +133,29 @@
 		int_in.set(intInArray,ARRAYSIZE);
 		cout << "invoking echoIntArray..."<<endl;
 		int_out = ws.echoIntArray(&int_in);
-				cout << "successful "<<endl;
-/* The response is not being checked at present
-		if(int_out.m_Size ==ARRAYSIZE) {
-			if(int_out.m_Array[1])
-				cout << "failed "<<endl;		
-			else if(*(int_out.m_Array[0]) == val1 && *(int_out.m_Array[2]) == val3)
-				cout << "successful "<<endl;
-			else
-				cout << "failed "<<endl;		
-		} else
+
+		outputSize = 0;
+		const xsd__int ** intArray = int_out->get(outputSize);
+		if(outputSize ==ARRAYSIZE)
+		{
+			if(intArray[1])
+			{
+				cout << "failed "<<endl;		
+			}
+			else if( (*intArray[0] == val1) && (*intArray[2] == val3) )
+			{
+				cout << "successful "<<endl;
+			}
+			else
+			{
+				cout << "failed "<<endl;
+			}
+		}
+		else
+		{
 			cout << "failed "<<endl;
-*/
+		}
+
 
 		/* Test a long array */
 		xsd__long l1 = (xsd__long)200001;
@@ -134,18 +167,28 @@
 		long_in.set(longInArray,ARRAYSIZE);
 		cout << "invoking echoLongArray..."<<endl;
 		long_out = ws.echoLongArray(&long_in);
-				cout << "successful "<<endl;
-/* The response is not being checked at present
-		if(long_out.m_Size == ARRAYSIZE) {
-			if(long_out.m_Array[1])
-				cout << "failed "<<endl;		
-			else if(*(long_out.m_Array[0]) == (xsd__long)200001 && *(long_out.m_Array[2]) == (xsd__long)200003)
-				cout << "successful "<<endl;
-			else
-				cout << "failed "<<endl;		
-		} else
-			cout << "failed "<<endl;		
-*/
+
+		outputSize = 0;
+		const xsd__long ** longArray = long_out->get(outputSize);
+		if(outputSize ==ARRAYSIZE)
+		{
+			if(longArray[1])
+			{
+				cout << "failed "<<endl;		
+			}
+			else if( (*longArray[0] == l1) && (*longArray[2] == l3) )
+			{
+				cout << "successful "<<endl;
+			}
+			else
+			{
+				cout << "failed "<<endl;
+			}
+		}
+		else
+		{
+			cout << "failed "<<endl;
+		}
 
 		/* Test a float array */
 		xsd__float f1 = (xsd__float)11.111;
@@ -157,18 +200,28 @@
 		float_in.set(floatInArray,ARRAYSIZE);
 		cout << "invoking echoFloatArray..."<<endl;
 		float_out = ws.echoFloatArray(&float_in);
-				cout << "successful "<<endl;
-/* The response is not being checked at present
-		if(float_out.m_Size ==ARRAYSIZE) {
-			if(float_out.m_Array[1])
-				cout << "failed "<<endl;		
-			else if(*(float_out.m_Array[0]) == (xsd__float)11.111 && *(float_out.m_Array[2]) == (xsd__float)33.111)
-				cout << "successful "<<endl;
-			else
-				cout << "failed "<<endl;		
-		} else
-			cout << "failed "<<endl;		
-*/
+
+		outputSize = 0;
+		const xsd__float ** floatArray = float_out->get(outputSize);
+		if(outputSize ==ARRAYSIZE)
+		{
+			if(floatArray[1])
+			{
+				cout << "failed "<<endl;		
+			}
+			else if( (*floatArray[0] == f1) && (*floatArray[2] == f3) )
+			{
+				cout << "successful "<<endl;
+			}
+			else
+			{
+				cout << "failed "<<endl;
+			}
+		}
+		else
+		{
+			cout << "failed "<<endl;
+		}
 
 		/* Test a double array */
 		xsd__double d1 = (xsd__double)71.1565;
@@ -181,18 +234,28 @@
 		double_in.set(doubleInArray,ARRAYSIZE);
 		cout << "invoking echoDoubleArray..."<<endl;
 		double_out = ws.echoDoubleArray(&double_in);
-				cout << "successful "<<endl;
-/* The response is not being checked at present
-		if(double_out.m_Size ==ARRAYSIZE) {
-			if(double_out.m_Array[1])
-				cout << "failed "<<endl;		
-			else if(*(double_out.m_Array[0]) == (xsd__double)71.1565 && *(double_out.m_Array[2]) == (xsd__double)73.1565)
-				cout << "successful "<<endl;
-			else
-				cout << "failed "<<endl;		
-		} else
-			cout << "failed "<<endl;		
-*/
+
+		outputSize = 0;
+		const xsd__double ** doubleArray = double_out->get(outputSize);
+		if(outputSize ==ARRAYSIZE)
+		{
+			if(doubleArray[1])
+			{
+				cout << "failed "<<endl;		
+			}
+			else if( (*doubleArray[0] == d1) && (*doubleArray[2] == d3) )
+			{
+				cout << "successful "<<endl;
+			}
+			else
+			{
+				cout << "failed "<<endl;
+			}
+		}
+		else
+		{
+			cout << "failed "<<endl;
+		}
 
 		/* Test a string array */
 		static char* str1 = "Apache";
@@ -204,17 +267,27 @@
 		string_in.set(stringInArray,ARRAYSIZE);
 		cout << "invoking echoStringArray..."<<endl;
 		string_out = ws.echoStringArray(&string_in);
-		int outputSize =0;
+		outputSize =0;
 		const xsd__string *output = string_out->get(outputSize);
-		if(outputSize ==ARRAYSIZE) {
+		if(outputSize ==ARRAYSIZE)
+		{
 			if(output[1])
+			{
 				cout << "failed "<<endl;		
+			}
 			else if( (strcmp(output[0], str1) == 0) && (strcmp(output[2], str2) == 0) )
+			{
 				cout << "successful "<<endl;
+			}
 			else
-				cout << "failed "<<endl;		
-		} else
-			cout << "failed "<<endl;		
+			{
+				cout << "failed "<<endl;
+			}
+		}
+		else
+		{
+			cout << "failed "<<endl;
+		}
 
 	}
 	catch(AxisException& e)

Modified: webservices/axis/trunk/c/tests/auto_build/testcases/output/ElementFormDefaultTestRequest.out
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/output/ElementFormDefaultTestRequest.out?rev=354107&r1=354106&r2=354107&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/output/ElementFormDefaultTestRequest.out (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/output/ElementFormDefaultTestRequest.out Mon Dec  5 09:43:21 2005
@@ -1,5 +1,5 @@
-POST /XSD_decimal/services/XSD_decimalSOAP HTTP/1.1
-Host: localhost:13260
+POST /axis/ElementFormDefaultTest HTTP/1.1
+Host: 127.0.0.1:13260
 Content-Type: text/xml; charset=UTF-8
 SOAPAction: "null"
 Content-Length: 887
@@ -20,10 +20,10 @@
 </arrayOfSimpleComplexType><arrayOfSimpleComplexType><someData>1</someData>
 </arrayOfSimpleComplexType></ns1:elementFormDefaultIsUnqualifiedRequest>
 </SOAP-ENV:Body>
-</SOAP-ENV:Envelope>
-
-POST /XSD_decimal/services/XSD_decimalSOAP HTTP/1.1
-Host: localhost:13260
+</SOAP-ENV:Envelope>
+
+POST /axis/ElementFormDefaultTest HTTP/1.1
+Host: 127.0.0.1:13260
 Content-Type: text/xml; charset=UTF-8
 SOAPAction: "null"
 Content-Length: 979
@@ -46,12 +46,13 @@
 </SOAP-ENV:Body>
 </SOAP-ENV:Envelope>
 
-POST /XSD_decimal/services/XSD_decimalSOAP HTTP/1.1
-Host: localhost:13260
+POST /axis/ElementFormDefaultTest HTTP/1.1
+Host: 127.0.0.1:13260
 Content-Type: text/xml; charset=UTF-8
 SOAPAction: "null"
 Content-Length: 966
 
+<?xml version='1.0' encoding='utf-8' ?>
 <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <SOAP-ENV:Body>
 <ns1:nestedElementFormDefaultIsUnqualifiedRequest xmlns:ns1="http://tempuri.org/ElementFormDefaultTest/">
@@ -69,8 +70,8 @@
 </SOAP-ENV:Body>
 </SOAP-ENV:Envelope>
 
-POST /XSD_decimal/services/XSD_decimalSOAP HTTP/1.1
-Host: localhost:13260
+POST /axis/ElementFormDefaultTest HTTP/1.1
+Host: 127.0.0.1:13260
 Content-Type: text/xml; charset=UTF-8
 SOAPAction: "null"
 Content-Length: 1062

Modified: webservices/axis/trunk/c/tests/auto_build/testcases/unitTest.list
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/unitTest.list?rev=354107&r1=354106&r2=354107&view=diff
==============================================================================
Binary files - no diff available.

Modified: webservices/axis/trunk/c/tests/auto_build/testcases/wsdls/ElementFormDefaultTest.wsdl
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/wsdls/ElementFormDefaultTest.wsdl?rev=354107&r1=354106&r2=354107&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/wsdls/ElementFormDefaultTest.wsdl (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/wsdls/ElementFormDefaultTest.wsdl Mon Dec  5 09:43:21 2005
@@ -296,7 +296,7 @@
   <wsdl:binding name="ElementFormDefaultTestSOAP" type="tns:ElementFormDefaultTest">
     <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
     <wsdl:operation name="elementFormDefaultIsUnqualified">
-      <soap:operation soapAction="http://tempuri.org/ElementFormDefaultTest/NewOperation"/>
+      <soap:operation style="document"/>
       <wsdl:input>
         <soap:body use="literal"/>
       </wsdl:input>