You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by di...@apache.org on 2005/11/10 18:51:16 UTC

svn commit: r332338 - in /webservices/axis/trunk/c: src/common/ src/soap/ src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/ src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ tests/auto_build/testcases/client/c...

Author: dicka
Date: Thu Nov 10 09:50:51 2005
New Revision: 332338

URL: http://svn.apache.org/viewcvs?rev=332338&view=rev
Log:
Further updates to resolve Jira issue AXISCPP-149. 

This update is the third stage, covering arrays of complex types.

Added:
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ArrayParamHeaderWriter.java
Modified:
    webservices/axis/trunk/c/src/common/ArrayBean.cpp
    webservices/axis/trunk/c/src/soap/SoapDeSerializer.cpp
    webservices/axis/trunk/c/src/soap/SoapSerializer.cpp
    webservices/axis/trunk/c/src/soap/SoapSerializer.h
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/ArrayParamWriter.java
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/AllParamWriter.java
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ArrayParamWriter.java
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubWriter.java
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/AllParamWriter.java
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubWriter.java
    webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ArraysClient.cpp
    webservices/axis/trunk/c/tests/auto_build/testcases/output/Arrays.cpp.out
    webservices/axis/trunk/c/tests/auto_build/testcases/output/Arrays_ServerResponse.expected
    webservices/axis/trunk/c/tests/auto_build/testcases/wsdls/Arrays.wsdl

Modified: webservices/axis/trunk/c/src/common/ArrayBean.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/common/ArrayBean.cpp?rev=332338&r1=332337&r2=332338&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/common/ArrayBean.cpp (original)
+++ webservices/axis/trunk/c/src/common/ArrayBean.cpp Thu Nov 10 09:50:51 2005
@@ -178,7 +178,7 @@
         int itemsize = m_value.cta->pSizeFunct();
 		TRACE_OBJECT_SIZE_FUNCT_EXIT(m_value.cta->pSizeFunct, itemsize);
 
-        char *ptrval = (char *)m_value.cta->pObject;
+        void** ptrval = (void**) m_value.cta->pObject;
         if (DOC_LITERAL == nStyle) 
         {
             // Serialize functions for doc/lit services do not know the instance 
@@ -186,7 +186,7 @@
       
             for (int x=0; x<m_nSize; x++)
             {
-                pItem = ptrval+x*itemsize;
+                pItem = ptrval[x];
 
 				// try to find the prefix - array prefix overrides the
 				// serializer prefix

Modified: webservices/axis/trunk/c/src/soap/SoapDeSerializer.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/soap/SoapDeSerializer.cpp?rev=332338&r1=332337&r2=332338&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/soap/SoapDeSerializer.cpp (original)
+++ webservices/axis/trunk/c/src/soap/SoapDeSerializer.cpp Thu Nov 10 09:50:51 2005
@@ -589,261 +589,276 @@
 				 const AxisChar * pNamespace)
 {
     Axis_Array* Array = new Axis_Array();
+	Array->m_Type = USER_TYPE;
     int nIndex = 0;
     void *pItem;
     int itemsize;
-    char *ptrval;
+    void** ptrval;
 
     if (AXIS_SUCCESS != m_nStatus)
     {
-	return Array;		/* if anything has gone wrong
+	   return Array;		/* 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 Array;
-	}
-
-        if (END_ELEMENT == m_pNode->m_type2)
-	{
-	    return Array;
-	}
-
-	Array->m_Size = getArraySize (m_pNode);
-
-	if (Array->m_Size == 0)
-	{
-		m_pNode = m_pParser->next ();	/* skip end element node too */
-		return Array;
-	}
-	else if (Array->m_Size > 0)
-	{
-		TRACE_OBJECT_CREATE_FUNCT_ENTRY(pCreFunct, Array->m_Array, true, Array->m_Size);
-		Array->m_Array = (void**)
-			((AXIS_OBJECT_CREATE_FUNCT) pCreFunct) (Array->m_Array, true, Array->m_Size);
-		TRACE_OBJECT_CREATE_FUNCT_EXIT(pCreFunct, Array->m_Array);
-
-	    if (!Array->m_Array)
-	    {
-		Array->m_Size = 0;
-		m_nStatus = AXIS_FAIL;
-
-		return Array;
-	    }
-
-		TRACE_OBJECT_SIZE_FUNCT_ENTRY(pSizeFunct);
-	    itemsize = ((AXIS_OBJECT_SIZE_FUNCT) pSizeFunct) ();
-		TRACE_OBJECT_SIZE_FUNCT_EXIT(pSizeFunct, itemsize);
-
-		ptrval = (char *)Array->m_Array;
-
-	    for (; nIndex < Array->m_Size; nIndex++)
-	    {
-		m_pNode = m_pParser->next ();
-		/* wrapper node without type info  Ex: <item> */
-		if (!m_pNode)
-		{
-			TRACE_OBJECT_DELETE_FUNCT_ENTRY(pDelFunct, Array->m_Array, true, Array->m_Size);
-		    ((AXIS_OBJECT_DELETE_FUNCT) pDelFunct) (Array->m_Array, true, Array->m_Size);
-			TRACE_OBJECT_DELETE_FUNCT_EXIT(pDelFunct);
-
-		    Array->m_Array = 0;
-		    Array->m_Size = 0;
-		    return Array;
-		}
-
-		pItem = ptrval + nIndex * itemsize;
-
-		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_DESERIALIZE_FUNCT_ENTRY(pDZFunct, pItem, this);
-		    m_nStatus =	((AXIS_DESERIALIZE_FUNCT) pDZFunct) (pItem, this);
-			TRACE_DESERIALIZE_FUNCT_EXIT(pDZFunct, m_nStatus);
-		}
-
-		m_pNode = m_pParser->next ();	/* skip end element node too */
-
-		if (!m_pNode)
-		{
-			TRACE_OBJECT_DELETE_FUNCT_ENTRY(pDelFunct, Array->m_Array, true, Array->m_Size);
-		    ((AXIS_OBJECT_DELETE_FUNCT) pDelFunct) (Array->m_Array, true, Array->m_Size);
-			TRACE_OBJECT_DELETE_FUNCT_EXIT(pDelFunct);
-
-		    Array->m_Array = 0;
-		    Array->m_Size = 0;
-		    return Array;
-		}
-	    }
-
-	    m_pNode = m_pParser->next ();	/* skip end element node too */
-
-	    return Array;
-	}
+    	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 Array;
+    	}
+    
+            if (END_ELEMENT == m_pNode->m_type2)
+    	{
+    	    return Array;
+    	}
+    
+    	Array->m_Size = getArraySize (m_pNode);
+    
+    	if (Array->m_Size == 0)
+    	{
+    		m_pNode = m_pParser->next ();	/* skip end element node too */
+    		return Array;
+    	}
+    	else if (Array->m_Size > 0)
+    	{
+			Array->m_Array = new void*[Array->m_Size];
+//    		TRACE_OBJECT_CREATE_FUNCT_ENTRY(pCreFunct, Array->m_Array, true, Array->m_Size);
+//    		Array->m_Array = (void**)
+//    			((AXIS_OBJECT_CREATE_FUNCT) pCreFunct) (Array->m_Array, true, Array->m_Size);
+//    		TRACE_OBJECT_CREATE_FUNCT_EXIT(pCreFunct, Array->m_Array);
+    
+    	    if (!Array->m_Array)
+    	    {
+        		Array->m_Size = 0;
+        		m_nStatus = AXIS_FAIL;
+        
+        		return Array;
+    	    }
+    
+//    		TRACE_OBJECT_SIZE_FUNCT_ENTRY(pSizeFunct);
+//    	    itemsize = ((AXIS_OBJECT_SIZE_FUNCT) pSizeFunct) ();
+//    		TRACE_OBJECT_SIZE_FUNCT_EXIT(pSizeFunct, itemsize);
+    
+//    		ptrval = Array->m_Array;
+    
+    	    for (; nIndex < Array->m_Size; 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, Array->m_Array[deleteCount], false, 0);
+        				((AXIS_OBJECT_DELETE_FUNCT) pDelFunct) (Array->m_Array[deleteCount], false, 0);
+        				TRACE_OBJECT_DELETE_FUNCT_EXIT(pDelFunct);
+					}
+					delete [] Array->m_Array;
+        
+        		    Array->m_Array = NULL;
+        		    Array->m_Size = 0;
+        		    return Array;
+        		}
+        
+        		pItem = Array->m_Array[nIndex];
+        
+        		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);
+    				Array->m_Array[nIndex] = ((AXIS_OBJECT_CREATE_FUNCT) pCreFunct) (NULL, false, 0);
+    				TRACE_OBJECT_CREATE_FUNCT_EXIT(pCreFunct, Array->m_Array[nIndex]);
+
+        			TRACE_DESERIALIZE_FUNCT_ENTRY(pDZFunct, Array->m_Array[nIndex], this);
+        		    m_nStatus =	((AXIS_DESERIALIZE_FUNCT) pDZFunct) (Array->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, Array->m_Array[deleteCount], false, 0);
+        				((AXIS_OBJECT_DELETE_FUNCT) pDelFunct) (Array->m_Array[deleteCount], false, 0);
+        				TRACE_OBJECT_DELETE_FUNCT_EXIT(pDelFunct);
+					}
+					delete [] Array->m_Array;
+        
+        		    Array->m_Array = NULL;
+        		    Array->m_Size = 0;
+        		    return Array;
+        		}
+    	    }
+    
+    	    m_pNode = m_pParser->next ();	/* skip end element node too */
+    
+    	    return Array;
+    	}
     }
     else
