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/17 17:49:58 UTC
svn commit: r345282 - in /webservices/axis/trunk/c: include/axis/
include/axis/client/ src/cbindings/ src/cbindings/client/ src/common/
src/engine/client/ src/soap/ src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/
src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/li...
Author: dicka
Date: Thu Nov 17 08:49:24 2005
New Revision: 345282
URL: http://svn.apache.org/viewcvs?rev=345282&view=rev
Log:
Further updates to resolve Jira issue AXISCPP-149.
Updates to improve arrays of complex types.
Modified:
webservices/axis/trunk/c/include/axis/AxisUserAPI.hpp
webservices/axis/trunk/c/include/axis/IWrapperSoapDeSerializer.hpp
webservices/axis/trunk/c/include/axis/client/Call.hpp
webservices/axis/trunk/c/src/cbindings/IWrapperSoapDeSerializerC.cpp
webservices/axis/trunk/c/src/cbindings/client/CallC.cpp
webservices/axis/trunk/c/src/common/AxisUserAPI.cpp
webservices/axis/trunk/c/src/engine/client/Call.cpp
webservices/axis/trunk/c/src/soap/SoapDeSerializer.cpp
webservices/axis/trunk/c/src/soap/SoapDeSerializer.h
webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ArrayParamHeaderWriter.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/literal/BeanParamWriter.java
webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubWriter.java
webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ParmHeaderFileWriter.java
webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ArraysClient.cpp
webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/AxisBenchClient.cpp
webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ComplexListsClient.cpp
webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ManyTypeRefRootClient.cpp
webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/NestedComplexClient.cpp
webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/RecurseTypesClient.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/include/axis/AxisUserAPI.hpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/include/axis/AxisUserAPI.hpp?rev=345282&r1=345281&r2=345282&view=diff
==============================================================================
--- webservices/axis/trunk/c/include/axis/AxisUserAPI.hpp (original)
+++ webservices/axis/trunk/c/include/axis/AxisUserAPI.hpp Thu Nov 17 08:49:24 2005
@@ -355,12 +355,19 @@
* @param type, this will be updated with the type of the data returned.
* @return c-style array of pointers to the array data.
*/
- const void** get(int& size, XSDTYPE& type) const;
+ void** get(int& size, XSDTYPE& type) const;
/**
* Clear the array, and it's data
*/
void clear();
+
+ /**
+ * Add an additional element to the array.
+ * @param element to be added to the array. This will be appended to the
+ * end of the existing array.
+ */
+ void addElement(void* element);
friend class SoapDeSerializer;
friend class SoapSerializer;
Modified: webservices/axis/trunk/c/include/axis/IWrapperSoapDeSerializer.hpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/include/axis/IWrapperSoapDeSerializer.hpp?rev=345282&r1=345281&r2=345282&view=diff
==============================================================================
--- webservices/axis/trunk/c/include/axis/IWrapperSoapDeSerializer.hpp (original)
+++ webservices/axis/trunk/c/include/axis/IWrapperSoapDeSerializer.hpp Thu Nov 17 08:49:24 2005
@@ -43,7 +43,7 @@
virtual void* AXISCALL checkForFault(const AxisChar* pName,
const AxisChar* pNamespace)=0;
/* Method used by wrappers to get a deserialized Array of complex types */
- virtual Axis_Array* AXISCALL getCmplxArray(void* pDZFunct, void* pCreFunct,
+ virtual Axis_Array* AXISCALL getCmplxArray(Axis_Array * pArray, void* pDZFunct, void* pCreFunct,
void* pDelFunct, void* pSizeFunct, const AxisChar* pName,
const AxisChar* pNamespace)=0;
/* Method used by wrappers to get a deserialized Array of basic types */
Modified: webservices/axis/trunk/c/include/axis/client/Call.hpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/include/axis/client/Call.hpp?rev=345282&r1=345281&r2=345282&view=diff
==============================================================================
--- webservices/axis/trunk/c/include/axis/client/Call.hpp (original)
+++ webservices/axis/trunk/c/include/axis/client/Call.hpp Thu Nov 17 08:49:24 2005
@@ -337,7 +337,7 @@
void* AXISCALL getCmplxObject(void* pDZFunct, void* pCreFunct,
void* pDelFunct, const AxisChar* pName, const AxisChar* pNamespace);
/* Method used by stubs to get a deserialized Array of complex types */
- Axis_Array* AXISCALL getCmplxArray(void* pDZFunct, void* pCreFunct,
+ Axis_Array* AXISCALL getCmplxArray(Axis_Array * pArray, void* pDZFunct, void* pCreFunct,
void* pDelFunct, void* pSizeFunct, const AxisChar* pName,
const AxisChar* pNamespace);
/* Method used by stubs to get a deserialized Array of basic types */
Modified: webservices/axis/trunk/c/src/cbindings/IWrapperSoapDeSerializerC.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/cbindings/IWrapperSoapDeSerializerC.cpp?rev=345282&r1=345281&r2=345282&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/cbindings/IWrapperSoapDeSerializerC.cpp (original)
+++ webservices/axis/trunk/c/src/cbindings/IWrapperSoapDeSerializerC.cpp Thu Nov 17 08:49:24 2005
@@ -43,7 +43,7 @@
return dz->checkForFault(pName,pNamespace);
}
-AXISC_STORAGE_CLASS_INFO Axisc_Array* axiscGetCmplxArrayIWrapperSoapDeSerializer(AXISCHANDLE wrapperSoapDeSerializer, void * pDZFunct,
+AXISC_STORAGE_CLASS_INFO Axisc_Array* axiscGetCmplxArrayIWrapperSoapDeSerializer(AXISCHANDLE wrapperSoapDeSerializer, Axisc_Array * pArray, void * pDZFunct,
void * pCreFunct, void * pDelFunct, void * pSizeFunct,
const AxiscChar * pName, const AxiscChar * pNamespace) {
IWrapperSoapDeSerializer *dz = (IWrapperSoapDeSerializer*)wrapperSoapDeSerializer;
Modified: webservices/axis/trunk/c/src/cbindings/client/CallC.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/cbindings/client/CallC.cpp?rev=345282&r1=345281&r2=345282&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/cbindings/client/CallC.cpp (original)
+++ webservices/axis/trunk/c/src/cbindings/client/CallC.cpp Thu Nov 17 08:49:24 2005
@@ -412,7 +412,7 @@
return c->getCmplxObject(pDZFunct,pCreFunct,pDelFunct,pName,pNamespace);
}
-AXISC_STORAGE_CLASS_INFO Axisc_Array* axiscGetCmplxArrayCall(AXISCHANDLE call, void * pDZFunct,
+AXISC_STORAGE_CLASS_INFO Axisc_Array* axiscGetCmplxArrayCall(AXISCHANDLE call, Axisc_Array* pArray, void * pDZFunct,
void * pCreFunct, void * pDelFunct, void * pSizeFunct,
const AxiscChar * pName, const AxiscChar * pNamespace) {
//TODO: Unimplemented
Modified: webservices/axis/trunk/c/src/common/AxisUserAPI.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/common/AxisUserAPI.cpp?rev=345282&r1=345281&r2=345282&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/common/AxisUserAPI.cpp (original)
+++ webservices/axis/trunk/c/src/common/AxisUserAPI.cpp Thu Nov 17 08:49:24 2005
@@ -400,13 +400,327 @@
}
}
-const void** Axis_Array::get(int& size, XSDTYPE& type) const
+void** Axis_Array::get(int& size, XSDTYPE& type) const
{
size = m_Size;
type = m_Type;
- return (const void**) m_Array;
+ return m_Array;
}
+
+void Axis_Array::addElement(void* element)
+{
+ void** temp = new void*[m_Size+1];
+ for (int count = 0 ; count < m_Size ; count++ )
+ {
+ temp[count] = m_Array[count];
+ }
+ if (m_Array != NULL)
+ {
+ delete [] m_Array;
+ }
+ m_Array = temp;
+ m_belongsToAxisEngine = true;
+
+ if ( element == NULL)
+ {
+ m_Array[m_Size] = NULL;
+ }
+ else
+ {
+ switch (m_Type)
+ {
+ case XSD_DURATION:
+ {
+ ((xsd__duration**) m_Array)[m_Size] = new xsd__duration();
+ *((xsd__duration**)m_Array)[m_Size] = *(xsd__duration*) element;
+ break;
+ }
+ case XSD_DATETIME:
+ {
+ ((xsd__dateTime**) m_Array)[m_Size] = new xsd__dateTime();
+ *((xsd__dateTime**)m_Array)[m_Size] = *(xsd__dateTime*) element;
+ break;
+ }
+ case XSD_TIME:
+ {
+ ((xsd__time**) m_Array)[m_Size] = new xsd__time();
+ *((xsd__time**)m_Array)[m_Size] = *(xsd__time*) element;
+ break;
+ }
+ case XSD_DATE:
+ {
+ ((xsd__date**) m_Array)[m_Size] = new xsd__date();
+ *((xsd__date**)m_Array)[m_Size] = *(xsd__date*) element;
+ break;
+ }
+ case XSD_GYEARMONTH:
+ {
+ ((xsd__gYearMonth**) m_Array)[m_Size] = new xsd__gYearMonth();
+ *((xsd__gYearMonth**)m_Array)[m_Size] = *(xsd__gYearMonth*) element;
+ break;
+ }
+ case XSD_GYEAR:
+ {
+ ((xsd__gYear**) m_Array)[m_Size] = new xsd__gYear();
+ *((xsd__gYear**)m_Array)[m_Size] = *(xsd__gYear*) element;
+ break;
+ }
+ case XSD_GMONTHDAY:
+ {
+ ((xsd__gMonthDay**) m_Array)[m_Size] = new xsd__gMonthDay();
+ *((xsd__gMonthDay**)m_Array)[m_Size] = *(xsd__gMonthDay*) element;
+ break;
+ }
+ case XSD_GDAY:
+ {
+ ((xsd__gDay**) m_Array)[m_Size] = new xsd__gDay();
+ *((xsd__gDay**)m_Array)[m_Size] = *(xsd__gDay*) element;
+ break;
+ }
+ case XSD_GMONTH:
+ {
+ ((xsd__gMonth**) m_Array)[m_Size] = new xsd__gMonth();
+ *((xsd__gMonth**)m_Array)[m_Size] = *(xsd__gMonth*) element;
+ break;
+ }
+ case XSD_STRING:
+ {
+ ((xsd__string*) m_Array)[m_Size] = new char[strlen((xsd__string) element)+1];
+ strcpy(((xsd__string*) m_Array)[m_Size], (xsd__string) element);
+ break;
+ }
+ case XSD_NORMALIZEDSTRING:
+ {
+ ((xsd__normalizedString*) m_Array)[m_Size] = new char[strlen((xsd__normalizedString) element)+1];
+ strcpy(((xsd__normalizedString*) m_Array)[m_Size], (xsd__normalizedString) element);
+ break;
+ }
+ case XSD_TOKEN:
+ {
+ ((xsd__token*) m_Array)[m_Size] = new char[strlen((xsd__token) element)+1];
+ strcpy(((xsd__token*) m_Array)[m_Size], (xsd__token) element);
+ break;
+ }
+ case XSD_LANGUAGE:
+ {
+ ((xsd__language*) m_Array)[m_Size] = new char[strlen((xsd__language) element)+1];
+ strcpy(((xsd__language*) m_Array)[m_Size], (xsd__language) element);
+ break;
+ }
+ case XSD_NAME:
+ {
+ ((xsd__Name*) m_Array)[m_Size] = new char[strlen((xsd__Name) element)+1];
+ strcpy(((xsd__Name*) m_Array)[m_Size], (xsd__Name) element);
+ break;
+ }
+ case XSD_NCNAME:
+ {
+ ((xsd__NCName*) m_Array)[m_Size] = new char[strlen((xsd__NCName) element)+1];
+ strcpy(((xsd__NCName*) m_Array)[m_Size], (xsd__NCName) element);
+ break;
+ }
+ case XSD_ID:
+ {
+ ((xsd__ID*) m_Array)[m_Size] = new char[strlen((xsd__ID) element)+1];
+ strcpy(((xsd__ID*) m_Array)[m_Size], (xsd__ID) element);
+ break;
+ }
+ case XSD_IDREF:
+ {
+ ((xsd__IDREF*) m_Array)[m_Size] = new char[strlen((xsd__IDREF) element)+1];
+ strcpy(((xsd__IDREF*) m_Array)[m_Size], (xsd__IDREF) element);
+ break;
+ }
+ case XSD_IDREFS:
+ {
+ ((xsd__IDREFS*) m_Array)[m_Size] = new char[strlen((xsd__IDREFS) element)+1];
+ strcpy(((xsd__IDREFS*) m_Array)[m_Size], (xsd__IDREFS) element);
+ break;
+ }
+ case XSD_ENTITY:
+ {
+ ((xsd__ENTITY*) m_Array)[m_Size] = new char[strlen((xsd__ENTITY) element)+1];
+ strcpy(((xsd__ENTITY*) m_Array)[m_Size], (xsd__ENTITY) element);
+ break;
+ }
+ case XSD_ENTITIES:
+ {
+ ((xsd__ENTITIES*) m_Array)[m_Size] = new char[strlen((xsd__ENTITIES) element)+1];
+ strcpy(((xsd__ENTITIES*) m_Array)[m_Size], (xsd__ENTITIES) element);
+ break;
+ }
+ case XSD_NMTOKEN:
+ {
+ ((xsd__NMTOKEN*) m_Array)[m_Size] = new char[strlen((xsd__NMTOKEN) element)+1];
+ strcpy(((xsd__NMTOKEN*) m_Array)[m_Size], (xsd__NMTOKEN) element);
+ break;
+ }
+ case XSD_NMTOKENS:
+ {
+ ((xsd__NMTOKENS*) m_Array)[m_Size] = new char[strlen((xsd__NMTOKENS) element)+1];
+ strcpy(((xsd__NMTOKENS*) m_Array)[m_Size], (xsd__NMTOKENS) element);
+ break;
+ }
+ case XSD_BOOLEAN:
+ {
+ ((xsd__boolean**) m_Array)[m_Size] = new xsd__boolean();
+ *((xsd__boolean**)m_Array)[m_Size] = *(xsd__boolean*) element;
+ break;
+ }
+ case XSD_BASE64BINARY:
+ {
+ xsd__base64Binary* pCloneTemp = new xsd__base64Binary();
+ xsd__base64Binary* pOriginalTemp = (xsd__base64Binary*) element;
+
+ pCloneTemp->__size = pOriginalTemp->__size;
+ pCloneTemp->__ptr = new unsigned char[pCloneTemp->__size];
+ memcpy( pCloneTemp->__ptr, pOriginalTemp->__ptr, pCloneTemp->__size);
+ ((xsd__base64Binary**) m_Array)[m_Size] = pCloneTemp;
+ break;
+ }
+ case XSD_HEXBINARY:
+ {
+ xsd__hexBinary* pCloneTemp = new xsd__hexBinary();
+ xsd__hexBinary* pOriginalTemp = (xsd__hexBinary*) element;
+
+ pCloneTemp->__size = pOriginalTemp->__size;
+ pCloneTemp->__ptr = new unsigned char[pCloneTemp->__size];
+ memcpy( pCloneTemp->__ptr, pOriginalTemp->__ptr, pCloneTemp->__size);
+ ((xsd__hexBinary**) m_Array)[m_Size] = pCloneTemp;
+ break;
+ }
+ case XSD_FLOAT:
+ {
+ ((xsd__float**) m_Array)[m_Size] = new xsd__float();
+ *((xsd__float**)m_Array)[m_Size] = *(xsd__float*) element;
+ break;
+ }
+ case XSD_DECIMAL:
+ {
+ ((xsd__decimal**) m_Array)[m_Size] = new xsd__decimal();
+ *((xsd__decimal**)m_Array)[m_Size] = *(xsd__decimal*) element;
+ break;
+ }
+ case XSD_INTEGER:
+ {
+ ((xsd__integer**) m_Array)[m_Size] = new xsd__integer();
+ *((xsd__integer**)m_Array)[m_Size] = *(xsd__integer*) element;
+ break;
+ }
+ case XSD_NONPOSITIVEINTEGER:
+ {
+ ((xsd__nonPositiveInteger**) m_Array)[m_Size] = new xsd__nonPositiveInteger();
+ *((xsd__nonPositiveInteger**)m_Array)[m_Size] = *(xsd__nonPositiveInteger*) element;
+ break;
+ }
+ case XSD_NEGATIVEINTEGER:
+ {
+ ((xsd__negativeInteger**) m_Array)[m_Size] = new xsd__negativeInteger();
+ *((xsd__negativeInteger**)m_Array)[m_Size] = *(xsd__negativeInteger*) element;
+ break;
+ }
+ case XSD_LONG:
+ {
+ ((xsd__long**) m_Array)[m_Size] = new xsd__long();
+ *((xsd__long**)m_Array)[m_Size] = *(xsd__long*) element;
+ break;
+ }
+ case XSD_INT:
+ {
+ ((xsd__int**) m_Array)[m_Size] = new xsd__int();
+ *((xsd__int**)m_Array)[m_Size] = *(xsd__int*) element;
+ break;
+ }
+ case XSD_SHORT:
+ {
+ ((xsd__short**) m_Array)[m_Size] = new xsd__short();
+ *((xsd__short**)m_Array)[m_Size] = *(xsd__short*) element;
+ break;
+ }
+ case XSD_BYTE:
+ {
+ ((xsd__byte**) m_Array)[m_Size] = new xsd__byte();
+ *((xsd__byte**)m_Array)[m_Size] = *(xsd__byte*) element;
+ break;
+ }
+ case XSD_NONNEGATIVEINTEGER:
+ {
+ ((xsd__nonNegativeInteger**) m_Array)[m_Size] = new xsd__nonNegativeInteger();
+ *((xsd__nonNegativeInteger**)m_Array)[m_Size] = *(xsd__nonNegativeInteger*) element;
+ break;
+ }
+ case XSD_UNSIGNEDLONG:
+ {
+ ((xsd__unsignedLong**) m_Array)[m_Size] = new xsd__unsignedLong();
+ *((xsd__unsignedLong**)m_Array)[m_Size] = *(xsd__unsignedLong*) element;
+ break;
+ }
+ case XSD_UNSIGNEDINT:
+ {
+ ((xsd__unsignedInt**) m_Array)[m_Size] = new xsd__unsignedInt();
+ *((xsd__unsignedInt**)m_Array)[m_Size] = *(xsd__unsignedInt*) element;
+ break;
+ }
+ case XSD_UNSIGNEDSHORT:
+ {
+ ((xsd__unsignedShort**) m_Array)[m_Size] = new xsd__unsignedShort();
+ *((xsd__unsignedShort**)m_Array)[m_Size] = *(xsd__unsignedShort*) element;
+ break;
+ }
+ case XSD_UNSIGNEDBYTE:
+ {
+ ((xsd__unsignedByte**) m_Array)[m_Size] = new xsd__unsignedByte();
+ *((xsd__unsignedByte**)m_Array)[m_Size] = *(xsd__unsignedByte*) element;
+ break;
+ }
+ case XSD_POSITIVEINTEGER:
+ {
+ ((xsd__positiveInteger**) m_Array)[m_Size] = new xsd__positiveInteger();
+ *((xsd__positiveInteger**)m_Array)[m_Size] = *(xsd__positiveInteger*) element;
+ break;
+ }
+ case XSD_DOUBLE:
+ {
+ ((xsd__double**) m_Array)[m_Size] = new xsd__double();
+ *((xsd__double**)m_Array)[m_Size] = *(xsd__double*) element;
+ break;
+ }
+ case XSD_ANYURI:
+ {
+ ((xsd__anyURI*) m_Array)[m_Size] = new char[strlen((xsd__anyURI) element)+1];
+ strcpy(((xsd__anyURI*) m_Array)[m_Size], (xsd__anyURI) element);
+ break;
+ }
+ case XSD_QNAME:
+ {
+ ((xsd__QName*) m_Array)[m_Size] = new char[strlen((xsd__QName) element)+1];
+ strcpy(((xsd__QName*) m_Array)[m_Size], (xsd__QName) element);
+ break;
+ }
+ case XSD_NOTATION:
+ {
+ ((xsd__NOTATION*) m_Array)[m_Size] = new char[strlen((xsd__NOTATION) element)+1];
+ strcpy(((xsd__NOTATION*) m_Array)[m_Size], (xsd__NOTATION) element);
+ break;
+ }
+ case XSD_ARRAY:
+ {
+ ((Axis_Array**) m_Array)[m_Size] = new Axis_Array(*(Axis_Array*) element);
+ }
+ case USER_TYPE:
+ {
+ m_Array[m_Size] = element;
+ }
+ case XSD_UNKNOWN:
+ case XSD_ANY:
+ case ATTACHMENT:
+ default:
+ break;
+ }
+ }
+ m_Size++;
+}
Axis_Array::~Axis_Array()
{
Modified: webservices/axis/trunk/c/src/engine/client/Call.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/engine/client/Call.cpp?rev=345282&r1=345281&r2=345282&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/engine/client/Call.cpp (original)
+++ webservices/axis/trunk/c/src/engine/client/Call.cpp Thu Nov 17 08:49:24 2005
@@ -409,11 +409,11 @@
return m_pIWSDZ->getBasicArray (nType, pName, pNamespace);
}
-Axis_Array* Call::getCmplxArray (void* pDZFunct, void* pCreFunct,
+Axis_Array* Call::getCmplxArray (Axis_Array * pArray, void* pDZFunct, void* pCreFunct,
void* pDelFunct, void* pSizeFunct, const AxisChar* pName,
const AxisChar* pNamespace)
{
- return m_pIWSDZ->getCmplxArray (pDZFunct, pCreFunct, pDelFunct, pSizeFunct,
+ return m_pIWSDZ->getCmplxArray (pArray, pDZFunct, pCreFunct, pDelFunct, pSizeFunct,
pName, pNamespace);
}
Modified: webservices/axis/trunk/c/src/soap/SoapDeSerializer.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/soap/SoapDeSerializer.cpp?rev=345282&r1=345281&r2=345282&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/soap/SoapDeSerializer.cpp (original)
+++ webservices/axis/trunk/c/src/soap/SoapDeSerializer.cpp Thu Nov 17 08:49:24 2005
@@ -583,13 +583,10 @@
*
*/
Axis_Array*
-SoapDeSerializer::getCmplxArray (void *pDZFunct, void *pCreFunct,
- void *pDelFunct, void *pSizeFunct,
- const AxisChar * pName,
- const AxisChar * pNamespace)
+SoapDeSerializer::getCmplxArray ( Axis_Array* pArray, void *pDZFunct,
+ void *pCreFunct, void *pDelFunct, void *pSizeFunct,
+ const AxisChar * pName, const AxisChar * pNamespace)
{
- Axis_Array* Array = new Axis_Array();
- Array->m_Type = USER_TYPE;
int nIndex = 0;
void *pItem;
int itemsize;
@@ -597,7 +594,7 @@
if (AXIS_SUCCESS != m_nStatus)
{
- return Array; /* if anything has gone wrong
+ return pArray; /* if anything has gone wrong
* earlier just do nothing */
}
@@ -609,44 +606,24 @@
*/
if (!m_pNode)
{
- return Array;
+ return pArray;
}
if (END_ELEMENT == m_pNode->m_type2)
{
- return Array;
+ return pArray;
}
- Array->m_Size = getArraySize (m_pNode);
+ int arraySize = getArraySize (m_pNode);
- if (Array->m_Size == 0)
+ if (arraySize == 0)
{
m_pNode = m_pParser->next (); /* skip end element node too */
- return Array;
+ return pArray;
}
- else if (Array->m_Size > 0)
+ else if (arraySize > 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++)
+ for (; nIndex < arraySize; nIndex++)
{
m_pNode = m_pParser->next ();
/* wrapper node without type info Ex: <item> */
@@ -654,19 +631,17 @@
{
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_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 [] Array->m_Array;
+ delete [] pArray->m_Array;
- Array->m_Array = NULL;
- Array->m_Size = 0;
- return Array;
+ pArray->m_Array = NULL;
+ pArray->m_Size = 0;
+ return pArray;
}
- pItem = Array->m_Array[nIndex];
-
if (C_RPC_PROVIDER == getCurrentProviderType ())
{
// Disable C support
@@ -678,11 +653,11 @@
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]);
+ 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, Array->m_Array[nIndex], this);
- m_nStatus = ((AXIS_DESERIALIZE_FUNCT) pDZFunct) (Array->m_Array[nIndex], this);
+ 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);
}
@@ -692,178 +667,141 @@
{
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_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 [] Array->m_Array;
+ delete [] pArray->m_Array;
- Array->m_Array = NULL;
- Array->m_Size = 0;
- return Array;
+ pArray->m_Array = NULL;
+ pArray->m_Size = 0;
+ return pArray;
}
}
m_pNode = m_pParser->next (); /* skip end element node too */
- return Array;
+ return pArray;
}
}
else
{ // 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++)
+ while (true)
+ {
+ 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, Array->m_Array[deleteCount], false, 0);
- ((AXIS_OBJECT_DELETE_FUNCT) pDelFunct) (Array->m_Array[deleteCount], false, 0);
- TRACE_OBJECT_DELETE_FUNCT_EXIT(pDelFunct);
+ 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 [] 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)
+ 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++)
{
- Array->m_Size = 0;
- return Array;
+ 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);
}
- memcpy(Array->m_Array,tmp,Array->m_Size*sizeof(void*));
- delete [] tmp;
- Array->m_Size *= 2;
+ delete [] pArray->m_Array;
+
+ pArray->m_Array = 0;
+ pArray->m_Size = 0;
+
+ return pArray;
}
}
m_nStatus = AXIS_FAIL;
m_pNode = NULL;
- return Array;
+ return pArray;
}
/*
Modified: webservices/axis/trunk/c/src/soap/SoapDeSerializer.h
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/soap/SoapDeSerializer.h?rev=345282&r1=345281&r2=345282&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/soap/SoapDeSerializer.h (original)
+++ webservices/axis/trunk/c/src/soap/SoapDeSerializer.h Thu Nov 17 08:49:24 2005
@@ -112,8 +112,10 @@
int setInputStream(SOAPTransport* pInputStream);
SoapDeSerializer();
virtual ~SoapDeSerializer();
- /* Method used by wrappers to get a deserialized Array of complex types */
- Axis_Array* AXISCALL getCmplxArray(void* pDZFunct, void* pCreFunct,
+ /* Method used by wrappers to get a deserialized Array of complex types
+ * Note: returned Axis_Array object is the same object as passed in to this
+ * method. */
+ Axis_Array* AXISCALL getCmplxArray(Axis_Array* pArray, void* pDZFunct, void* pCreFunct,
void* pDelFunct, void* pSizeFunct, const AxisChar* pName,
const AxisChar* pNamespace);
/* Method used by wrappers to get a deserialized Array of basic types */
Modified: 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=345282&r1=345281&r2=345282&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ArrayParamHeaderWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ArrayParamHeaderWriter.java Thu Nov 17 08:49:24 2005
@@ -221,7 +221,7 @@
try
{
writer.write("\t\tvoid set( class " + attribs[0].getTypeName() + "** array, const int size);\n");
- writer.write("\t\tconst class "+ attribs[0].getTypeName() + "** get(int & size) const;\n");
+ writer.write("\t\tclass "+ attribs[0].getTypeName() + "** get(int & size) const;\n");
writer.write("\t\tvoid clone(" + classname + " & original);\n");
writer.write("\t\tvoid clear();\n");
}
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=345282&r1=345281&r2=345282&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 17 08:49:24 2005
@@ -155,10 +155,10 @@
{
try
{
- writer.write("const " + attribs[0].getTypeName() + "** " + classname + "::" + "get(int & size) const\n");
+ writer.write(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("\treturn (" + attribs[0].getTypeName() + "**) Axis_Array::get(size, type);\n");
writer.write("}\n\n");
}
catch (IOException e)
Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/BeanParamWriter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/BeanParamWriter.java?rev=345282&r1=345281&r2=345282&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/BeanParamWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/BeanParamWriter.java Thu Nov 17 08:49:24 2005
@@ -483,61 +483,37 @@
}
else
{
- Iterator itForTypes = wscontext.getTypemap().getTypes().iterator();
- boolean nillable = isNillable();
- boolean moreThanOne = isMoreThanOne();
-
arrayType = attribs[i].getTypeName();
- writer.write("\t// Additional code to find is reference is pointer or pointer to a pointer\n");
-
- if (nillable)
+ if (isNillable())
{
- String typeName = attribs[i].getTypeName();
- String countName = "iCount" + i;
-
- writer.write( "\tint\t\t\t\tiSize = 0;\n");
- writer.write( "\tconst " + typeName + " ** pp" + typeName + " = param->" + attribs[i].getParamName() + "->get( (int&) iSize);\n\n");
-
- writer.write("\tfor( int " + countName + " = 0; " + countName + " < iSize; " + countName + "++)\n");
-
+ writer.write("\tif(param->" + attribs[i].getParamNameAsMember() + " == NULL)\n");
writer.write("\t{\n");
-
- writer.write("\t\tif( pp" + typeName + "[" + countName + "] == NULL)\n");
-
- writer.write("\t\t{\n");
- writer.write("\t\t\tpSZ->serializeAsAttribute( \"<"
+ writer.write("\t\tpSZ->serializeAsAttribute( \"<"
+ attribs[i].getParamName()
+ " xsi:nil\", 0, (void*)&(xsd_boolean_true), XSD_BOOLEAN);\n");
- writer.write("\t\t\tpSZ->serialize( \"/>\", NULL);\n");
- writer.write("\t\t}\n");
- writer.write("\t\telse\n");
- writer.write("\t\t{\n");
-
- writer.write("\t\t\tpSZ->serializeCmplxArray( (Axis_Array *) &pp" + typeName + "[" + countName + "],\n");
- writer.write("\t\t\t\t\t\t\t\t\t (void*) Axis_Serialize_"+ arrayType + ",\n");
- writer.write("\t\t\t\t\t\t\t\t\t (void*) Axis_Delete_"+ arrayType + ",\n");
- writer.write("\t\t\t\t\t\t\t\t\t (void*) Axis_GetSize_"+ arrayType + ",\n");
- writer.write("\t\t\t\t\t\t\t\t\t \""+ attribs[i].getParamName() + "\", Axis_URI_" + arrayType + ");\n");
- writer.write("\t\t}\n");
+ writer.write("\t\tpSZ->serialize( \"/>\", NULL);\n");
writer.write("\t}\n");
+ writer.write("\telse\n\t");
}
else
{
- writer.write("\tpSZ->serializeCmplxArray(param->"
- + attribs[i].getParamNameAsMember()
- + ",\n");
- writer.write("\t\t\t\t\t\t (void*) Axis_Serialize_"
- + arrayType + ",\n");
- writer.write("\t\t\t\t\t\t (void*) Axis_Delete_"
- + arrayType + ",\n");
- writer.write("\t\t\t\t\t\t (void*) Axis_GetSize_"
- + arrayType + ",\n");
- writer.write("\t\t\t\t\t\t \""
- + attribs[i].getParamName() + "\", Axis_URI_"
- + arrayType + ");\n");
+ if (attribs[i].isOptional())
+ {
+ writer.write("\tif(param->" + attribs[i].getParamNameAsMember() + " != NULL)\n\t");
+ }
}
-
- writer.write("\t// End\n");
+ writer.write("\tpSZ->serializeCmplxArray(param->"
+ + attribs[i].getParamNameAsMember()
+ + ",\n");
+ writer.write("\t\t\t\t\t\t (void*) Axis_Serialize_"
+ + arrayType + ",\n");
+ writer.write("\t\t\t\t\t\t (void*) Axis_Delete_"
+ + arrayType + ",\n");
+ writer.write("\t\t\t\t\t\t (void*) Axis_GetSize_"
+ + arrayType + ",\n");
+ writer.write("\t\t\t\t\t\t \""
+ + attribs[i].getParamName() + "\", Axis_URI_"
+ + arrayType + ");\n");
}
}
else if (attribs[i].isSimpleType())
@@ -688,7 +664,14 @@
{
if (attribs[i].isArray())
{
- writer.write("\tAxis_Array * array;\n\n");
+ if (attribs[i].isSimpleType())
+ {
+ writer.write("\tAxis_Array * array;\n\n");
+ }
+ else
+ {
+ writer.write("\t" + attribs[i].getTypeName() + "_Array * array = new " + attribs[i].getTypeName() + "_Array();\n\n");
+ }
break;
}
}
@@ -780,7 +763,7 @@
boolean moreThanOne = isMoreThanOne();
arrayType = attribs[i].getTypeName();
- writer.write("\tarray = pIWSDZ->getCmplxArray((void*)Axis_DeSerialize_"
+ writer.write("\tarray = (" + arrayType + "_Array *) pIWSDZ->getCmplxArray(array, (void*)Axis_DeSerialize_"
+ arrayType
+ ",\n"
+ "\t\t\t\t\t\t\t\t (void*)Axis_Create_"
@@ -796,15 +779,7 @@
+ attribs[i].getElementNameAsString()
+ "\", Axis_URI_" + arrayType + ");\n\n");
- String typeName = attribs[i].getParamNameAsMember();
- String typeNamePointer = "p" + attribs[i].getElementNameAsString();
- String typeNameArray = arrayType + "_Array";
-
- writer.write("\t" + typeNameArray + " * " + typeNamePointer + " = new " + typeNameArray + "();\n");
- writer.write("\t" + typeNamePointer + "->clone(*(" + typeNameArray + " *) array);\n\n");
- writer.write("\t((" + typeNameArray + "*) array)->clear();\n\n");
- writer.write("\tparam->set" + typeName + "( " + typeNamePointer + ");\n\n");
- writer.write("\tAxis::AxisDelete((void *) array, XSD_ARRAY);\n\n");
+ writer.write("\tparam->" + attribs[i].getParamNameAsMember() + " = array;\n\n");
}
}
else if (attribs[i].isSimpleType())
@@ -1045,6 +1020,7 @@
{
try
{
+ // Write default constructor
writer.write("\n" + classname + "::" + classname + "()\n{\n");
for (int i = 0 ; i < attribs.length ; i++)
{
@@ -1056,12 +1032,34 @@
writer.write("\treset();\n");
writer.write("}\n");
+ //write copy constructor
+ writer.write("\n" + classname + "::" + classname + "(" + classname + " & original)\n{\n");
+ for (int i = 0 ; i < attribs.length ; i++)
+ {
+ if (attribs[i].isSimpleType() && CUtils.isPointerType(attribs[i].getTypeName()))
+ {
+ writer.write("\tif(original." + attribs[i].getParamName() + " != NULL)\n");
+ writer.write("\t{\n");
+ writer.write("\t\t" + attribs[i].getParamName() + " = new char[strlen(original." + attribs[i].getParamName() + ") + 1];\n");
+ writer.write("\t\tstrcpy(" + attribs[i].getParamName() + ", original." + attribs[i].getParamName() + ");\n");
+ writer.write("\t}\n");
+ writer.write("\telse\n");
+ writer.write("\t{\n");
+ writer.write("\t\t" + attribs[i].getParamName() + " = NULL;\n");
+ writer.write("\t}\n");
+ }
+ else
+ {
+ writer.write("\t" + attribs[i].getParamName() + " = original." + attribs[i].getParamName() + ";\n");
+ }
+ }
+ writer.write("}\n");
writeReset();
}
catch (IOException e)
{
throw new WrapperFault(e);
- }
+ }
}
/*
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=345282&r1=345281&r2=345282&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 17 08:49:24 2005
@@ -934,11 +934,12 @@
+ CUtils.getXSDTypeForBasicType (containedType)
+ ", \"" + returntype.getParamName () + "\", 0);\n");
writer.write ("\t\t\tRetArray->clone(*RetAxisArray);\n");
+ writer.write ("\t\t\tAxis::AxisDelete( (void *)RetAxisArray, XSD_ARRAY);\n");
}
else
{
containedType = qname.getLocalPart ();
- writer.write("\t\t\tAxis_Array * RetAxisArray = m_pCall->getCmplxArray((void*) Axis_DeSerialize_"
+ writer.write("\t\t\tRetArray = (" + containedType + "_Array *) m_pCall->getCmplxArray(RetArray, (void*) Axis_DeSerialize_"
+ containedType
+ ", (void*) Axis_Create_"
+ containedType
@@ -951,11 +952,7 @@
+ "\", Axis_URI_"
+ containedType
+ ");\n");
- writer.write("\t\t\tRetArray->clone(*(" + containedType + "_Array *)RetAxisArray);\n");
- writer.write("\t\t\t((" + containedType + "_Array *)RetAxisArray)->clear();\n");
-
}
- writer.write ("\t\t\tAxis::AxisDelete( (void *)RetAxisArray, XSD_ARRAY);\n");
writer.write ("\t\t}\n");
writer.write ("\t}\n");
writer.write ("\tm_pCall->unInitialize();\n");
Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ParmHeaderFileWriter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ParmHeaderFileWriter.java?rev=345282&r1=345281&r2=345282&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ParmHeaderFileWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ParmHeaderFileWriter.java Thu Nov 17 08:49:24 2005
@@ -453,6 +453,7 @@
try
{
writer.write("\n\t" + classname + "();\n");
+ writer.write("\t" + classname + "(" + classname + " & original);\n");
writeReset();
} catch (IOException e)
{
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=345282&r1=345281&r2=345282&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 17 08:49:24 2005
@@ -150,7 +150,7 @@
ComplexTypeWithSimpleElement_Array * complexOutputAxis_Array = ws.complexTypeArray(&complexArray);
outputSize = 0;
- const ComplexTypeWithSimpleElement** complexOutputArray = complexOutputAxis_Array->get(outputSize);
+ ComplexTypeWithSimpleElement** complexOutputArray = complexOutputAxis_Array->get(outputSize);
cout << "Complex array size is " << outputSize << endl;
if (complexOutputArray != NULL)
{
@@ -187,7 +187,7 @@
{
if (complexOutputArray[count] != NULL)
{
- cout << ((ComplexTypeWithSimpleElement) *complexOutputArray[count]).getsimpleType() << endl;
+ cout << complexOutputArray[count]->getsimpleType() << endl;
}
else
{
@@ -208,6 +208,48 @@
}
delete [] complexInputArray;
+ MoreComplexType_Array moreComplexTypeArray;
+ MoreComplexType** arrayOfMoreComplexType = new MoreComplexType*[inputSize];
+ for (count = 0 ; count < inputSize ; count++ )
+ {
+ xsd__string temp = new char[strlen("Hello World!") + 1];
+ strcpy(temp, "Hello World!");
+ arrayOfMoreComplexType[count] = new MoreComplexType();
+ arrayOfMoreComplexType[count]->setsimpleString(temp);
+ }
+ moreComplexTypeArray.set(arrayOfMoreComplexType, inputSize);
+ MoreComplexType_Array * outputMoreComplexTypeArray = ws.moreComplexTypeArray(&moreComplexTypeArray);
+ outputSize = 0;
+ MoreComplexType** outputArrayOfMoreComplexType = outputMoreComplexTypeArray->get(outputSize);
+ cout <<"Complex array size is " << outputSize << endl;
+ if (outputArrayOfMoreComplexType != NULL)
+ {
+ for (count = 0 ; count < outputSize ; count++)
+ {
+ if (outputArrayOfMoreComplexType[count] != NULL)
+ {
+ cout << outputArrayOfMoreComplexType[count]->getsimpleString() << endl;
+ }
+ else
+ {
+ cout << "NULL" << endl;
+ }
+ }
+ }
+ else
+ {
+ cout << "NULL" << endl;
+ }
+
+ //Clean up more complex input array
+ for (count = 0 ; count < inputSize ; count++)
+ {
+ delete arrayOfMoreComplexType[count];
+ }
+ delete [] arrayOfMoreComplexType;
+ delete outputMoreComplexTypeArray;
+
+
bSuccess = 1;
}
catch(AxisException& e)
@@ -514,7 +556,7 @@
array.set(inputArray, inputSize);
int outputSize = 0;
- const ComplexTypeWithSimpleElement** outputArray = array.get(outputSize);
+ ComplexTypeWithSimpleElement** outputArray = array.get(outputSize);
cout << "Size is " << outputSize << endl;
if (outputArray != NULL)
{
Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/AxisBenchClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/AxisBenchClient.cpp?rev=345282&r1=345281&r2=345282&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/AxisBenchClient.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/AxisBenchClient.cpp Thu Nov 17 08:49:24 2005
@@ -73,7 +73,7 @@
// input->infos.m_Array = new BenchBasicDataType[input->count];
BenchBasicDataType_Array arrayIn;
- BenchBasicDataType ** ppBBDT = (BenchBasicDataType **) new BenchBasicDataType *[input->count];
+ BenchBasicDataType ** ppBBDT = new BenchBasicDataType *[input->count];
#ifdef WIN32
__int64 ll = 10000;
@@ -114,17 +114,7 @@
type->HexBinary.__size=i;
type->HexBinary.__ptr=buffer;
- if( i == 90)
- {
- *ppBBDT = type;
-// *ppBBDT = NULL;
- }
- else
- {
- *ppBBDT = type;
- }
-
- ppBBDT++;
+ ppBBDT[i] = type;
if( ll == 0)
{
@@ -154,7 +144,7 @@
for ( int ii = 0; ii < request ; ii++ ) {
if (output) { // Samisa: memory management BP
int outputSize =0;
- const BenchBasicDataType ** outArray =output->infos->get(outputSize);
+ BenchBasicDataType ** outArray =output->infos->get(outputSize);
for (int i = 0; i < outputSize; i++)
delete outArray[i];
delete output;
@@ -190,7 +180,7 @@
cout << "Input Count : " << input->count << endl;
cout << "Count : " << output->count << endl;
int outputSize = 0;
- const BenchBasicDataType ** outArray =output->infos->get(outputSize);
+ BenchBasicDataType ** outArray =output->infos->get(outputSize);
for ( ; i < output->count ; i++ )
{
if( outArray[i] != (BenchBasicDataType *) 0xcdcdcdcd)
@@ -274,10 +264,6 @@
delete input;
if (output)
{
- int outputSize = 0;
- const BenchBasicDataType ** outArray =output->infos->get(outputSize);
- for (int i = 0; i < outputSize; i++)
- delete (BenchBasicDataType*)(outArray[i]);
delete output;
}
}
Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ComplexListsClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ComplexListsClient.cpp?rev=345282&r1=345281&r2=345282&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ComplexListsClient.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ComplexListsClient.cpp Thu Nov 17 08:49:24 2005
@@ -59,7 +59,7 @@
if (ale->attrlist_Ref != NULL)
{
int outputSize =0;
- const namepair ** output =ale->attrlist_Ref->getitem()->get(outputSize);
+ namepair ** output =ale->attrlist_Ref->getitem()->get(outputSize);
//if (ale->attrlist_Ref->item.m_Array[0] != NULL)
if (output[0] != NULL)
{
@@ -194,7 +194,7 @@
}
catch(exception& e)
{
- cout << "Unknown exception has occured" << endl;
+ cout << "Unknown exception has occured : " << e.what() << endl;
}
catch(...)
{
Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ManyTypeRefRootClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ManyTypeRefRootClient.cpp?rev=345282&r1=345281&r2=345282&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ManyTypeRefRootClient.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ManyTypeRefRootClient.cpp Thu Nov 17 08:49:24 2005
@@ -70,7 +70,7 @@
result = ws->getInput(&input);
cout << "Success " << endl;
int outputSize=0;
- const Type1 **arrayResult = result->get(outputSize);
+ Type1 **arrayResult = result->get(outputSize);
for ( i = 0; i < 10; i++) {
cout << " Result " << arrayResult[i]->index << " : " << arrayResult[i]->kind << endl;
}
Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/NestedComplexClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/NestedComplexClient.cpp?rev=345282&r1=345281&r2=345282&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/NestedComplexClient.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/NestedComplexClient.cpp Thu Nov 17 08:49:24 2005
@@ -105,7 +105,7 @@
delete []array;
response = ws.echoNestedComplex(&complexType2);
int outputSize =0;
- const ComplexType1 ** output = response->getcomplexType1Array()->get(outputSize);
+ ComplexType1 ** output = response->getcomplexType1Array()->get(outputSize);
cout << output[0]->ct1_string << endl;
cout << output[0]->ct1_int << endl;
cout << output[0]->simpleArrays->stringArray->get(outputSize)[0] << " ";
Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/RecurseTypesClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/RecurseTypesClient.cpp?rev=345282&r1=345281&r2=345282&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/RecurseTypesClient.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/RecurseTypesClient.cpp Thu Nov 17 08:49:24 2005
@@ -83,7 +83,7 @@
cout << "\tKind = " << output->kind << endl;
array=NULL;
int outputSize = 0;
- const Type1 ** outArray = output->followings->get(outputSize);;
+ Type1 ** outArray = output->followings->get(outputSize);;
for ( i = 0; i < outputSize; i++ ) {
cout << "\tKind [" << i << "] = " << outArray[i]->kind << 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=345282&r1=345281&r2=345282&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 17 08:49:24 2005
@@ -42,4 +42,8 @@
0
1
2
+Complex array size is 3
+Hello World!
+Hello World!
+Hello World!
---------------------- TEST COMPLETE -----------------------------
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=345282&r1=345281&r2=345282&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 17 08:49:24 2005
@@ -42,3 +42,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><complexTypeWithComplexArrayResponse xmlns="http://org.apache.axis/Arrays/"><complexTypeWithComplexArray><complexTypeWithSimpleElement><simpleType>0</simpleType></complexTypeWithSimpleElement><complexTypeWithSimpleElement><simpleType>1</simpleType></complexTypeWithSimpleElement><complexTypeWithSimpleElement><simpleType>2</simpleType></complexTypeWithSimpleElement></complexTypeWithComplexArray></complexTypeWithComplexArrayResponse></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><moreComplexTypeArrayResponse xmlns="http://org.apache.axis/Arrays/"><moreComplexType><simpleString>Hello World!</simpleString></moreComplexType><moreComplexType><simpleString>Hello World!</simpleString></moreComplexType><moreComplexType><simpleString>Hello World!</simpleString></moreComplexType></moreComplexTypeArrayResponse></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=345282&r1=345281&r2=345282&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 17 08:49:24 2005
@@ -92,6 +92,29 @@
</xsd:sequence>
</xsd:complexType>
</xsd:element>
+ <xsd:complexType name="MoreComplexType">
+ <xsd:sequence>
+ <xsd:element name="simpleString" type="xsd:string"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ <xsd:element name="moreComplexTypeArrayResponse">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="moreComplexType"
+ type="tns:MoreComplexType" maxOccurs="unbounded">
+ </xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="moreComplexTypeArrayRequest">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="moreComplexType"
+ type="tns:MoreComplexType" maxOccurs="unbounded">
+ </xsd:element>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
</xsd:schema>
</wsdl:types>
<wsdl:message name="simpleArrayResponse">
@@ -132,6 +155,16 @@
element="tns:complexTypeWithComplexArrayRequest">
</wsdl:part>
</wsdl:message>
+ <wsdl:message name="moreComplexTypeArrayResponse">
+ <wsdl:part name="moreComplexTypeArrayResponse"
+ element="tns:moreComplexTypeArrayResponse">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="moreComplexTypeArrayRequest">
+ <wsdl:part name="moreComplexTypeArrayRequest"
+ element="tns:moreComplexTypeArrayRequest">
+ </wsdl:part>
+ </wsdl:message>
<wsdl:portType name="Arrays">
<wsdl:operation name="simpleArray">
<wsdl:input message="tns:simpleArrayRequest" />
@@ -157,6 +190,10 @@
message="tns:complexTypeWithComplexArrayResponse">
</wsdl:output>
</wsdl:operation>
+ <wsdl:operation name="moreComplexTypeArray">
+ <wsdl:input message="tns:moreComplexTypeArrayRequest"></wsdl:input>
+ <wsdl:output message="tns:moreComplexTypeArrayResponse"></wsdl:output>
+ </wsdl:operation>
</wsdl:portType>
<wsdl:binding name="ArraysSOAP" type="tns:Arrays">
<soap:binding style="document"
@@ -190,6 +227,15 @@
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="complexTypeWithComplexArray">
+ <soap:operation style="document"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="moreComplexTypeArray">
<soap:operation style="document"/>
<wsdl:input>
<soap:body use="literal"/>