axis-c-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nadira...@apache.org
Subject svn commit: r923963 - in /axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws: ./ c/ c/literal/ cpp/ cpp/literal/ info/
Date Tue, 16 Mar 2010 20:17:40 GMT
Author: nadiramra
Date: Tue Mar 16 20:17:40 2010
New Revision: 923963

URL: http://svn.apache.org/viewvc?rev=923963&view=rev
Log:
AXISCPP-1067 - User types with suffix _Array causes problems with code generator

Modified:
    axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/CUtils.java
    axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/ParamWriter.java
    axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/BeanParamWriter.java
    axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ClientStubHeaderWriter.java
    axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ParmHeaderFileWriter.java
    axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/ClientStubHeaderWriter.java
    axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/ClientStubWriter.java
    axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/BeanParamWriter.java
    axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubHeaderWriter.java
    axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubWriter.java
    axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ParmHeaderFileWriter.java
    axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ServiceHeaderWriter.java
    axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ServiceWriter.java
    axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/WrapWriter.java
    axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubHeaderWriter.java
    axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubWriter.java
    axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ServiceHeaderWriter.java
    axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/WrapWriter.java
    axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/WSDLInfo.java

Modified: axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/CUtils.java
URL: http://svn.apache.org/viewvc/axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/CUtils.java?rev=923963&r1=923962&r2=923963&view=diff
==============================================================================
--- axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/CUtils.java (original)
+++ axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/CUtils.java Tue Mar 16 20:17:40 2010
@@ -103,6 +103,17 @@ public class CUtils 
     // 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 @@ public class CUtils 
     }
     
     /**
+     * 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 @@ public class CUtils 
         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 @@ public class CUtils 
      * @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 @@ public class CUtils 
         }
         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 @@ public class CUtils 
                 </s:complexType>
             </s:element>
              */
-            return CUtils.getArrayNameforSimpleType(CUtils.getSimpleType(type.getName()));
+            return CUtils.getArrayNameforSimpleType(type.getName(), CUtils.getSimpleType(type.getName()));
         }
         else
             return param.getLangName();

Modified: axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/ParamWriter.java
URL: http://svn.apache.org/viewvc/axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/ParamWriter.java?rev=923963&r1=923962&r2=923963&view=diff
==============================================================================
--- axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/ParamWriter.java (original)
+++ axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/ParamWriter.java Tue Mar 16 20:17:40 2010
@@ -207,7 +207,7 @@ public abstract class ParamWriter extend
         if (attrib.isArray())
         {
             if (attrib.isSimpleType())
-                return CUtils.getArrayNameforSimpleType(attrib.getTypeName());
+                return CUtils.getArrayNameForType(attrib.getTypeName());
             else
                 return CUtils.getArrayNameForComplexType(attrib.getSchemaName());
         }

Modified: axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/BeanParamWriter.java
URL: http://svn.apache.org/viewvc/axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/BeanParamWriter.java?rev=923963&r1=923962&r2=923963&view=diff
==============================================================================
--- axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/BeanParamWriter.java (original)
+++ axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/BeanParamWriter.java Tue Mar 16 20:17:40 2010
@@ -604,7 +604,8 @@ public class BeanParamWriter extends Par
             else if (attribs[i].isArray())
             {
                 arrayCount++;
-                
+                String containedTypeArrayName = null;
+
                 if (attribs[i].isSimpleType() || attribs[i].getType().isSimpleType())
                 {
                     String baseTypeName = null;
@@ -612,6 +613,8 @@ public class BeanParamWriter extends Par
                         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 @@ public class BeanParamWriter extends Par
                     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 @@ public class BeanParamWriter extends Par
             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 @@ public class BeanParamWriter extends Par
                     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 @@ public class BeanParamWriter extends Par
                 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");     
             }
         }
         

Modified: axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ClientStubHeaderWriter.java
URL: http://svn.apache.org/viewvc/axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ClientStubHeaderWriter.java?rev=923963&r1=923962&r2=923963&view=diff
==============================================================================
--- axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ClientStubHeaderWriter.java (original)
+++ axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ClientStubHeaderWriter.java Tue Mar 16 20:17:40 2010
@@ -115,10 +115,10 @@ public class ClientStubHeaderWriter exte
                     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 @@ public class ClientStubHeaderWriter exte
                     .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