-    {
-		TRACE_OBJECT_CREATE_FUNCT_ENTRY(pCreFunct, Array->m_Array, true, INITIAL_ARRAY_SIZE);
-	Array->m_Array = (void**) ((AXIS_OBJECT_CREATE_FUNCT) pCreFunct) (Array->m_Array,
-								true,
-								INITIAL_ARRAY_SIZE);
-		TRACE_OBJECT_CREATE_FUNCT_EXIT(pCreFunct, Array->m_Array);
-	if (!Array->m_Array)
-	{
-	    return Array;
-	}
-
-	Array->m_Size = INITIAL_ARRAY_SIZE;
-	TRACE_OBJECT_SIZE_FUNCT_ENTRY(pSizeFunct);
-    itemsize = ((AXIS_OBJECT_SIZE_FUNCT) pSizeFunct) ();
-	TRACE_OBJECT_SIZE_FUNCT_EXIT(pSizeFunct, itemsize);
-
-	while (true)
-	{
-	    ptrval = (char *)Array->m_Array;
-
-	    for (; nIndex < Array->m_Size; nIndex++)
-	    {
-		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)
-		{
-			TRACE_OBJECT_DELETE_FUNCT_ENTRY(pDelFunct, Array->m_Array, true, Array->m_Size);
-		    ((AXIS_OBJECT_DELETE_FUNCT) pDelFunct) (Array->m_Array, true, Array->m_Size);
-			TRACE_OBJECT_DELETE_FUNCT_EXIT(pDelFunct);
-
-		    Array->m_Array = 0;
-		    Array->m_Size = 0;
-		    return Array;
-		}
-
-		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 */
-		    pItem = ptrval + nIndex * itemsize;
-
-		    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_DESERIALIZE_FUNCT_ENTRY(pDZFunct, pItem, this);
-			    m_nStatus =	((AXIS_DESERIALIZE_FUNCT) pDZFunct) (pItem, this);
-				TRACE_DESERIALIZE_FUNCT_EXIT(pDZFunct, m_nStatus);
-		    }
-
-		    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)
+    {   // doc/literal
+        
+        Array->m_Array = new void*[INITIAL_ARRAY_SIZE];
+    	if (!Array->m_Array)
+    	{
+    	    return Array;
+    	}
+    
+    	Array->m_Size = INITIAL_ARRAY_SIZE;
+    
+    	while (true)
+    	{
+    	    ptrval = Array->m_Array;
+    
+    	    for (; nIndex < Array->m_Size; nIndex++)
+    	    {
+        		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 < nIndex ; deleteCount++)
+					{
+        				TRACE_OBJECT_DELETE_FUNCT_ENTRY(pDelFunct, Array->m_Array[deleteCount], false, 0);
+        				((AXIS_OBJECT_DELETE_FUNCT) pDelFunct) (Array->m_Array[deleteCount], false, 0);
+        				TRACE_OBJECT_DELETE_FUNCT_EXIT(pDelFunct);
+					}
+					delete [] Array->m_Array;
+        		    Array->m_Array = NULL;
+        		    Array->m_Size = 0;
+        		    return Array;
+        		}
+        
+        		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 */
+        		    pItem = Array->m_Array[nIndex];
+        
+        		    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);
+						Array->m_Array[nIndex] = ((AXIS_OBJECT_CREATE_FUNCT) pCreFunct) (NULL,
+    							false,
+    							INITIAL_ARRAY_SIZE);
+    					TRACE_OBJECT_CREATE_FUNCT_EXIT(pCreFunct, Array->m_Array[nIndex]);
+
+        				TRACE_DESERIALIZE_FUNCT_ENTRY(pDZFunct, Array->m_Array[nIndex], this);
+        			    m_nStatus =	((AXIS_DESERIALIZE_FUNCT) pDZFunct) (Array->m_Array[nIndex], this);
+        				TRACE_DESERIALIZE_FUNCT_EXIT(pDZFunct, m_nStatus);
+        		    }
+        
+        		    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
+        		{
+        		    if (nIndex > 0)
+        		    {
+            			Array->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 Array;
+        		    }
+        
+        		    /* error : no elements deserialized */
+        		}
+        		/* 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 < nIndex ; deleteCount++)
 				{
-				    m_pNode = NULL;
+        			TRACE_OBJECT_DELETE_FUNCT_ENTRY(pDelFunct, Array->m_Array[deleteCount], false, 0);
+        			((AXIS_OBJECT_DELETE_FUNCT) pDelFunct) (Array->m_Array[deleteCount], false, 0);
+        			TRACE_OBJECT_DELETE_FUNCT_EXIT(pDelFunct);
 				}
-			    }
+				delete [] Array->m_Array;
+        
+        		Array->m_Array = 0;
+        		Array->m_Size = 0;
+        
+        		return Array;
+    	    }
+    	    /* if we come here that means the array allocated is not enough.
+    	     * So double it 
+    	     */
+            void **tmp=Array->m_Array;
+			Array->m_Array = new void*[Array->m_Size*2];
+			if (!Array->m_Array) 
+			{
+				Array->m_Size = 0;
+				return Array;
 			}
