AXISCPP-1067 - User types with suffix _Array causes problems with code generator
diff --git a/src/wsdl/org/apache/axis/wsdl/wsdl2ws/CUtils.java b/src/wsdl/org/apache/axis/wsdl/wsdl2ws/CUtils.java
index 14654f3..cbe1e42 100644
--- a/src/wsdl/org/apache/axis/wsdl/wsdl2ws/CUtils.java
+++ b/src/wsdl/org/apache/axis/wsdl/wsdl2ws/CUtils.java
@@ -103,6 +103,17 @@
// Used to find out whether a simple type is a pointer type.
private static HashSet c_pointerBasedTypes = null;
+ // Used to determine if string type represents an array...previously we use to
+ // do something like outParamTypeName.lastIndexOf ("_Array") all over the place
+ // but this does not work if type defined in WSDL already has _Array in the name.
+ private static HashSet c_arrayTypes = new HashSet();
+
+ // Used to determine if QName maps to an array.
+ private static Hashtable c_arrayTypeMapper = new Hashtable();
+
+ // Used to determine if QName maps to an array.
+ private static Hashtable c_arrayTypeMapper2 = new Hashtable();
+
// Language
private static String c_language = WrapperConstants.LANGUAGE_CPP;
@@ -956,6 +967,63 @@
}
/**
+ * Adds a type to the collection of array types.
+ *
+ * @param s
+ */
+ public static void addArrayType(QName qn, QName qn_array)
+ {
+ c_arrayTypes.add(qn_array.getLocalPart());
+ c_arrayTypeMapper.put(qn, qn_array);
+ c_arrayTypeMapper2.put(qn.getLocalPart(), qn_array.getLocalPart());
+ }
+
+ /**
+ * Method to determine if type is an array type.
+ *
+ * @param name
+ * @return
+ */
+ public static boolean isArrayType(String name)
+ {
+ if (name == null)
+ return false;
+
+ if ((name.startsWith("xsd__") || name.startsWith("xsdc__")) && name.endsWith("_Array"))
+ return true;
+ else
+ return c_arrayTypes.contains(name);
+ }
+
+ /**
+ * Method to determine if type is an array type.
+ *
+ * @param name
+ * @return
+ */
+ public static QName getArrayQNameForType(QName qname)
+ {
+ return (QName)c_arrayTypeMapper.get(qname);
+ }
+
+ /**
+ * Method to get array name for base name.
+ *
+ * @param name
+ * @return
+ */
+ public static String getArrayNameForType(String b)
+ {
+ String arrayName = (String)c_arrayTypeMapper2.get(b);
+ if (arrayName == null)
+ {
+ arrayName = b + "_Array";
+ c_arrayTypes.add(arrayName);
+ }
+ return arrayName;
+ }
+
+ /**
* Generates array name for complex type.
*
* @param qname
@@ -970,7 +1038,15 @@
if (!c_qnameToPrimitiveTypeMapper.containsKey(qname)
&& !c_schemaDefinedQNameToSimpleTypeMapper.containsKey(qname))
{
- arrayName = qname.getLocalPart() + "_Array";
+ QName arrayQName = getArrayQNameForType(qname);
+ if (arrayQName != null)
+ arrayName = arrayQName.getLocalPart();
+ else
+ {
+ arrayName = qname.getLocalPart() + "_Array";
+ c_arrayTypes.add(arrayName);
+ }
+
if (TypeMap.isAnonymousType(qname))
arrayName = CUtils.sanitizeString(arrayName);
}
@@ -984,9 +1060,20 @@
* @param stype
* @return
*/
- public static String getArrayNameforSimpleType(String stype)
+ public static String getArrayNameforSimpleType(QName qn, String stype)
{
- return stype + "_Array";
+ String arrayName = null;
+
+ QName arrayQName = getArrayQNameForType(qn);
+ if (arrayQName != null)
+ arrayName = arrayQName.getLocalPart();
+ else
+ {
+ arrayName = stype + "_Array";
+ c_arrayTypes.add(arrayName);
+ }
+
+ return arrayName;
}
/**
@@ -1242,17 +1329,15 @@
}
else if (!CUtils.isPrimitiveType(param.getSchemaName()))
{
- //array or complex types
+ //arrays or complex types
if (null != type && type.isArray())
{
- String arrayName = CUtils.getArrayNameForComplexType(getArrayType(type).getName());
- if (null == arrayName)
- {
- //simple type array
- /* Does the program flow ever come to this place ? if so in which situation ? - Susantha 20/10/2004 */
- arrayName =
- CUtils.getArrayNameforSimpleType(CUtils.getSimpleType(getArrayType(type).getName()));
- }
+ QName qn = getArrayType(type).getName();
+
+ String arrayName = CUtils.getArrayNameForComplexType(qn);
+ if (null == arrayName)
+ arrayName = CUtils.getArrayNameforSimpleType(qn, CUtils.getSimpleType(qn));
+
return arrayName;
}
else
@@ -1272,7 +1357,7 @@
</s:complexType>
</s:element>
*/
- return CUtils.getArrayNameforSimpleType(CUtils.getSimpleType(type.getName()));
+ return CUtils.getArrayNameforSimpleType(type.getName(), CUtils.getSimpleType(type.getName()));
}
else
return param.getLangName();
diff --git a/src/wsdl/org/apache/axis/wsdl/wsdl2ws/ParamWriter.java b/src/wsdl/org/apache/axis/wsdl/wsdl2ws/ParamWriter.java
index 3866ecc..54bb225 100644
--- a/src/wsdl/org/apache/axis/wsdl/wsdl2ws/ParamWriter.java
+++ b/src/wsdl/org/apache/axis/wsdl/wsdl2ws/ParamWriter.java
@@ -207,7 +207,7 @@
if (attrib.isArray())
{
if (attrib.isSimpleType())
- return CUtils.getArrayNameforSimpleType(attrib.getTypeName());
+ return CUtils.getArrayNameForType(attrib.getTypeName());
else
return CUtils.getArrayNameForComplexType(attrib.getSchemaName());
}
diff --git a/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/BeanParamWriter.java b/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/BeanParamWriter.java
index 719a9db..924637b 100644
--- a/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/BeanParamWriter.java
+++ b/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/BeanParamWriter.java
@@ -604,7 +604,8 @@
else if (attribs[i].isArray())
{
arrayCount++;
-
+ String containedTypeArrayName = null;
+
if (attribs[i].isSimpleType() || attribs[i].getType().isSimpleType())
{
String baseTypeName = null;
@@ -612,6 +613,8 @@
baseTypeName = CUtils.getSimpleType(attribs[i].getType().getBaseType());
else
baseTypeName = attribs[i].getTypeName();
+
+ containedTypeArrayName = CUtils.getArrayNameForType(baseTypeName);
c_writer.write(tab2 + "if (param->" + attribs[i].getParamNameAsMember() + " != NULL)\n");
c_writer.write(tab2 + "{\n");
@@ -621,7 +624,7 @@
c_writer.write("\n");
c_writer.write(tab2 + "param->" + attribs[i].getParamNameAsMember()
- + " = (" + baseTypeName + "_Array *)"
+ + " = (" + containedTypeArrayName + " *)"
+ "axiscSoapDeSerializerGetBasicArray(pDZ, "
+ CUtils.getXSDEnumeratorForType(baseTypeName) + ", \""
+ attribs[i].getParamNameAsSOAPString() + "\",0);\n");
@@ -807,7 +810,8 @@
if (attribs[i].isArray() && !attribs[i].isAnyElement())
{
writeNewline = true;
-
+ String containedTypeArrayName;
+
// If simple type array we call the axiscAxisNew() API; otherwise, we
// invoke the dynamically generated Axis_Create_xxxx() function.
if (attribs[i].isSimpleType() || attribs[i].getType().isSimpleType())
@@ -819,16 +823,20 @@
else
baseTypeName = attribs[i].getTypeName();
+ containedTypeArrayName = CUtils.getArrayNameForType(baseTypeName);
+
c_writer.write("\t\tpTemp->" + attribs[i].getParamNameAsMember()
- + " = (" + baseTypeName + "_Array *)axiscAxisNew(XSDC_ARRAY, 0);\n");
+ + " = (" + containedTypeArrayName + " *)axiscAxisNew(XSDC_ARRAY, 0);\n");
c_writer.write("\t\tpTemp->" + attribs[i].getParamNameAsMember() + "->m_Type = "
+ CUtils.getXSDEnumeratorForType(baseTypeName) + ";\n");
}
else
{
- c_writer.write("\t\tpTemp->" + attribs[i].getParamNameAsMember() + " = "
- + "Axis_Create_" + attribs[i].getTypeName() + "_Array(0);\n");
+ containedTypeArrayName = CUtils.getArrayNameForType(attribs[i].getTypeName());
+
+ c_writer.write("\t\tpTemp->" + attribs[i].getParamNameAsMember() + " = "
+ + "Axis_Create_" + containedTypeArrayName + "(0);\n");
}
}
}
@@ -923,15 +931,16 @@
c_writer.write("\t\t\taxiscAxisDelete(param->" + fieldName + ", XSDC_ANY);\n");
}
else
- {
- String deleteFunctionSuffix = "";
- if (attribs[i].isArray())
- deleteFunctionSuffix = "_Array";
-
+ {
c_writer.write("\t\tif (param->" + attribs[i].getParamNameAsMember() + ")\n");
- c_writer.write("\t\t\tAxis_Delete_" + attribs[i].getTypeName() + deleteFunctionSuffix
+
+ if (attribs[i].isArray())
+ c_writer.write("\t\t\tAxis_Delete_"
+ + CUtils.getArrayNameForType(attribs[i].getTypeName())
+ "(param->" + attribs[i].getParamNameAsMember() + ", 0);\n");
-
+ else
+ c_writer.write("\t\t\tAxis_Delete_" + attribs[i].getTypeName()
+ + "(param->" + attribs[i].getParamNameAsMember() + ", 0);\n");
}
}
diff --git a/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ClientStubHeaderWriter.java b/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ClientStubHeaderWriter.java
index dce737f..fc1dd5d 100644
--- a/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ClientStubHeaderWriter.java
+++ b/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ClientStubHeaderWriter.java
@@ -115,10 +115,10 @@
ParameterInfo returnParam =
(ParameterInfo) minfo.getOutputParameterTypes().iterator().next();
String outParamTypeName = CUtils.getClassNameFromParamInfoConsideringArrays(returnParam, wscontext);
- if ((outParamTypeName.lastIndexOf ("_Array") > 0)
+ if ((CUtils.isArrayType(outParamTypeName))
|| (CUtils.isSimpleType(outParamTypeName)
- && (returnParam.isNillable() || returnParam.isOptional())
- && !(CUtils.isPointerType(outParamTypeName))))
+ && (returnParam.isNillable() || returnParam.isOptional())
+ && !(CUtils.isPointerType(outParamTypeName))))
c_writer.write("extern " + outParamTypeName + " * ");
else
c_writer.write("extern " + outParamTypeName + " ");
@@ -143,10 +143,10 @@
.getClassNameFromParamInfoConsideringArrays(
fparam,
wscontext);
- if ((paramTypeName.lastIndexOf ("_Array") > 0)
- ||(CUtils.isSimpleType(paramTypeName)
- && fparam.isNillable()
- && !(CUtils.isPointerType(paramTypeName))))
+ if ((CUtils.isArrayType(paramTypeName))
+ || (CUtils.isSimpleType(paramTypeName)
+ && fparam.isNillable()
+ && !(CUtils.isPointerType(paramTypeName))))
{
c_writer.write(
paramTypeName
diff --git a/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ParmHeaderFileWriter.java b/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ParmHeaderFileWriter.java
index a465dd1..f6390eb 100644
--- a/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ParmHeaderFileWriter.java
+++ b/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ParmHeaderFileWriter.java
@@ -150,13 +150,15 @@
break;
}
- c_writer.write("typedef ");
+ c_writer.write("typedef " + langTypeName + " " + c_classname + ";\n");
+ c_writer.write("typedef "
+ + CUtils.getArrayNameForType(langTypeName) + " "
+ + CUtils.getArrayNameForType(c_classname) + ";\n");
+
if (CUtils.isPointerType(baseTypeName)
|| "xsdc__base64Binary".equals(baseTypeName)
|| "xsdc__hexBinary".equals(baseTypeName))
{
- c_writer.write(langTypeName + " " + c_classname + ";\n");
- c_writer.write("typedef " + langTypeName + "_Array " + c_classname + "_Array;\n");
c_writer.write("\n");
for (int i = 1; i < restrictionData.size(); i++)
@@ -185,9 +187,6 @@
}
else if ("int".equals(baseType.getLocalPart()))
{
- c_writer.write(langTypeName + " " + c_classname + ";\n");
- c_writer.write("typedef " + langTypeName + "_Array " + c_classname + "_Array;\n");
-
if (restrictionData.size() > 1)
{
//there are enumerations or min/maxInclusive
@@ -226,9 +225,6 @@
}
else
{
- c_writer.write(langTypeName + " " + c_classname + ";\n");
- c_writer.write("typedef " + langTypeName + "_Array " + c_classname + "_Array;\n");
-
for (int i = 1; i < restrictionData.size(); i++)
{
QName value = (QName) restrictionData.elementAt(i);
@@ -404,7 +400,7 @@
else if (!attribs[i].isSimpleType() && !attribs[i].isAnyElement())
{
if ((attribs[i].isArray()) && !theType.isSimpleType())
- typeSet.add(basicType + "_Array");
+ typeSet.add(CUtils.getArrayNameForType(basicType));
typeSet.add(basicType);
}
diff --git a/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/ClientStubHeaderWriter.java b/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/ClientStubHeaderWriter.java
index 1cb94d6..f9e0e65 100644
--- a/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/ClientStubHeaderWriter.java
+++ b/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/ClientStubHeaderWriter.java
@@ -78,10 +78,10 @@
ParameterInfo returnParam =
(ParameterInfo) minfo.getOutputParameterTypes().iterator().next();
String outParamTypeName = CUtils.getClassNameFromParamInfoConsideringArrays(returnParam, wscontext);
- if ((outParamTypeName.lastIndexOf ("_Array") > 0)
+ if ((CUtils.isArrayType(outParamTypeName))
|| (CUtils.isSimpleType(outParamTypeName)
- && (returnParam.isNillable() || returnParam.isOptional())
- && !(CUtils.isPointerType(outParamTypeName))))
+ && (returnParam.isNillable() || returnParam.isOptional())
+ && !(CUtils.isPointerType(outParamTypeName))))
c_writer.write("extern " + outParamTypeName + " * ");
else
c_writer.write("extern " + outParamTypeName + " ");
@@ -119,7 +119,7 @@
if (nparam.getType().isAttachment())
c_writer.write("AXISCHANDLE *Value" + j);
- else if ((paramTypeName.lastIndexOf ("_Array") > 0)
+ else if ((CUtils.isArrayType(paramTypeName))
|| (CUtils.isSimpleType(baseTypeName)
&& (nparam.isNillable() || nparam.isOptional())
&& !(CUtils.isPointerType(baseTypeName))))
@@ -216,10 +216,10 @@
if (atype.getBaseType() != null)
if (atype.getBaseType().getLocalPart().equals("string"))
- removeSet.add(atype.getLanguageSpecificName() + "_Array");
+ removeSet.add(CUtils.getArrayNameForType(atype.getLanguageSpecificName()));
if (atype.isRestriction())
- removeSet.add(atype.getLanguageSpecificName() + "_Array");
+ removeSet.add(CUtils.getArrayNameForType(atype.getLanguageSpecificName()));
typeSet.add(atype.getLanguageSpecificName());
}
diff --git a/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/ClientStubWriter.java b/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/ClientStubWriter.java
index c1dc225..57a5caa 100644
--- a/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/ClientStubWriter.java
+++ b/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/ClientStubWriter.java
@@ -83,7 +83,7 @@
else
{
returntypeissimple = CUtils.isSimpleType (outparamType);
- returntypeisarray = (outparamType.lastIndexOf ("_Array") > 0);
+ returntypeisarray = CUtils.isArrayType(outparamType);
}
returntypeisarray |= retType.isArray();
@@ -127,7 +127,6 @@
}
c_writer.write(" " + methodName + "(AXISCHANDLE stub");
-
ArrayList paramsB = (ArrayList) params;
ParameterInfo paramtype = null;
if (0 < paramsB.size ())
@@ -150,7 +149,7 @@
if (CUtils.isSimpleType (paramTypeName))
paramTypeName = CUtils.getClassNameFromParamInfoConsideringArrays(paramtype, wscontext);
- typeisarray = (paramTypeName.lastIndexOf ("_Array") > 0);
+ typeisarray = CUtils.isArrayType(paramTypeName);
if (!typeisarray)
paramTypeName = type.getLanguageSpecificName ();
@@ -200,7 +199,7 @@
if (CUtils.isSimpleType (paramTypeName))
paramTypeName = CUtils.getClassNameFromParamInfoConsideringArrays(paramtype, wscontext);
- typeisarray = (paramTypeName.lastIndexOf ("_Array") > 0);
+ typeisarray = CUtils.isArrayType(paramTypeName);
if (!typeisarray)
paramTypeName = type.getLanguageSpecificName ();
}
@@ -407,10 +406,8 @@
//=============================================================================
boolean commentIssued=false;
- String tab2;
for (int i = 0; i < paramsB.size(); i++)
{
- tab2 = "\t";
ParameterInfo param = (ParameterInfo) paramsB.get(i);
// Ignore attributes
@@ -437,7 +434,7 @@
if (CUtils.isSimpleType(paramTypeName))
paramTypeName = CUtils.getClassNameFromParamInfoConsideringArrays(param,wscontext);
- typeisarray = (paramTypeName.lastIndexOf("_Array") > 0);
+ typeisarray = CUtils.isArrayType(paramTypeName);
if (!typeisarray)
paramTypeName = type.getLanguageSpecificName();
}
@@ -635,7 +632,7 @@
else
{
currentParaType = CUtils.getClassNameFromParamInfoConsideringArrays(currentType, wscontext);
- typeisarray = (currentParaType.lastIndexOf("_Array") > 0);
+ typeisarray = CUtils.isArrayType(currentParaType);
}
typeisarray |= type.isArray ();
@@ -669,6 +666,7 @@
qname = type.getName ();
String containedType = null;
+ String containedTypeArrayName = null;
if (CUtils.isSimpleType(qname))
{
@@ -681,13 +679,15 @@
}
else
{
- containedType = qname.getLocalPart ();
+ containedType = qname.getLocalPart ();
+ containedTypeArrayName = CUtils.getArrayNameForComplexType(qname);
+
c_writer.write("\n\t\t\tif (OutValue" + i + " != NULL)\n" );
c_writer.write("\t\t{\n");
c_writer.write("\t\t\t\tif (" + currentParamName + " != NULL)\n");
- c_writer.write("\t\t\t\t\t" + currentParamName + " = Axis_Delete_" + containedType + "_Array(" + currentParamName + ",0);\n");
- c_writer.write("\t\t\t\t" + currentParamName + " = Axis_Create_" + containedType + "_Array(0);\n");
+ c_writer.write("\t\t\t\t\t" + currentParamName + " = Axis_Delete_" + containedTypeArrayName + "(" + currentParamName + ",0);\n");
+ c_writer.write("\t\t\t\t" + currentParamName + " = Axis_Create_" + containedTypeArrayName + "(0);\n");
c_writer.write("\t\t\t\taxiscCallGetCmplxArray(call, (Axisc_Array *)" + currentParamName
+ ", (void*) Axis_DeSerialize_" + containedType
@@ -701,15 +701,15 @@
c_writer.write("\t\t\t{\n");
c_writer.write("\t\t\t\t/* Unable to return value, but will deserialize to ensure subsequent elements can be correctly processed. */\n");
- c_writer.write("\t\t\t\t" + containedType + "_Array * pTemp" + i
- + " = Axis_Create_" + containedType + "_Array(0);\n");
+ c_writer.write("\t\t\t\t" + containedTypeArrayName + " * pTemp" + i
+ + " = Axis_Create_" + containedTypeArrayName + "(0);\n");
c_writer.write("\t\t\t\taxiscCallGetCmplxArray(call, (Axisc_Array *)pTemp" + i
+ ", (void*) Axis_DeSerialize_" + containedType
+ ", (void*) Axis_Create_" + containedType
+ ", (void*) Axis_Delete_" + containedType
+ ", \"" + currentType.getElementNameAsSOAPString ()
+ "\", Axis_URI_" + containedType + ");\n");
- c_writer.write("\t\t\t\tAxis_Delete_" + containedType + "_Array(pTemp" + i + ", 0);\n");
+ c_writer.write("\t\t\t\tAxis_Delete_" + containedTypeArrayName + "(pTemp" + i + ", 0);\n");
c_writer.write("\t\t\t}\n");
}
}
@@ -829,19 +829,26 @@
qname = CUtils.getArrayType (retType).getName ();
else
qname = retType.getName ();
+
String containedType = null;
+ String containedTypeArrayName = null;
+
if (CUtils.isSimpleType (qname))
{
- containedType = CUtils.getSimpleType (qname);
- c_writer.write ("\t\t\tRetArray =(" + containedType + "_Array *) axiscCallGetBasicArray(call, "
+ containedType = CUtils.getSimpleType (qname);
+ containedTypeArrayName = CUtils.getArrayNameforSimpleType(qname, containedType);
+
+ c_writer.write ("\t\t\tRetArray =(" + containedTypeArrayName + " *) axiscCallGetBasicArray(call, "
+ CUtils.getXSDEnumeratorForType (containedType)
+ ", \"" + returntype.getParamNameAsSOAPString () + "\", 0);\n");
}
else
{
- containedType = qname.getLocalPart ();
- c_writer.write("\t\t\tRetArray = (" + containedType
- + "_Array *) axiscCallGetCmplxArray(call, (Axisc_Array *)RetArray, (void*) Axis_DeSerialize_"
+ containedType = qname.getLocalPart ();
+ containedTypeArrayName = CUtils.getArrayNameForComplexType(qname);
+
+ c_writer.write("\t\t\tRetArray = (" + containedTypeArrayName
+ + " *) axiscCallGetCmplxArray(call, (Axisc_Array *)RetArray, (void*) Axis_DeSerialize_"
+ containedType
+ ", (void*) Axis_Create_" + containedType
+ ", (void*) Axis_Delete_" + containedType
diff --git a/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/BeanParamWriter.java b/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/BeanParamWriter.java
index 65726c6..e38860d 100644
--- a/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/BeanParamWriter.java
+++ b/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/BeanParamWriter.java
@@ -830,7 +830,8 @@
else if (attribs[i].isArray())
{
arrayCount++;
-
+ String containedTypeArrayName = null;
+
if (attribs[i].isSimpleType() || attribs[i].getType().isSimpleType())
{
String baseTypeName = null;
@@ -839,20 +840,24 @@
else
baseTypeName = attribs[i].getTypeName();
+ containedTypeArrayName = CUtils.getArrayNameForType(attribs[i].getTypeName());
+
c_writer.write(tab2 + "Axis_Array * array" + arrayCount + " = pIWSDZ->getBasicArray("
+ CUtils.getXSDEnumeratorForType(baseTypeName) + ", \""
+ attribs[i].getParamNameAsSOAPString()
+ "\",0);\n");
c_writer.write(tab2 + "if(param->" + attribs[i].getParamNameAsMember() + " == NULL)\n");
- c_writer.write(tab2 + "\tparam->" + attribs[i].getParamNameAsMember() + " = new " + attribs[i].getTypeName() + "_Array();\n");
+ c_writer.write(tab2 + "\tparam->" + attribs[i].getParamNameAsMember() + " = new " + containedTypeArrayName + "();\n");
c_writer.write(tab2 + "param->" + attribs[i].getParamNameAsMember() + "->clone( *array" + arrayCount + ");\n");
c_writer.write(tab2 + "Axis::AxisDelete((void*) array" + arrayCount + ", XSD_ARRAY);\n\n");
}
else
{
arrayType = attribs[i].getTypeName();
+ containedTypeArrayName = CUtils.getArrayNameForType(arrayType);
+
c_writer.write(tab2 + "if(param->" + attribs[i].getParamNameAsMember() + " == NULL)\n");
- c_writer.write(tab2 + "\tparam->" + attribs[i].getParamNameAsMember() + " = new " + arrayType + "_Array();\n");
+ c_writer.write(tab2 + "\tparam->" + attribs[i].getParamNameAsMember() + " = new " + containedTypeArrayName + "();\n");
c_writer.write(tab2 + "pIWSDZ->getCmplxArray(param->" + attribs[i].getParamNameAsMember()
+ ", (void*)Axis_DeSerialize_" + arrayType
+ ", (void*)Axis_Create_" + arrayType
@@ -1124,7 +1129,7 @@
{
c_writer.write("\tif (original." + attribs[i].getParamNameAsMember() + " != NULL)\n");
c_writer.write("\t\t" + attribs[i].getParamNameAsMember() + " = new "
- + attribs[i].getTypeName() + "_Array(*original."
+ + CUtils.getArrayNameForType(attribs[i].getTypeName()) + "(*original."
+ attribs[i].getParamNameAsMember() + ");\n");
}
else
diff --git a/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubHeaderWriter.java b/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubHeaderWriter.java
index 610ac62..5cc26b8 100644
--- a/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubHeaderWriter.java
+++ b/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubHeaderWriter.java
@@ -122,10 +122,10 @@
ParameterInfo returnParam =
(ParameterInfo) minfo.getOutputParameterTypes().iterator().next();
String outParamTypeName = CUtils.getClassNameFromParamInfoConsideringArrays(returnParam, wscontext);
- if ((outParamTypeName.lastIndexOf ("_Array") > 0)
- ||(CUtils.isSimpleType(outParamTypeName)
- && (returnParam.isNillable() || returnParam.isOptional())
- && !(CUtils.isPointerType(outParamTypeName))))
+ if ((CUtils.isArrayType(outParamTypeName))
+ || (CUtils.isSimpleType(outParamTypeName)
+ && (returnParam.isNillable() || returnParam.isOptional())
+ && !(CUtils.isPointerType(outParamTypeName))))
c_writer.write("\tSTORAGE_CLASS_INFO " + outParamTypeName + " * ");
else
c_writer.write("\tSTORAGE_CLASS_INFO " + outParamTypeName + " ");
@@ -145,7 +145,7 @@
{
ParameterInfo nparam = (ParameterInfo) params.next();
String paramTypeName = CUtils.getClassNameFromParamInfoConsideringArrays(nparam, wscontext);
- if ((paramTypeName.lastIndexOf ("_Array") > 0)
+ if ((CUtils.isArrayType(paramTypeName))
|| (CUtils.isSimpleType(paramTypeName)
&& (nparam.isNillable() || nparam.isOptional())
&& !(CUtils.isPointerType(paramTypeName))))
@@ -212,7 +212,7 @@
typeSet.add(typeName);
if (atype.isRestriction())
- removeSet.add(atype.getLanguageSpecificName() + "_Array");
+ removeSet.add(CUtils.getArrayNameForType(atype.getLanguageSpecificName()));
}
Iterator ritr = removeSet.iterator();
diff --git a/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubWriter.java b/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubWriter.java
index ac461fc..47e5744 100644
--- a/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubWriter.java
+++ b/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubWriter.java
@@ -216,7 +216,7 @@
else
{
returntypeissimple = CUtils.isSimpleType (outparamType);
- returntypeisarray = (outparamType.lastIndexOf ("_Array") > 0);
+ returntypeisarray = CUtils.isArrayType(outparamType);
}
returntypeisarray |= retType.isArray();
@@ -506,7 +506,10 @@
if (typeisarray)
{
QName qname = CUtils.getArrayType(type).getName();
+
String containedType = null;
+ String containedTypeArrayName = null;
+
if (CUtils.isSimpleType(qname))
{
containedType = CUtils.getSimpleType(qname);
@@ -525,11 +528,13 @@
}
else
{
- containedType = qname.getLocalPart();
+ containedType = qname.getLocalPart();
+ containedTypeArrayName = CUtils.getArrayNameForComplexType(qname);
+
c_writer.write("\n\t\t\tif( OutValue" + i + " != NULL)\n" );
c_writer.write("\t\t\t{\n");
c_writer.write("\t\t\t\tif( " + currentParamName + " == NULL)\n");
- c_writer.write("\t\t\t\t\t" + currentParamName + " = new " + containedType + "_Array();\n");
+ c_writer.write("\t\t\t\t\t" + currentParamName + " = new " + containedTypeArrayName + "();\n");
c_writer.write("\t\t\t\telse\n");
c_writer.write("\t\t\t\t\t(" + currentParamName + ")->clear();\n");
c_writer.write("\t\t\t\tm_pCall->getCmplxArray( " + currentParamName
@@ -542,8 +547,8 @@
c_writer.write("\t\t\telse\n");
c_writer.write("\t\t\t{\n");
c_writer.write("\t\t\t\t// Unable to return value, but will deserialize to ensure subsequent elements can be correctly processed.\n");
- c_writer.write("\t\t\t\t" + containedType + "_Array * pTemp" + i
- + " = new " + containedType + "_Array();\n");
+ c_writer.write("\t\t\t\t" + containedTypeArrayName + " * pTemp" + i
+ + " = new " + containedTypeArrayName + "();\n");
c_writer.write("\t\t\t\tm_pCall->getCmplxArray( pTemp" + i
+ ",(void *) Axis_DeSerialize_" + containedType
+ ",(void *) Axis_Create_" + containedType
@@ -637,7 +642,10 @@
else if (returntypeisarray)
{
QName qname = CUtils.getArrayType(retType).getName();
+
String containedType = null;
+ String containedTypeArrayName = null;
+
if (CUtils.isSimpleType(qname))
{
containedType = CUtils.getSimpleType(qname);
@@ -649,9 +657,11 @@
}
else
{
- containedType = qname.getLocalPart();
- c_writer.write("\t\t\t\tRetArray = (" + containedType
- + "_Array *) m_pCall->getCmplxArray( RetArray,(void *) Axis_DeSerialize_"
+ containedType = qname.getLocalPart();
+ containedTypeArrayName = CUtils.getArrayNameForComplexType(qname);
+
+ c_writer.write("\t\t\t\tRetArray = (" + containedTypeArrayName
+ + " *) m_pCall->getCmplxArray( RetArray,(void *) Axis_DeSerialize_"
+ containedType);
c_writer.write(",(void *) Axis_Create_" + containedType
+ ",(void *) Axis_Delete_" + containedType
diff --git a/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ParmHeaderFileWriter.java b/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ParmHeaderFileWriter.java
index acbbdf8..0d718b5 100644
--- a/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ParmHeaderFileWriter.java
+++ b/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ParmHeaderFileWriter.java
@@ -201,13 +201,15 @@
break;
}
- c_writer.write("typedef ");
+ c_writer.write("typedef " + langTypeName + " " + c_classname + ";\n");
+ c_writer.write("typedef "
+ + CUtils.getArrayNameForType(langTypeName) + " "
+ + CUtils.getArrayNameForType(c_classname) + ";\n");
+
if (CUtils.isPointerType(baseTypeName)
|| "xsd__base64Binary".equals(baseTypeName)
|| "xsd__hexBinary".equals(baseTypeName))
{
- c_writer.write(langTypeName + " " + c_classname + ";\n");
- c_writer.write("typedef " + langTypeName + "_Array " + c_classname + "_Array;\n");
c_writer.write("\n");
for (int i = 1; i < restrictionData.size(); i++)
@@ -236,9 +238,6 @@
}
else if ("int".equals(baseType.getLocalPart()))
{
- c_writer.write(langTypeName + " " + c_classname + ";\n");
- c_writer.write("typedef " + langTypeName + "_Array " + c_classname + "_Array;\n");
-
if (restrictionData.size() > 1)
{
//there are enumerations or min/maxInclusive
@@ -277,9 +276,6 @@
}
else
{
- c_writer.write(langTypeName + " " + c_classname + ";\n");
- c_writer.write("typedef " + langTypeName + "_Array " + c_classname + "_Array;\n");
-
for (int i = 1; i < restrictionData.size(); i++)
{
QName value = (QName) restrictionData.elementAt(i);
@@ -534,7 +530,7 @@
else if (!attribs[i].isSimpleType() && !attribs[i].isAnyElement())
{
if ((attribs[i].isArray()) && !theType.isSimpleType())
- typeSet.add(basicType + "_Array");
+ typeSet.add(CUtils.getArrayNameForType(basicType));
typeSet.add(basicType);
}
diff --git a/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ServiceHeaderWriter.java b/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ServiceHeaderWriter.java
index 1d66e46..5b10944 100644
--- a/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ServiceHeaderWriter.java
+++ b/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ServiceHeaderWriter.java
@@ -136,10 +136,10 @@
String returnTypeName = returntype.getLangName();
String returnType = CUtils.getClassNameFromParamInfoConsideringArrays(returntype,wscontext);
- if ((returnType.lastIndexOf ("_Array") > 0)
+ if ((CUtils.isArrayType(returnType))
|| (CUtils.isSimpleType(returnTypeName)
- && (returntype.isNillable() || returntype.isOptional())
- && !(CUtils.isPointerType(returnTypeName))))
+ && (returntype.isNillable() || returntype.isOptional())
+ && !(CUtils.isPointerType(returnTypeName))))
{
c_writer.write(
"\t\t"
@@ -178,9 +178,10 @@
c_writer.write("ISoapAttachment *Value" + 0);
}
- else if ((paramType.lastIndexOf ("_Array") > 0)||(CUtils.isSimpleType(paramTypeName)
- && (fparam.isNillable() || fparam.isOptional())
- && !(CUtils.isPointerType(paramTypeName))))
+ else if ((CUtils.isArrayType(paramType))
+ || (CUtils.isSimpleType(paramTypeName)
+ && (fparam.isNillable() || fparam.isOptional())
+ && !(CUtils.isPointerType(paramTypeName))))
{
c_writer.write(
paramType
@@ -210,9 +211,10 @@
c_writer.write(", ISoapAttachment *Value" + j);
}
- else if ((typeName.lastIndexOf ("_Array") > 0)||(CUtils.isSimpleType(paramTypeName)
- && (nparam.isNillable()|| nparam.isOptional())
- && !(CUtils.isPointerType(paramTypeName))))
+ else if ((CUtils.isArrayType(typeName))
+ || (CUtils.isSimpleType(paramTypeName)
+ && (nparam.isNillable()|| nparam.isOptional())
+ && !(CUtils.isPointerType(paramTypeName))))
{
c_writer.write(
","
@@ -298,7 +300,7 @@
typeSet.add(typeName);
if (atype.isRestriction())
- removeSet.add(atype.getLanguageSpecificName() + "_Array");
+ removeSet.add(CUtils.getArrayNameForType(atype.getLanguageSpecificName()));
}
Iterator ritr = removeSet.iterator();
diff --git a/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ServiceWriter.java b/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ServiceWriter.java
index 9628405..1df0e73 100644
--- a/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ServiceWriter.java
+++ b/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ServiceWriter.java
@@ -156,9 +156,10 @@
.next();
String returnTypeName = returntype.getLangName();
String returnType = CUtils.getClassNameFromParamInfoConsideringArrays(returntype,wscontext);
- if ((returnType.lastIndexOf ("_Array") > 0)||(CUtils.isSimpleType(returntype.getLangName())
- && (returntype.isNillable()|| returntype.isOptional())
- && !(CUtils.isPointerType(returnTypeName))))
+ if ((CUtils.isArrayType(returnType))
+ || (CUtils.isSimpleType(returntype.getLangName())
+ && (returntype.isNillable()|| returntype.isOptional())
+ && !(CUtils.isPointerType(returnTypeName))))
{
c_writer.write(
returnType
@@ -194,9 +195,10 @@
c_writer.write("ISoapAttachment *Value" + 0);
}
- else if ((fparamType.lastIndexOf ("_Array") > 0)||(CUtils.isSimpleType(fparamTypeName)
- && (fparam.isNillable()|| fparam.isOptional())
- && !(CUtils.isPointerType(fparamTypeName))))
+ else if ((CUtils.isArrayType(fparamType))
+ || (CUtils.isSimpleType(fparamTypeName)
+ && (fparam.isNillable()|| fparam.isOptional())
+ && !(CUtils.isPointerType(fparamTypeName))))
{
c_writer.write(
fparamType
@@ -222,9 +224,10 @@
c_writer.write(", ISoapAttachment *Value" + j);
}
- else if ((paramType.lastIndexOf ("_Array") > 0)||(CUtils.isSimpleType(paramTypeName)
- && (nparam.isNillable()|| nparam.isOptional())
- && !(CUtils.isPointerType(paramTypeName))))
+ else if ((CUtils.isArrayType(paramType))
+ || (CUtils.isSimpleType(paramTypeName)
+ && (nparam.isNillable()|| nparam.isOptional())
+ && !(CUtils.isPointerType(paramTypeName))))
{
c_writer.write(
","
diff --git a/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/WrapWriter.java b/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/WrapWriter.java
index 4794dac..7526688 100644
--- a/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/WrapWriter.java
+++ b/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/WrapWriter.java
@@ -413,8 +413,10 @@
if (CUtils.isSimpleType(qname))
{
containedType = CUtils.getSimpleType(qname);
+ String containedTypeArray = CUtils.getArrayNameForType(containedType);
- c_writer.write("\n\t" + containedType + "_Array * v" + i +" = new " + containedType + "_Array();\n");
+ c_writer.write("\n\t" + containedTypeArray + " * v" + i +" = new "
+ + containedTypeArray + "();\n");
c_writer.write(
"\t"
+ "Axis_Array * RetArray"
@@ -430,7 +432,8 @@
else
{
containedType = qname.getLocalPart();
- c_writer.write("\t" + containedType + "_Array * v" + i +" = new " + containedType + "_Array();\n");
+ String containedTypeArray = CUtils.getArrayNameForType(containedType);
+ c_writer.write("\t" + containedTypeArray + " * v" + i +" = new " + containedTypeArray + "();\n");
c_writer.write(
"\t"
+ "pIWSDZ->getCmplxArray(v" + i + ", (void*)Axis_DeSerialize_"
@@ -497,8 +500,8 @@
/* Invoke the service when return type not void */
c_writer.write("\t\t" + outparamTypeName);
- if ((outparamTypeName.lastIndexOf ("_Array") > 0)
- ||(returntypeissimple
+ if ((CUtils.isArrayType(outparamTypeName))
+ || (returntypeissimple
&& returntype.isNillable()
&&!(CUtils.isPointerType(outparamTypeName))))
{
diff --git a/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubHeaderWriter.java b/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubHeaderWriter.java
index 54b0d93..12479a1 100644
--- a/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubHeaderWriter.java
+++ b/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubHeaderWriter.java
@@ -72,10 +72,10 @@
ParameterInfo returnParam =
(ParameterInfo) minfo.getOutputParameterTypes().iterator().next();
String outParamTypeName = CUtils.getClassNameFromParamInfoConsideringArrays(returnParam, wscontext);
- if ((outParamTypeName.lastIndexOf ("_Array") > 0)
+ if ((CUtils.isArrayType(outParamTypeName))
|| (CUtils.isSimpleType(outParamTypeName)
- && (returnParam.isNillable() || returnParam.isOptional())
- && !(CUtils.isPointerType(outParamTypeName))))
+ && (returnParam.isNillable() || returnParam.isOptional())
+ && !(CUtils.isPointerType(outParamTypeName))))
c_writer.write("\tSTORAGE_CLASS_INFO " + outParamTypeName + " * ");
else
c_writer.write("\tSTORAGE_CLASS_INFO " + outParamTypeName + " ");
@@ -108,7 +108,7 @@
if (nparam.getType().isAttachment())
c_writer.write("ISoapAttachment *Value" + j);
- else if ((paramTypeName.lastIndexOf ("_Array") > 0)
+ else if ((CUtils.isArrayType(paramTypeName))
|| (CUtils.isSimpleType(baseTypeName)
&& (nparam.isNillable() || nparam.isOptional())
&& !(CUtils.isPointerType(baseTypeName))))
@@ -201,10 +201,10 @@
if (atype.getBaseType() != null)
if (atype.getBaseType().getLocalPart().equals("string"))
- removeSet.add(atype.getLanguageSpecificName() + "_Array");
+ removeSet.add(CUtils.getArrayNameForType(atype.getLanguageSpecificName()));
if (atype.isRestriction())
- removeSet.add(atype.getLanguageSpecificName() + "_Array");
+ removeSet.add(CUtils.getArrayNameForType(atype.getLanguageSpecificName()));
typeSet.add(atype.getLanguageSpecificName());
}
diff --git a/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubWriter.java b/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubWriter.java
index 506b837..257035e 100644
--- a/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubWriter.java
+++ b/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubWriter.java
@@ -102,7 +102,7 @@
else
{
returntypeissimple = CUtils.isSimpleType (outparamType);
- returntypeisarray = (outparamType.lastIndexOf ("_Array") > 0);
+ returntypeisarray = CUtils.isArrayType(outparamType);
}
returntypeisarray |= retType.isArray();
@@ -158,7 +158,7 @@
if (CUtils.isSimpleType (paramTypeName))
paramTypeName = CUtils.getClassNameFromParamInfoConsideringArrays(paramtype, wscontext);
- typeisarray = (paramTypeName.lastIndexOf ("_Array") > 0);
+ typeisarray = CUtils.isArrayType(paramTypeName);
if (!typeisarray)
paramTypeName = type.getLanguageSpecificName ();
@@ -208,7 +208,7 @@
if (CUtils.isSimpleType (paramTypeName))
paramTypeName = CUtils.getClassNameFromParamInfoConsideringArrays(paramtype, wscontext);
- typeisarray = (paramTypeName.lastIndexOf ("_Array") > 0);
+ typeisarray = CUtils.isArrayType(paramTypeName);
if (!typeisarray)
paramTypeName = type.getLanguageSpecificName ();
}
@@ -429,7 +429,7 @@
if (CUtils.isSimpleType (paramTypeName))
paramTypeName = CUtils.getClassNameFromParamInfoConsideringArrays(param,wscontext);
- typeisarray = (paramTypeName.lastIndexOf ("_Array") > 0);
+ typeisarray = CUtils.isArrayType(paramTypeName);
if (!typeisarray)
paramTypeName = type.getLanguageSpecificName ();
}
@@ -626,7 +626,7 @@
else
{
currentParaType = CUtils.getClassNameFromParamInfoConsideringArrays(currentType, wscontext);
- typeisarray = (currentParaType.lastIndexOf("_Array") > 0);
+ typeisarray = CUtils.isArrayType(currentParaType);
}
typeisarray |= type.isArray ();
@@ -660,6 +660,7 @@
qname = type.getName ();
String containedType = null;
+ String containedTypeArrayName = null;
if (CUtils.isSimpleType (qname))
{
@@ -680,11 +681,13 @@
}
else
{
- containedType = qname.getLocalPart ();
+ containedType = qname.getLocalPart ();
+ containedTypeArrayName = CUtils.getArrayNameForComplexType(qname);
+
c_writer.write("\n\t\t\t\tif (OutValue" + i + " != NULL)\n" );
c_writer.write("\t\t\t\t{\n");
c_writer.write("\t\t\t\t\tif (" + currentParamName + " == NULL)\n");
- c_writer.write("\t\t\t\t\t\t" + currentParamName + " = new " + containedType + "_Array();\n");
+ c_writer.write("\t\t\t\t\t\t" + currentParamName + " = new " + containedTypeArrayName + "();\n");
c_writer.write("\t\t\t\t\telse\n");
c_writer.write("\t\t\t\t\t\t(" + currentParamName + ")->clear();\n");
c_writer.write("\t\t\t\t\tm_pCall->getCmplxArray(" + currentParamName
@@ -697,8 +700,8 @@
c_writer.write("\t\t\t\telse\n");
c_writer.write("\t\t\t\t{\n");
c_writer.write("\t\t\t\t\t// Unable to return value, but will deserialize to ensure subsequent elements can be correctly processed.\n");
- c_writer.write("\t\t\t\t\t" + containedType + "_Array * pTemp" + i
- + " = new " + containedType + "_Array();\n");
+ c_writer.write("\t\t\t\t\t" + containedTypeArrayName + " * pTemp" + i
+ + " = new " + containedTypeArrayName + "();\n");
c_writer.write("\t\t\t\t\tm_pCall->getCmplxArray(pTemp" + i
+ ", (void*) Axis_DeSerialize_" + containedType
+ ", (void*) Axis_Create_" + containedType
@@ -811,7 +814,10 @@
qname = CUtils.getArrayType (retType).getName ();
else
qname = retType.getName ();
+
String containedType = null;
+ String containedTypeArrayName = null;
+
if (CUtils.isSimpleType (qname))
{
containedType = CUtils.getSimpleType (qname);
@@ -824,7 +830,9 @@
else
{
containedType = qname.getLocalPart ();
- c_writer.write("\t\t\t\tRetArray = (" + containedType + "_Array *) m_pCall->getCmplxArray(RetArray, (void*) Axis_DeSerialize_"
+ containedTypeArrayName = CUtils.getArrayNameForComplexType(qname);
+
+ c_writer.write("\t\t\t\tRetArray = (" + containedTypeArrayName + " *) m_pCall->getCmplxArray(RetArray, (void*) Axis_DeSerialize_"
+ containedType
+ ", (void*) Axis_Create_" + containedType
+ ", (void*) Axis_Delete_" + containedType
diff --git a/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ServiceHeaderWriter.java b/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ServiceHeaderWriter.java
index 61c3204..daf3f77 100644
--- a/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ServiceHeaderWriter.java
+++ b/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ServiceHeaderWriter.java
@@ -104,7 +104,7 @@
typeSet.add(atype.getLanguageSpecificName());
if (atype.isRestriction())
- removeSet.add(atype.getLanguageSpecificName() + "_Array");
+ removeSet.add(CUtils.getArrayNameForType(atype.getLanguageSpecificName()));
}
Iterator ritr = removeSet.iterator();
diff --git a/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/WrapWriter.java b/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/WrapWriter.java
index 9fe9fe4..7a0b4fa 100644
--- a/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/WrapWriter.java
+++ b/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/WrapWriter.java
@@ -176,9 +176,10 @@
//for simple types
if (param.isArray())
{
- String containedType = CUtils.getSimpleType(type.getName());
+ String containedType = CUtils.getSimpleType(type.getName());
+ String containedTypeArray = CUtils.getArrayNameForType(containedType);
- c_writer.write("\n\t" + containedType + "_Array * v" + i +" = new " + containedType + "_Array();\n");
+ c_writer.write("\n\t" + containedTypeArray + " * v" + i +" = new " + containedTypeArray + "();\n");
c_writer.write("\t"
+ "Axis_Array * RetArray" + i + " = pIWSDZ->getBasicArray("
+ CUtils.getXSDEnumeratorForType(containedType)
@@ -256,7 +257,9 @@
if (CUtils.isSimpleType(qname))
{
containedType = CUtils.getSimpleType(qname);
- c_writer.write("\n\t" + outparamType + "_Array * v" + i +" = new " + outparamType + "_Array();\n");
+ String containedTypeArray = CUtils.getArrayNameForType(outparamType);
+
+ c_writer.write("\n\t" + containedTypeArray + " * v" + i +" = new " + containedTypeArray + "();\n");
c_writer.write("\t"
+ "Axis_Array * RetArray" + i + " = pIWSDZ->getBasicArray("
+ CUtils.getXSDEnumeratorForType(containedType)
@@ -331,7 +334,7 @@
/* Invoke the service when return type not void */
returnParamName = returntype.getElementNameAsSOAPString();
c_writer.write("\t\t" + outparamType);
- if ((outparamType.lastIndexOf ("_Array") > 0)
+ if ((CUtils.isArrayType(outparamType))
||(!returntypeisarray
&& (!returntypeissimple
|| (returntypeissimple
diff --git a/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/WSDLInfo.java b/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/WSDLInfo.java
index fab80e2..b7c3071 100644
--- a/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/WSDLInfo.java
+++ b/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/WSDLInfo.java
@@ -112,6 +112,7 @@
// Maps service definition to set of ports that use RPC binding style
ArrayList c_bindings = new ArrayList();
+ private static int typeCounter = 1;
/**
* Constructor.
@@ -623,13 +624,38 @@
typedata = c_typeMap.getType(newqn);
if (typedata != null)
{
- if (c_verbose && !CUtils.isPrimitiveType(type.getQName()))
- System.out.println("Type not created, already exists: " + type.getQName());
-
- return typedata;
+ if (typedata.isArray())
+ {
+ if (c_verbose && !CUtils.isPrimitiveType(type.getQName()))
+ System.out.println("Type not created, already exists: " + type.getQName());
+
+ return typedata;
+ }
+ else
+ {
+ // There is a type with the _Array suffix in WSDL that was already processed.
+ // If an array type was not already created, create one with different name.
+ QName arrayQName = CUtils.getArrayQNameForType(qn);
+ if (arrayQName == null)
+ {
+ newqn = new QName(type.getQName().getNamespaceURI(), qn.getLocalPart() + "_Array" + typeCounter);
+ ++typeCounter;
+
+ if (c_verbose)
+ System.out.println("Type clash, change type name to : " + newqn);
+ }
+ else
+ {
+ if (c_verbose)
+ System.out.println("Type not created, already exists: " + type.getQName());
+
+ return c_typeMap.getType(arrayQName);
+ }
+ }
}
typedata = new Type(newqn, newqn.getLocalPart());
+ CUtils.addArrayType(qn, newqn);
if (type.getRefType().getRefType() != null)
typedata.setElementType(type.getRefType().getRefType().getQName().getLocalPart());
@@ -642,8 +668,11 @@
typedata = c_typeMap.getType(type.getQName());
if (typedata != null)
{
- if (c_verbose && !CUtils.isPrimitiveType(type.getQName()))
- System.out.println("Type not created, already exists: " + type.getQName());
+ if (!typedata.isArray())
+ {
+ if (c_verbose && !CUtils.isPrimitiveType(type.getQName()))
+ System.out.println("Type not created, already exists: " + type.getQName());
+ }
return typedata;
}
@@ -697,10 +726,11 @@
}
else if (type instanceof CollectionType)
{
+ typedata.setArray(true);
+
newSecondaryType = createTypeInfo(type.getRefType().getQName());
typedata.addRelatedType(newSecondaryType);
typedata.setTypeNameForElementName(new CElementDecl(newSecondaryType, type.getQName()));
- typedata.setArray(true);
}
else
{
@@ -708,17 +738,19 @@
QName arrayType = CSchemaUtils.getArrayComponentQName(node,new IntHolder(0),c_symbolTable);
if (arrayType != null)
{
+ typedata.setArray(true);
+
newSecondaryType = createTypeInfo(arrayType);
typedata.addRelatedType(newSecondaryType);
typedata.setTypeNameForElementName(new CElementDecl(newSecondaryType, new QName("item")));
- typedata.setArray(true);
}
else if ((arrayType = CSchemaUtils.getCollectionComponentQName(node)) != null)
{
+ typedata.setArray(true);
+
newSecondaryType = createTypeInfo(arrayType);
typedata.addRelatedType(newSecondaryType);
typedata.setTypeNameForElementName(new CElementDecl(newSecondaryType, new QName("item")));
- typedata.setArray(true);
}
//Note in a array the parameter type is stored as under the name item all the time
else