Modified: axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ParmHeaderFileWriter.java
URL: http://svn.apache.org/viewvc/axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ParmHeaderFileWriter.java?rev=923963&r1=923962&r2=923963&view=diff
==============================================================================
--- axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ParmHeaderFileWriter.java (original)
+++ axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ParmHeaderFileWriter.java Tue Mar 16 20:17:40 2010
@@ -150,13 +150,15 @@ public class ParmHeaderFileWriter extend
                     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 @@ public class ParmHeaderFileWriter extend
             } 
             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 @@ public class ParmHeaderFileWriter extend
             } 
             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 @@ public class ParmHeaderFileWriter extend
                 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);
                 }

Modified: axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/ClientStubHeaderWriter.java
URL: http://svn.apache.org/viewvc/axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/ClientStubHeaderWriter.java?rev=923963&r1=923962&r2=923963&view=diff
==============================================================================
--- axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/ClientStubHeaderWriter.java (original)
+++ axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/ClientStubHeaderWriter.java Tue Mar 16 20:17:40 2010
@@ -78,10 +78,10 @@ public class ClientStubHeaderWriter
                     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 @@ public class ClientStubHeaderWriter
                     
                     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 @@ public class ClientStubHeaderWriter
                 
                 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());
             }

Modified: axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/ClientStubWriter.java
URL: http://svn.apache.org/viewvc/axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/ClientStubWriter.java?rev=923963&r1=923962&r2=923963&view=diff
==============================================================================
--- axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/ClientStubWriter.java (original)
+++ axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/ClientStubWriter.java Tue Mar 16 20:17:40 2010
@@ -83,7 +83,7 @@ public class ClientStubWriter
                 else
                 {
                     returntypeissimple = CUtils.isSimpleType (outparamType);
-                    returntypeisarray = (outparamType.lastIndexOf ("_Array") > 0);
+                    returntypeisarray  = CUtils.isArrayType(outparamType);
                 }
             
                 returntypeisarray |= retType.isArray();
@@ -127,7 +127,6 @@ public class ClientStubWriter
         }
 
         c_writer.write(" " + methodName + "(AXISCHANDLE stub");
-        
         ArrayList paramsB = (ArrayList) params;
         ParameterInfo paramtype = null;
         if (0 < paramsB.size ())
@@ -150,7 +149,7 @@ public class ClientStubWriter
                     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 @@ public class ClientStubWriter
                         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 @@ public class ClientStubWriter
         //=============================================================================        
         
         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 @@ public class ClientStubWriter
                     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 @@ public class ClientStubWriter
                     else
                     {
                         currentParaType = CUtils.getClassNameFromParamInfoConsideringArrays(currentType, wscontext);
-                        typeisarray = (currentParaType.lastIndexOf("_Array") > 0);
+                        typeisarray = CUtils.isArrayType(currentParaType);
                     }
                     
                     typeisarray |= type.isArray ();
@@ -669,6 +666,7 @@ public class ClientStubWriter
                         qname = type.getName ();
                     
                     String containedType = null;
+                    String containedTypeArrayName = null;
 
                     if (CUtils.isSimpleType(qname))
                     {
@@ -681,13 +679,15 @@ public class ClientStubWriter
                     }
                     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 @@ public class ClientStubWriter
                         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 @@ public class ClientStubWriter
                 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