-// < FJP
-			continue;
-		    }
-		}
-		else
-		{
-		    if (nIndex > 0)
-		    {
-			Array->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 Array;
-		    }
-
-		    /* error : no elements deserialized */
-		}
-		/* 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>        
-		 */
-		TRACE_OBJECT_DELETE_FUNCT_ENTRY(pDelFunct, Array->m_Array, true, Array->m_Size);
-	    ((AXIS_OBJECT_DELETE_FUNCT) pDelFunct) (Array->m_Array, true, Array->m_Size);
-		TRACE_OBJECT_DELETE_FUNCT_EXIT(pDelFunct);
-
-		Array->m_Array = 0;
-		Array->m_Size = 0;
-
-		return Array;
-	    }
-	    /* if we come here that means the array allocated is not enough.
-	     * So double it 
-	     */
-
-		TRACE_OBJECT_CREATE_FUNCT_ENTRY(pCreFunct, Array->m_Array, true, Array->m_Size*2);
-	    Array->m_Array = (void**)
-		((AXIS_OBJECT_CREATE_FUNCT) pCreFunct) (Array->m_Array, true,
-							Array->m_Size * 2);
-		TRACE_OBJECT_CREATE_FUNCT_EXIT(pCreFunct, Array->m_Array);
-
-	    if (!Array->m_Array)
-	    {
-		Array->m_Size = 0;
-
-		return Array;
-	    }
-
-	    Array->m_Size *= 2;
-	    /* Array.m_RealSize = Array.m_Size; */
-	}
+			memcpy(Array->m_Array,tmp,Array->m_Size*sizeof(void*));
+			delete [] tmp;
+			Array->m_Size *= 2;
+    	}
     }
     m_nStatus = AXIS_FAIL;
     m_pNode = NULL;
@@ -918,19 +933,19 @@
         if (m_pNode && (CHARACTER_ELEMENT == m_pNode->m_type))
         {
             pSimpleType->deserialize(m_pNode->m_pchNameOrValue);
-            ((void**)pArray->m_Array)[nIndex] = pSimpleType->getValue();
+            pArray->m_Array[nIndex] = pSimpleType->getValue();
             m_pNode = m_pParser->next(); /* skip end element node too */
             continue;
         }
         else if (m_pNode && (END_ELEMENT == m_pNode->m_type))
         {
             pSimpleType->deserialize("");
-            ((void**) pArray->m_Array)[nIndex] = pSimpleType->getValue();
+            pArray->m_Array[nIndex] = pSimpleType->getValue();
             continue;
         }
         /* error : unexpected element type or end of stream */
         m_nStatus = AXIS_FAIL;
-        delete [] ((void**)pArray->m_Array);
+        delete [] pArray->m_Array;
         pArray->m_Array = 0;
         pArray->m_Size = 0;
         return;
@@ -958,7 +973,7 @@
             if (!m_pNode)
             {
                 m_nStatus = AXIS_FAIL;
-                delete [] ((void**)pArray->m_Array);
+                delete [] pArray->m_Array;
                 pArray->m_Array = 0;
                 pArray->m_Size = 0;
                 return;
@@ -982,7 +997,7 @@
                 if (m_pNode && (CHARACTER_ELEMENT == m_pNode->m_type))
                 {
                     pSimpleType->deserialize(m_pNode->m_pchNameOrValue);
-                    ((void**) pArray->m_Array)[nIndex] =  pSimpleType->getValue();
+                    pArray->m_Array[nIndex] =  pSimpleType->getValue();
                     m_pNode = m_pParser->next();
                     /* skip end element node too */
                     m_pNode = NULL;
@@ -992,14 +1007,14 @@
                 }
                 else if (m_pNode && (END_ELEMENT == m_pNode->m_type) && bNillFound)
                 {
-                    ((void**) pArray->m_Array)[nIndex] = NULL;
+                    pArray->m_Array[nIndex] = NULL;
                     m_pNode = NULL;
                     continue;
                 }
                 else if (m_pNode && (END_ELEMENT == m_pNode->m_type))
                 {
                     pSimpleType->deserialize("");
-                    ((void**) pArray->m_Array)[nIndex] = pSimpleType->getValue();
+                    pArray->m_Array[nIndex] = pSimpleType->getValue();
                     m_pNode = NULL;
                     continue;
                 }
@@ -1021,14 +1036,14 @@
             /* if we come here it is an error situation */
             m_nStatus = AXIS_FAIL;
             m_pNode = NULL;
-            delete [] ((void**)pArray->m_Array);
+            delete [] pArray->m_Array;
             pArray->m_Array = 0;
             pArray->m_Size = 0;
             return;
         }
         /* if we come here that means the array allocated is */
         /* not enough. So double it */