Modified: axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/BeanParamWriter.java
URL: http://svn.apache.org/viewvc/axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/BeanParamWriter.java?rev=923963&r1=923962&r2=923963&view=diff
==============================================================================
--- axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/BeanParamWriter.java (original)
+++ axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/BeanParamWriter.java Tue Mar 16 20:17:40 2010
@@ -830,7 +830,8 @@ public class BeanParamWriter extends Par
             else if (attribs[i].isArray())
             {
                 arrayCount++;
-                
+                String containedTypeArrayName = null;
+
                 if (attribs[i].isSimpleType() || attribs[i].getType().isSimpleType())
                 {
                     String baseTypeName = null;
@@ -839,20 +840,24 @@ public class BeanParamWriter extends Par
                     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 @@ public class BeanParamWriter extends Par
                 {    
                     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

Modified: axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubHeaderWriter.java
URL: http://svn.apache.org/viewvc/axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubHeaderWriter.java?rev=923963&r1=923962&r2=923963&view=diff
==============================================================================
--- axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubHeaderWriter.java (original)
+++ axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubHeaderWriter.java Tue Mar 16 20:17:40 2010
@@ -122,10 +122,10 @@ public class ClientStubHeaderWriter exte
                     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 @@ public class ClientStubHeaderWriter exte
                 {
                     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 @@ public class ClientStubHeaderWriter exte
                     typeSet.add(typeName);
           
                 if (atype.isRestriction())
-                    removeSet.add(atype.getLanguageSpecificName()  + "_Array");                
+                    removeSet.add(CUtils.getArrayNameForType(atype.getLanguageSpecificName()));                
             }
             
             Iterator ritr = removeSet.iterator();

Modified: axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubWriter.java
URL: http://svn.apache.org/viewvc/axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubWriter.java?rev=923963&r1=923962&r2=923963&view=diff
==============================================================================
--- axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubWriter.java (original)
+++ axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubWriter.java Tue Mar 16 20:17:40 2010
@@ -216,7 +216,7 @@ public class ClientStubWriter extends CP
                 else
                 {
                     returntypeissimple = CUtils.isSimpleType (outparamType);
-                    returntypeisarray = (outparamType.lastIndexOf ("_Array") > 0);
+                    returntypeisarray = CUtils.isArrayType(outparamType);
                 }
             
                 returntypeisarray |= retType.isArray();
@@ -506,7 +506,10 @@ public class ClientStubWriter extends CP
                 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 @@ public class ClientStubWriter extends CP
                     }
                     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 @@ public class ClientStubWriter extends CP
                         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 @@ public class ClientStubWriter extends CP
         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 @@ public class ClientStubWriter extends CP
             }
             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

Modified: axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ParmHeaderFileWriter.java
URL: http://svn.apache.org/viewvc/axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ParmHeaderFileWriter.java?rev=923963&r1=923962&r2=923963&view=diff
==============================================================================
--- axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ParmHeaderFileWriter.java (original)
+++ axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ParmHeaderFileWriter.java Tue Mar 16 20:17:40 2010
@@ -201,13 +201,15 @@ public class ParmHeaderFileWriter extend
                     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 @@ public class ParmHeaderFileWriter extend
             } 
             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 @@ public class ParmHeaderFileWriter extend
             } 
             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 @@ public class ParmHeaderFileWriter extend
                 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);
                 }

Modified: axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ServiceHeaderWriter.java
URL: http://svn.apache.org/viewvc/axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ServiceHeaderWriter.java?rev=923963&r1=923962&r2=923963&view=diff
==============================================================================
--- axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ServiceHeaderWriter.java (original)
+++ axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ServiceHeaderWriter.java Tue Mar 16 20:17:40 2010
@@ -136,10 +136,10 @@ public class ServiceHeaderWriter extends
                         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 @@ public class ServiceHeaderWriter extends
                     	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 @@ public class ServiceHeaderWriter extends
                     	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 @@ public class ServiceHeaderWriter extends
                     typeSet.add(typeName);
                    
                 if (atype.isRestriction())
-                    removeSet.add(atype.getLanguageSpecificName()  + "_Array");
+                    removeSet.add(CUtils.getArrayNameForType(atype.getLanguageSpecificName()));
             }
             
             Iterator ritr = removeSet.iterator();

Modified: axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ServiceWriter.java
URL: http://svn.apache.org/viewvc/axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ServiceWriter.java?rev=923963&r1=923962&r2=923963&view=diff
==============================================================================
--- axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ServiceWriter.java (original)
+++ axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ServiceWriter.java Tue Mar 16 20:17:40 2010
@@ -156,9 +156,10 @@ public class ServiceWriter extends CPPCl
                                 .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 @@ public class ServiceWriter extends CPPCl
                     	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 @@ public class ServiceWriter extends CPPCl
                     	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(
     	                        ","

Modified: axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/WrapWriter.java
URL: http://svn.apache.org/viewvc/axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/WrapWriter.java?rev=923963&r1=923962&r2=923963&view=diff
==============================================================================
--- axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/WrapWriter.java (original)
+++ axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/WrapWriter.java Tue Mar 16 20:17:40 2010
@@ -413,8 +413,10 @@ public class WrapWriter extends CPPClass
                     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 @@ public class WrapWriter extends CPPClass
                     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 @@ public class WrapWriter extends CPPClass
         	/* 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))))
         	{

Modified: axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubHeaderWriter.java
URL: http://svn.apache.org/viewvc/axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubHeaderWriter.java?rev=923963&r1=923962&r2=923963&view=diff
==============================================================================
--- axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubHeaderWriter.java (original)
+++ axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubHeaderWriter.java Tue Mar 16 20:17:40 2010
@@ -72,10 +72,10 @@ public class ClientStubHeaderWriter
                     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 @@ public class ClientStubHeaderWriter
                     
                     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 @@ public class ClientStubHeaderWriter
                 
                 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());
             }

Modified: axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubWriter.java
URL: http://svn.apache.org/viewvc/axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubWriter.java?rev=923963&r1=923962&r2=923963&view=diff
==============================================================================
--- axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubWriter.java (original)
+++ axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubWriter.java Tue Mar 16 20:17:40 2010
@@ -102,7 +102,7 @@ public class ClientStubWriter
                 else
                 {
                     returntypeissimple = CUtils.isSimpleType (outparamType);
-                    returntypeisarray = (outparamType.lastIndexOf ("_Array") > 0);
+                    returntypeisarray = CUtils.isArrayType(outparamType);
                 }
             
                 returntypeisarray |= retType.isArray();
@@ -158,7 +158,7 @@ public class ClientStubWriter
                     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 @@ public class ClientStubWriter
                         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 @@ public class ClientStubWriter
                     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 @@ public class ClientStubWriter
                     else
                     {
                         currentParaType = CUtils.getClassNameFromParamInfoConsideringArrays(currentType, wscontext);
-                        typeisarray = (currentParaType.lastIndexOf("_Array") > 0);
+                        typeisarray = CUtils.isArrayType(currentParaType);
                     }
                     
                     typeisarray |= type.isArray ();
@@ -660,6 +660,7 @@ public class ClientStubWriter
                         qname = type.getName ();
                     
                     String containedType = null;
+                    String containedTypeArrayName = null;
                     
                     if (CUtils.isSimpleType (qname))
                     {
@@ -680,11 +681,13 @@ public class ClientStubWriter
                     }
                     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 @@ public class ClientStubWriter
                         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 @@ public class ClientStubWriter
                 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 @@ public class ClientStubWriter
             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

Modified: axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ServiceHeaderWriter.java
URL: http://svn.apache.org/viewvc/axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ServiceHeaderWriter.java?rev=923963&r1=923962&r2=923963&view=diff
==============================================================================
--- axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ServiceHeaderWriter.java (original)
+++ axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ServiceHeaderWriter.java Tue Mar 16 20:17:40 2010
@@ -104,7 +104,7 @@ public class ServiceHeaderWriter
                 typeSet.add(atype.getLanguageSpecificName());
                 
                 if (atype.isRestriction())
-                    removeSet.add(atype.getLanguageSpecificName()  + "_Array");                
+                    removeSet.add(CUtils.getArrayNameForType(atype.getLanguageSpecificName()));                
             }
             
             Iterator ritr = removeSet.iterator();

Modified: axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/WrapWriter.java
URL: http://svn.apache.org/viewvc/axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/WrapWriter.java?rev=923963&r1=923962&r2=923963&view=diff
==============================================================================
--- axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/WrapWriter.java (original)
+++ axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/WrapWriter.java Tue Mar 16 20:17:40 2010
@@ -176,9 +176,10 @@ public class WrapWriter extends org.apac
                 //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 @@ public class WrapWriter extends org.apac
                 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 @@ public class WrapWriter extends org.apac
             /* 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 

Modified: axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/WSDLInfo.java
URL: http://svn.apache.org/viewvc/axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/WSDLInfo.java?rev=923963&r1=923962&r2=923963&view=diff
==============================================================================
--- axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/WSDLInfo.java (original)
+++ axis/axis1/c/trunk/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/WSDLInfo.java Tue Mar 16 20:17:40 2010
@@ -112,6 +112,7 @@ public class WSDLInfo
     // 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 @@ public class WSDLInfo
             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 @@ public class WSDLInfo
             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 @@ public class WSDLInfo
         }
         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 @@ public class WSDLInfo
             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



Mime
View raw message