-        void *tmp=pArray->m_Array;
+        void** tmp = pArray->m_Array;
         pArray->m_Array = new void*[pArray->m_Size*2];
         if (!pArray->m_Array) 
         {
@@ -1036,7 +1051,7 @@
             return;
         }
         memcpy(pArray->m_Array,tmp,pArray->m_Size*sizeof(void*));
-        delete [] (void**)tmp;
+        delete [] tmp;
         pArray->m_Size *= 2;
     }
 }

Modified: webservices/axis/trunk/c/src/soap/SoapSerializer.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/soap/SoapSerializer.cpp?rev=332338&r1=332337&r2=332338&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/soap/SoapSerializer.cpp (original)
+++ webservices/axis/trunk/c/src/soap/SoapSerializer.cpp Thu Nov 10 09:50:51 2005
@@ -152,7 +152,7 @@
 {
 	int	iSuccess = AXIS_SUCCESS;
 
-    ArrayBean * pAb = makeArrayBean( nType, (void*) (pArray->m_Array));
+    ArrayBean * pAb = makeArrayBean( nType, (void**) (pArray->m_Array));
 
     pAb->SetDimension(pArray->m_Size);
 
@@ -190,7 +190,7 @@
 {
 	int	iSuccess = AXIS_SUCCESS;
 
-    ArrayBean* pAb = makeArrayBean( (void*)(pArray->m_Array), pSZFunct,
+    ArrayBean* pAb = makeArrayBean( pArray->m_Array, pSZFunct,
 									 pDelFunct,
 									 pSizeFunct);
 
@@ -569,7 +569,7 @@
  * Used to create an ArrayBean when the return type of a method is an array
  * of basic types
  */
-ArrayBean * SoapSerializer::makeArrayBean( XSDTYPE nType, void * pArray)
+ArrayBean * SoapSerializer::makeArrayBean( XSDTYPE nType, void ** pArray)
 {
     ArrayBean* pAb = new ArrayBean();
 
@@ -583,7 +583,7 @@
  * Used to create an ArrayBean when the return type of a method is an array
  * of complex types
  */
-ArrayBean * SoapSerializer::makeArrayBean(void * pObject,
+ArrayBean * SoapSerializer::makeArrayBean(void ** pObject,
 										   void * pSZFunct, 
                                            void * pDelFunct,
 										   void * pSizeFunct)
@@ -657,7 +657,7 @@
                                          const AxisChar * pName, 
                                          const AxisChar * pNamespace)
 {
-    ArrayBean * pAb = (ArrayBean*) makeArrayBean( (void*) (pArray->m_Array), 
+    ArrayBean * pAb = (ArrayBean*) makeArrayBean( pArray->m_Array, 
 											      pSZFunct,
 												  pDelFunct,
 												  pSizeFunct);
@@ -734,7 +734,7 @@
 										const AxisChar* pNamespace, 
                                         XSDTYPE nType, const AxisChar* pName)
 {
-	ArrayBean * pAb = (ArrayBean *) makeArrayBean( nType, (void *) (pArray->m_Array));
+	ArrayBean * pAb = (ArrayBean *) makeArrayBean( nType, pArray->m_Array);
 
     pAb->SetDimension( pArray->m_Size);
 

Modified: webservices/axis/trunk/c/src/soap/SoapSerializer.h
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/soap/SoapSerializer.h?rev=332338&r1=332337&r2=332338&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/soap/SoapSerializer.h (original)
+++ webservices/axis/trunk/c/src/soap/SoapSerializer.h Thu Nov 10 09:50:51 2005
@@ -160,8 +160,8 @@
     void setCurrentProviderType(PROVIDERTYPE nType) { m_ProviderType = nType;};
 
 private:
-    ArrayBean* makeArrayBean(XSDTYPE nType, void* pArray);
-    ArrayBean* makeArrayBean(void* pObject, void* pSZFunct, void* pDelFunct, 
+    ArrayBean* makeArrayBean(XSDTYPE nType, void** pArray);
+    ArrayBean* makeArrayBean(void** pObject, void* pSZFunct, void* pDelFunct, 
         void* pSizeFunct);
     int setSoapHeader(SoapHeader* pSoapHeader);
 

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/ArrayParamWriter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/ArrayParamWriter.java?rev=332338&r1=332337&r2=332338&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/ArrayParamWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/ArrayParamWriter.java Thu Nov 10 09:50:51 2005
@@ -44,7 +44,7 @@
     }
 
     /* (non-Javadoc)
-     * @see org.apache.axis.wsdl.wsdl2ws.c.ArrayParamWriter#writeArrayStruct()
+     * @see org.apache.axis.wsdl.wsdl2ws.c.ArrayParamHeaderWriter#writeArrayStruct()
      */
     protected void writeArrayStruct() throws WrapperFault
     {

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/AllParamWriter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/AllParamWriter.java?rev=332338&r1=332337&r2=332338&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/AllParamWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/AllParamWriter.java Thu Nov 10 09:50:51 2005
@@ -72,11 +72,12 @@
                                     + "\n"
                                     + "It seems that some thing wrong with symbolTable population - Susantha");
                         }
-                        ArrayParamWriter writer =
-                            (new ArrayParamWriter(wscontext, type));
+                        ArrayParamHeaderWriter writer =
+                            (new ArrayParamHeaderWriter(wscontext, type));
                         if (!writer.isSimpleTypeArray())
                         {
                             writer.writeSource();
+                            (new ArrayParamWriter(wscontext, type)).writeSource();
                         }
                     }
                     else

Added: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ArrayParamHeaderWriter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ArrayParamHeaderWriter.java?rev=332338&view=auto
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ArrayParamHeaderWriter.java (added)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ArrayParamHeaderWriter.java Thu Nov 10 09:50:51 2005
@@ -0,0 +1,208 @@
+/*
+ *   Copyright 2003-2004 The Apache Software Foundation.
+// (c) Copyright IBM Corp. 2004, 2005 All Rights Reserved
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ */
+
+/**
+ * @author Srinath Perera(hemapani@openource.lk)
+ * @author Susantha Kumara(susantha@opensource.lk, skumara@virtusa.com)
+ * @author Samisa Abeysinghe (sabeysinghe@virtusa.com)
+ */
+
+package org.apache.axis.wsdl.wsdl2ws.cpp;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.Iterator;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axis.wsdl.wsdl2ws.CUtils;
+import org.apache.axis.wsdl.wsdl2ws.ParamWriter;
+import org.apache.axis.wsdl.wsdl2ws.WSDL2Ws;
+import org.apache.axis.wsdl.wsdl2ws.WrapperFault;
+import org.apache.axis.wsdl.wsdl2ws.WrapperUtils;
+import org.apache.axis.wsdl.wsdl2ws.info.Type;
+import org.apache.axis.wsdl.wsdl2ws.info.WebServiceContext;
+
+public class ArrayParamHeaderWriter extends ParamWriter
+{
+    public ArrayParamHeaderWriter(WebServiceContext wscontext, Type type)
+        throws WrapperFault
+    {
+        super(wscontext, type);
+    }
+
+    public void writeSource() throws WrapperFault
+    {
+        try
+        {
+            this.writer =
+                new BufferedWriter(new FileWriter(getFilePath(), false));
+            writeClassComment();
+            // if this headerfile not defined define it 
+            this.writer.write(
+                "#if !defined(__"
+                    + classname.toUpperCase()
+                    + "_"
+                    + getFileType().toUpperCase()
+                    + "_H__INCLUDED_)\n");
+            this.writer.write(
+                "#define __"
+                    + classname.toUpperCase()
+                    + "_"
+                    + getFileType().toUpperCase()
+                    + "_H__INCLUDED_\n\n");
+            if (attribs.length != 1)
+            {
+                System.out.println(
+                    "Array "
+                        + classname
+                        + " contains unexpected no of variables");
+                throw new WrapperFault(
+                    "Array type "
+                        + classname
+                        + " contain unexpected no of types");
+            }
+            //include header file for the contained type
+            QName qname = WrapperUtils.getArrayType(type).getName();
+
+            if (!CUtils.isSimpleType(qname))
+            {
+                writer.write("#include \""+ attribs[0].getTypeName() + ".hpp\"\n");
+            }
+            writer.write("#include <axis/AxisUserAPI.hpp>\n\n");
+
+            writeArrayClassDefinition();
+            this.writer.write(
+                "#endif /* !defined(__"
+                    + classname.toUpperCase()
+                    + "_"
+                    + getFileType().toUpperCase()
+                    + "_H__INCLUDED_)*/\n");
+            writer.flush();
+            writer.close();
+            if (WSDL2Ws.verbose)
+            {
+                System.out.println(
+                    getFilePath().getAbsolutePath() + " created.....");
+            }
+        }
+        catch (IOException e)
+        {
+            e.printStackTrace();
+            throw new WrapperFault(e);
+        }
+    }
+
+    public boolean isSimpleTypeArray() throws WrapperFault
+    {
+        QName qname = WrapperUtils.getArrayType(type).getName();
+        return CUtils.isSimpleType(qname);
+    }
+
+    protected File getFilePath() throws WrapperFault
+    {
+        return this.getFilePath(false);
+    }
+
+    protected File getFilePath(boolean useServiceName) throws WrapperFault
+    {
+        String targetOutputLocation =
+            this.wscontext.getWrapInfo().getTargetOutputLocation();
+        if (targetOutputLocation.endsWith("/"))
+        {
+            targetOutputLocation =
+                targetOutputLocation.substring(
+                    0,
+                    targetOutputLocation.length() - 1);
+        }
+        new File(targetOutputLocation).mkdirs();
+
+        String fileName =
+            targetOutputLocation + "/" + classname + CUtils.CPP_HEADER_SUFFIX;
+
+        if (useServiceName)
+        {
+            fileName =
+                targetOutputLocation
+                    + "/"
+                    + this.wscontext.getSerInfo().getServicename()
+                    + "_"
+                    + classname
+                    + CUtils.CPP_HEADER_SUFFIX;
+        }
+
+        return new File(fileName);
+    }
+
+    protected void writeArrayClassDefinition() throws WrapperFault
+    {
+        try
+        {
+        	Iterator	itForTypes = wscontext.getTypemap().getTypes().iterator();
+        	boolean		nillable = false;
+        	
+        	while( itForTypes.hasNext())
+        	{
+        		Type aType = (Type) itForTypes.next();
+        		
+        		if( aType.getLanguageSpecificName().indexOf( ">") > -1)
+        		{
+					Iterator	itForElemName = aType.getElementnames();
+					
+        			while( itForElemName.hasNext() && !nillable)
+        			{
+        				String key = (String) itForElemName.next();
+        				
+        				if( aType.getElementForElementName( key).getNillable())
+        				{
+							nillable = true;
+        				}
+        			}
+        		}
+        	}
+        	
+        	writer.write("class " + classname + " : public Axis_Array\n");
+        	writer.write("{\n");
+        	writer.write("\tpublic:\n");
+        	writer.write("\t\t" + classname +"();\n");
+        	writer.write("\t\t" + classname + "(" + classname + " & original);\n");
+        	writer.write("\t\tvoid set(" + attribs[0].getTypeName() + "** array, const int size);\n");
+        	writer.write("\t\tconst "+ attribs[0].getTypeName() + "** get(int & size) const;\n");
+            writer.write("};\n\n");
+        }
+        catch (IOException e)
+        {
+            throw new WrapperFault(e);
+        }
+    }
+
+    protected void writeConstructors() throws WrapperFault
+    {}
+
+    protected void writeDestructors() throws WrapperFault
+    {}
+
+    protected void writeMethods() throws WrapperFault
+    {}
+
+    protected String getFileType()
+    {
+        return "Array";
+    }
+}

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ArrayParamWriter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ArrayParamWriter.java?rev=332338&r1=332337&r2=332338&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ArrayParamWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ArrayParamWriter.java Thu Nov 10 09:50:51 2005
@@ -14,39 +14,38 @@
  *   See the License for the specific language governing permissions and
  *   limitations under the License.
  */
-
-/**
- * @author Srinath Perera(hemapani@openource.lk)
- * @author Susantha Kumara(susantha@opensource.lk, skumara@virtusa.com)
- * @author Samisa Abeysinghe (sabeysinghe@virtusa.com)
- */
-
 package org.apache.axis.wsdl.wsdl2ws.cpp;
 
 import java.io.BufferedWriter;
 import java.io.File;
 import java.io.FileWriter;
 import java.io.IOException;
-import java.util.Iterator;
-
-import javax.xml.namespace.QName;
 
 import org.apache.axis.wsdl.wsdl2ws.CUtils;
 import org.apache.axis.wsdl.wsdl2ws.ParamWriter;
 import org.apache.axis.wsdl.wsdl2ws.WSDL2Ws;
 import org.apache.axis.wsdl.wsdl2ws.WrapperFault;
-import org.apache.axis.wsdl.wsdl2ws.WrapperUtils;
 import org.apache.axis.wsdl.wsdl2ws.info.Type;
 import org.apache.axis.wsdl.wsdl2ws.info.WebServiceContext;
 
+/**
+ * @author dicka.new
+ *
+ * TODO To change the template for this generated type comment go to
+ * Window - Preferences - Java - Code Style - Code Templates
+ */
 public class ArrayParamWriter extends ParamWriter
 {
+    
+
     public ArrayParamWriter(WebServiceContext wscontext, Type type)
-        throws WrapperFault
+            throws WrapperFault
     {
         super(wscontext, type);
     }
-
+    /* (non-Javadoc)
+     * @see org.apache.axis.wsdl.wsdl2ws.SourceWriter#writeSource()
+     */
     public void writeSource() throws WrapperFault
     {
         try
@@ -54,49 +53,9 @@
             this.writer =
                 new BufferedWriter(new FileWriter(getFilePath(), false));
             writeClassComment();
-            // if this headerfile not defined define it 
-            this.writer.write(
-                "#if !defined(__"
-                    + classname.toUpperCase()
-                    + "_"
-                    + getFileType().toUpperCase()
-                    + "_H__INCLUDED_)\n");
-            this.writer.write(
-                "#define __"
-                    + classname.toUpperCase()
-                    + "_"
-                    + getFileType().toUpperCase()
-                    + "_H__INCLUDED_\n\n");
-            if (attribs.length != 1)
-            {
-                System.out.println(
-                    "Array "
-                        + classname
-                        + " contains unexpected no of variables");
-                throw new WrapperFault(
-                    "Array type "
-                        + classname
-                        + " contain unexpected no of types");
-            }
-            //include header file for the contained type
-            QName qname = WrapperUtils.getArrayType(type).getName();
-
-            if (!CUtils.isSimpleType(qname))
-            {
-                /* This is a must for complex schemas (includes cycle)*/
-                writer.write("class " + attribs[0].getTypeName() + ";\n\n");
-            }
-            else
-            {
-                writer.write("#include <axis/AxisUserAPI.hpp>\n\n");
-            }
-            writeArrayStruct();
-            this.writer.write(
-                "#endif /* !defined(__"
-                    + classname.toUpperCase()
-                    + "_"
-                    + getFileType().toUpperCase()
-                    + "_H__INCLUDED_)*/\n");
+            
+            writer.write("#include \"" + classname + ".hpp\"\n\n");
+            this.writeMethods();
             writer.flush();
             writer.close();
             if (WSDL2Ws.verbose)
@@ -112,17 +71,64 @@
         }
     }
 
-    public boolean isSimpleTypeArray() throws WrapperFault
+    /* (non-Javadoc)
+     * @see org.apache.axis.wsdl.wsdl2ws.BasicFileWriter#writeMethods()
+     */
+    protected void writeMethods() throws WrapperFault
     {
-        QName qname = WrapperUtils.getArrayType(type).getName();
-        return CUtils.isSimpleType(qname);
+        this.writeConstructors();
+        
+        try
+        {
+            writer.write("void " + classname + "::" + "set(" + attribs[0].getTypeName() + "** array, const int size)\n");
+            writer.write("{\n");
+            writer.write("\tAxis_Array::set((void**)array, size, USER_TYPE);\n");
+            writer.write("}\n\n");
+            writer.write("const " + attribs[0].getTypeName() + "** " + classname + "::" + "get(int & size) const\n");
+            writer.write("{\n");
+            writer.write("\tXSDTYPE type;\n");
+            writer.write("\treturn (const " + attribs[0].getTypeName() + "**) Axis_Array::get(size, type);\n");
+            writer.write("}\n\n");
+        }
+        catch (IOException e)
+        {
+            throw new WrapperFault(e);
+        }
+
     }
 
+    
+    
+    protected void writeConstructors() throws WrapperFault
+    {
+        try
+        {
+            writer.write(classname + "::" + classname + "()\n");
+            writer.write("{\n");
+            writer.write("\tm_Type = USER_TYPE;\n");
+            writer.write("}\n\n");
+            writer.write(classname + "::" + classname + "(" + classname + " & original)\n");
+            writer.write("{\n");
+            writer.write("\tclone(original);\n");
+            writer.write("}\n\n");
+        }
+        catch (IOException e)
+        {
+            throw new WrapperFault(e);
+        }
+        
+    }
+    /* (non-Javadoc)
+     * @see org.apache.axis.wsdl.wsdl2ws.BasicFileWriter#getFilePath()
+     */
     protected File getFilePath() throws WrapperFault
     {
         return this.getFilePath(false);
     }
 
+    /* (non-Javadoc)
+     * @see org.apache.axis.wsdl.wsdl2ws.BasicFileWriter#getFilePath(boolean)
+     */
     protected File getFilePath(boolean useServiceName) throws WrapperFault
     {
         String targetOutputLocation =
@@ -137,7 +143,7 @@
         new File(targetOutputLocation).mkdirs();
 
         String fileName =
-            targetOutputLocation + "/" + classname + CUtils.CPP_HEADER_SUFFIX;
+            targetOutputLocation + "/" + classname + CUtils.CPP_CLASS_SUFFIX;
 
         if (useServiceName)
         {
@@ -153,66 +159,4 @@
         return new File(fileName);
     }
 
-    protected void writeArrayStruct() throws WrapperFault
-    {
-        try
-        {
-        	Iterator	itForTypes = wscontext.getTypemap().getTypes().iterator();
-        	boolean		nillable = false;
-        	
-        	while( itForTypes.hasNext())
-        	{
-        		Type aType = (Type) itForTypes.next();
-        		
-        		if( aType.getLanguageSpecificName().indexOf( ">") > -1)
-        		{
-					Iterator	itForElemName = aType.getElementnames();
-					
-        			while( itForElemName.hasNext() && !nillable)
-        			{
-        				String key = (String) itForElemName.next();
-        				
-        				if( aType.getElementForElementName( key).getNillable())
-        				{
-							nillable = true;
-        				}
-        			}
-        		}
-        	}
-        	
-            writer.write("typedef struct " + classname + "Tag\n{\n");
-            
-            String stars = "*";
-            
-            if( nillable)
-            {
-            	stars = "**";
-            }
-            
-            writer.write(
-                "\t"
-                    + attribs[0].getTypeName()
-                    + stars + " m_Array;\n\tint m_Size;\n\tXSDTYPE m_Type;\n} "
-                    + classname
-                    + ";\n\n");
-        }
-        catch (IOException e)
-        {
-            throw new WrapperFault(e);
-        }
-    }
-
-    protected void writeConstructors() throws WrapperFault
-    {}
-
-    protected void writeDestructors() throws WrapperFault
-    {}
-
-    protected void writeMethods() throws WrapperFault
-    {}
-
-    protected String getFileType()
-    {
-        return "Array";
-    }
 }

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubWriter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubWriter.java?rev=332338&r1=332337&r2=332338&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubWriter.java Thu Nov 10 09:50:51 2005
@@ -437,8 +437,8 @@
                 {
                     containedType = qname.getLocalPart();
                     writer.write("\tm_pCall->addCmplxArrayParameter(");
-                    writer.write("(Axis_Array*)(&Value" + i
-                            + "), (void*)Axis_Serialize_" + containedType
+                    writer.write("Value" + i
+                            + ", (void*)Axis_Serialize_" + containedType
                             + ", (void*)Axis_Delete_" + containedType
                             + ", (void*) Axis_GetSize_" + containedType
                             + ", \""

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/AllParamWriter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/AllParamWriter.java?rev=332338&r1=332337&r2=332338&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/AllParamWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/AllParamWriter.java Thu Nov 10 09:50:51 2005
@@ -35,6 +35,7 @@
 import org.apache.axis.wsdl.wsdl2ws.SourceWriter;
 import org.apache.axis.wsdl.wsdl2ws.WSDL2Ws;
 import org.apache.axis.wsdl.wsdl2ws.WrapperFault;
+import org.apache.axis.wsdl.wsdl2ws.cpp.ArrayParamHeaderWriter;
 import org.apache.axis.wsdl.wsdl2ws.cpp.ArrayParamWriter;
 import org.apache.axis.wsdl.wsdl2ws.info.Type;
 import org.apache.axis.wsdl.wsdl2ws.info.WebServiceContext;
@@ -94,11 +95,12 @@
                                     + "\n"
                                     + "It seems that some thing wrong with symbolTable population - Susantha");
                         }
-                        ArrayParamWriter writer =
-                            (new ArrayParamWriter(wscontext, type));
+                        ArrayParamHeaderWriter writer =
+                            (new ArrayParamHeaderWriter(wscontext, type));
                         if (!writer.isSimpleTypeArray())
                         {
                             writer.writeSource();
+                            (new ArrayParamWriter(wscontext, type)).writeSource();
                         }
                         else
                         {

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubWriter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubWriter.java?rev=332338&r1=332337&r2=332338&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 Thu Nov 10 09:50:51 2005
@@ -653,8 +653,8 @@
 				writer.
 				    write
 				    ("\tm_pCall->addCmplxArrayParameter(");
-				writer.write ("(Axis_Array*)(&Value" + i +
-					      "), (void*)Axis_Serialize_" +
+				writer.write ("Value" + i +
+					      ", (void*)Axis_Serialize_" +
 					      containedType +
 					      ", (void*)Axis_Delete_" +
 					      containedType +

Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ArraysClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ArraysClient.cpp?rev=332338&r1=332337&r2=332338&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ArraysClient.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ArraysClient.cpp Thu Nov 10 09:50:51 2005
@@ -27,6 +27,7 @@
 void testAxis_ArrayWithNillElements();
 void testAxis_ArrayCopying();
 void testComplexTypeWithSimpleArray();
+void testArrayOfComplexType();
 
 int main(int argc, char* argv[])
 {
@@ -46,6 +47,7 @@
     testAxis_ArrayWithNillElements();
     testAxis_ArrayCopying();
 	testComplexTypeWithSimpleArray();
+	testArrayOfComplexType();
 
     bool bSuccess = false;
     int iRetryIterationCount = 3;
@@ -123,6 +125,40 @@
 			delete inputComplexType;
 			delete outputComplexType;
 
+			ComplexTypeWithSimpleElement_Array complexArray;
+			int inputSize = 3;
+			ComplexTypeWithSimpleElement** complexInputArray = new ComplexTypeWithSimpleElement*[inputSize];
+			for (count = 0 ; count < inputSize ; count++)
+			{
+				complexInputArray[count] = new ComplexTypeWithSimpleElement();
+				complexInputArray[count]->setsimpleType(count);
+			}
+			complexArray.set(complexInputArray, inputSize);
+
+			ComplexTypeWithSimpleElement_Array * complexOutputAxis_Array = ws.complexTypeArray(&complexArray);
+
+			outputSize = 0;
+			const ComplexTypeWithSimpleElement** complexOutputArray = complexOutputAxis_Array->get(outputSize);
+			cout << "Complex array size is " << outputSize << endl;
+			if (complexOutputArray != NULL)
+			{
+				for (count = 0 ; count < outputSize ; count++)
+				{
+					if (complexOutputArray[count] != NULL)
+					{
+						cout << ((ComplexTypeWithSimpleElement) *complexOutputArray[count]).getsimpleType() << endl;
+					}
+					else
+					{
+						cout << "NULL" << endl;
+					}
+				}
+			}
+			else
+			{
+				cout << "NULL array" << endl;
+			}
+
             bSuccess = 1;
         }
         catch(AxisException& e)
@@ -379,7 +415,7 @@
 	xsd__int_Array * outputArray = complexType.getsimpleType();
 	int outputSize = 0;
 	const xsd__int** output = outputArray->get(outputSize);
-    cout << "Size is " << outputSize << endl;
+	cout << "Size is " << outputSize << endl;
 	if (output != NULL)
 	{
 		for (count = 0 ; count < outputSize ; count++ )
@@ -401,5 +437,41 @@
 	}
 
 
+}
+
+void testArrayOfComplexType()
+{
+	ComplexTypeWithSimpleElement_Array array;
+	int count = 0;
+	int inputSize = 3;
+	ComplexTypeWithSimpleElement** inputArray = new ComplexTypeWithSimpleElement*[inputSize];
+	for (count = 0 ; count < inputSize ; count++)
+	{
+		inputArray[count] = new ComplexTypeWithSimpleElement();
+		inputArray[count]->setsimpleType(count);
+	}
+	array.set(inputArray, inputSize);
+
+	int outputSize = 0;
+	const ComplexTypeWithSimpleElement** outputArray = array.get(outputSize);
+	cout << "Size is " << outputSize << endl;
+	if (outputArray != NULL)
+	{
+		for (count = 0 ; count < outputSize ; count++)
+		{
+			if (outputArray[count] != NULL)
+			{
+				cout << ((ComplexTypeWithSimpleElement) *outputArray[count]).getsimpleType() << endl;
+			}
+			else
+			{
+				cout << "NULL" << endl;
+			}
+		}
+	}
+	else
+	{
+		cout << "NULL array" << endl;
+	}
 }
 

Modified: webservices/axis/trunk/c/tests/auto_build/testcases/output/Arrays.cpp.out
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/output/Arrays.cpp.out?rev=332338&r1=332337&r2=332338&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/output/Arrays.cpp.out (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/output/Arrays.cpp.out Thu Nov 10 09:50:51 2005
@@ -22,11 +22,19 @@
 0
 1
 2
+Size is 3
+0
+1
+2
 Array size = 3
 0
 1
 2
 Array size = 3
+0
+1
+2
+Complex array size is 3
 0
 1
 2

Modified: webservices/axis/trunk/c/tests/auto_build/testcases/output/Arrays_ServerResponse.expected
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/output/Arrays_ServerResponse.expected?rev=332338&r1=332337&r2=332338&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/output/Arrays_ServerResponse.expected (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/output/Arrays_ServerResponse.expected Thu Nov 10 09:50:51 2005
@@ -20,3 +20,14 @@
 <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Header/><soapenv:Body><complexTypeWithSimpleArrayResponse xmlns="http://org.apache.axis/Arrays/"><ComplexTypeWithSimpleArray><simpleType>0</simpleType><simpleType>1</simpleType><simpleType>2</simpleType></ComplexTypeWithSimpleArray></complexTypeWithSimpleArrayResponse></soapenv:Body></soapenv:Envelope>
 0
 
+HTTP/1.1 200 OK
+Server: WebSphere Application Server/5.1
+Content-Type: text/xml; charset=utf-8
+Content-Language: en-GB
+Transfer-Encoding: chunked
+
+###
+<?xml version="1.0" encoding="utf-8"?>
+<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Header/><soapenv:Body><complexTypeArrayResponse xmlns="http://org.apache.axis/Arrays/"><complexTypeWithSimpleElement><simpleType>0</simpleType></complexTypeWithSimpleElement><complexTypeWithSimpleElement><simpleType>1</simpleType></complexTypeWithSimpleElement><complexTypeWithSimpleElement><simpleType>2</simpleType></complexTypeWithSimpleElement></complexTypeArrayResponse></soapenv:Body></soapenv:Envelope>
+0
+

Modified: webservices/axis/trunk/c/tests/auto_build/testcases/wsdls/Arrays.wsdl
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/wsdls/Arrays.wsdl?rev=332338&r1=332337&r2=332338&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/wsdls/Arrays.wsdl (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/wsdls/Arrays.wsdl Thu Nov 10 09:50:51 2005
@@ -30,6 +30,12 @@
 				</xsd:sequence>
 			</xsd:complexType>
 
+			<xsd:complexType name="ComplexTypeWithSimpleElement">
+				<xsd:sequence>
+					<xsd:element name="simpleType" type="xsd:int"/>
+				</xsd:sequence>
+			</xsd:complexType>
+
             <xsd:element name="complexTypeWithSimpleArrayResponse">
 				<xsd:complexType>
 					<xsd:sequence>
@@ -48,6 +54,24 @@
             		</xsd:sequence>
             	</xsd:complexType>
             </xsd:element>
+            <xsd:element name="complexTypeArrayResponse">
+            	<xsd:complexType>
+            		<xsd:sequence>
+            			<xsd:element name="complexTypeWithSimpleElement"
+            				type="tns:ComplexTypeWithSimpleElement" maxOccurs="unbounded">
+            			</xsd:element>
+            		</xsd:sequence>
+            	</xsd:complexType>
+            </xsd:element>
+            <xsd:element name="complexTypeArrayRequest">
+            	<xsd:complexType>
+            		<xsd:sequence>
+            			<xsd:element name="complexTypeWithSimpleElement"
+            				type="tns:ComplexTypeWithSimpleElement" maxOccurs="unbounded">
+            			</xsd:element>
+            		</xsd:sequence>
+            	</xsd:complexType>
+            </xsd:element>
 		</xsd:schema>
 	</wsdl:types>
 	<wsdl:message name="simpleArrayResponse">
@@ -68,6 +92,16 @@
 			element="tns:complexTypeWithSimpleArrayRequest">
 		</wsdl:part>
 	</wsdl:message>
+	<wsdl:message name="complexTypeArrayResponse">
+		<wsdl:part name="complexTypeArrayResponse"
+			element="tns:complexTypeArrayResponse">
+		</wsdl:part>
+	</wsdl:message>
+	<wsdl:message name="complexTypeArrayRequest">
+		<wsdl:part name="complexTypeArrayRequest"
+			element="tns:complexTypeArrayRequest">
+		</wsdl:part>
+	</wsdl:message>
 	<wsdl:portType name="Arrays">
 		<wsdl:operation name="simpleArray">
 			<wsdl:input message="tns:simpleArrayRequest" />
@@ -81,6 +115,10 @@
 				message="tns:complexTypeWithSimpleArrayResponse">
 			</wsdl:output>
 		</wsdl:operation>
+		<wsdl:operation name="complexTypeArray">
+			<wsdl:input message="tns:complexTypeArrayRequest"></wsdl:input>
+			<wsdl:output message="tns:complexTypeArrayResponse"></wsdl:output>
+		</wsdl:operation>
 	</wsdl:portType>
 	<wsdl:binding name="ArraysSOAP" type="tns:Arrays">
 		<soap:binding style="document"
@@ -96,6 +134,10 @@
 			</wsdl:output>
 		</wsdl:operation>
 		<wsdl:operation name="complexTypeWithSimpleArray">
+			<wsdl:input></wsdl:input>
+			<wsdl:output></wsdl:output>
+		</wsdl:operation>
+		<wsdl:operation name="complexTypeArray">
 			<wsdl:input></wsdl:input>
 			<wsdl:output></wsdl:output>
 		</wsdl:operation>