axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nadira...@apache.org
Subject svn commit: r503560 [1/2] - in /webservices/axis/trunk/c: src/wsdl/org/apache/axis/wsdl/symbolTable/ src/wsdl/org/apache/axis/wsdl/wsdl2ws/ src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/ src/wsdl/org/apache/ax...
Date Mon, 05 Feb 2007 05:54:43 GMT
Author: nadiramra
Date: Sun Feb  4 21:54:41 2007
New Revision: 503560

URL: http://svn.apache.org/viewvc?view=rev&rev=503560
Log:
AXISCPP-796 "_string" instead of "string".

Modified:
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/symbolTable/CContainedAttribute.java
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/CUtils.java
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/ParamWriter.java
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/WSDL2Ws.java
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/AllParamWriter.java
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/BeanParamWriter.java
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ClientStubWriter.java
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ParmHeaderFileWriter.java
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/ClientStubWriter.java
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/AllParamWriter.java
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/BeanParamWriter.java
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubWriter.java
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ParamCPPFileWriter.java
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ParmHeaderFileWriter.java
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/WrapWriter.java
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubWriter.java
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/WrapWriter.java
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/AttributeInfo.java
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/ParameterInfo.java
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/Type.java
    webservices/axis/trunk/c/tests/auto_build/testcases/output/CombinedAll_ServerResponse.expected
    webservices/axis/trunk/c/tests/auto_build/testcases/output/CombinedChoice_ServerResponse.expected
    webservices/axis/trunk/c/tests/auto_build/testcases/output/UnboundedChoice_ServerResponse.expected
    webservices/axis/trunk/c/tests/auto_build/testcases/output/UnboundedStringChoice_ServerResponse.expected

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/symbolTable/CContainedAttribute.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/symbolTable/CContainedAttribute.java?view=diff&rev=503560&r1=503559&r2=503560
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/symbolTable/CContainedAttribute.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/symbolTable/CContainedAttribute.java Sun Feb  4 21:54:41 2007
@@ -47,8 +47,6 @@
         name = qname.getLocalPart();
         if (name.lastIndexOf(SymbolTable.ANON_TOKEN) > 1)
             name = name.substring(name.lastIndexOf(SymbolTable.ANON_TOKEN) + 1, name.length());
-        
-        name = CUtils.resolveWSDL2LanguageNameClashes(name);        
     }
 
     public final QName getQName() {

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/CUtils.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/CUtils.java?view=diff&rev=503560&r1=503559&r2=503560
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/CUtils.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/CUtils.java Sun Feb  4 21:54:41 2007
@@ -1000,7 +1000,7 @@
         {
             arrayName = qname.getLocalPart() + "_Array";
             if (TypeMap.isAnonymousType(qname))
-                arrayName = CUtils.sanitiseClassName(arrayName);
+                arrayName = CUtils.sanitizeString(arrayName);
         }
         return arrayName;        
     }
@@ -1096,12 +1096,12 @@
                 
                 if (TypeMap.isAnonymousType(typedataLocalpart))
                 {
-                    typedataQNameSanitized     = new QName(typedataQName.getNamespaceURI(), sanitiseClassName(typedataLocalpart));
-                    typedataLocalpartSanitized = sanitiseClassName(typedataLocalpart);
+                    typedataQNameSanitized     = new QName(typedataQName.getNamespaceURI(), sanitizeString(typedataLocalpart));
+                    typedataLocalpartSanitized = sanitizeString(typedataLocalpart);
                 }
                 
                 if (TypeMap.isAnonymousType(baseTypeLocalpart))
-                    baseTypeLocalpartSanitized = sanitiseClassName(baseTypeLocalpart);
+                    baseTypeLocalpartSanitized = sanitizeString(baseTypeLocalpart);
                 
                 String class4qname          = null;
                 String class4qnameSanitized = null;
@@ -1260,7 +1260,7 @@
         return;
     }    
     
-    public static String sanitiseClassName( String name)
+    public static String sanitizeString( String name)
     {
         int i;
         String sanitisedName=name;
@@ -1278,19 +1278,12 @@
         
         return sanitisedName;
     }
-    
-    // TODO - get rid of this and jsut call above routine directly.
-    public static String sanitiseAttributeName(String name)
-    {
-        String sanitisedName = sanitiseClassName( name);
-        return sanitisedName;
-    }
 
-    public static boolean classExists(WebServiceContext wscontext, String name)
+    public static boolean classExists(TypeMap typeMap, String name)
     {   
         Type atype;
         String atypeName;
-        Iterator types = wscontext.getTypemap().getTypes().iterator();
+        Iterator types = typeMap.getTypes().iterator();
         while (types.hasNext())
         {
             atype = (Type) types.next();
@@ -1326,7 +1319,7 @@
         // If name was not in hash table, generate one, store in hash table.
         if (newName == null)
         {            
-            newName = sanitiseClassName(oldName);
+            newName = sanitizeString(oldName);
             
             // Ensure name does not conflict with language constructs
             newName = resolveWSDL2LanguageNameClashes(newName);

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/ParamWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/ParamWriter.java?view=diff&rev=503560&r1=503559&r2=503560
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/ParamWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/ParamWriter.java Sun Feb  4 21:54:41 2007
@@ -99,7 +99,7 @@
         if (elemi != null)
         {
             extensionBaseAttrib = new AttributeInfo(this.classname);
-            extensionBaseAttrib.setParamName(elemi.getName().getLocalPart());
+            extensionBaseAttrib.setParamName(elemi.getName().getLocalPart(), wscontext.getTypemap());
             
             Type elementType = elemi.getType();
 
@@ -138,7 +138,7 @@
             CContainedAttribute attr = (CContainedAttribute)attribfeilds.get(i);
             
             this.attribs[i] = new AttributeInfo(this.classname);
-            this.attribs[i].setParamName(attr.getName());
+            this.attribs[i].setParamName(attr.getName(), wscontext.getTypemap());
             if (CUtils.isSimpleType(attr.getType().getName()))
                 this.attribs[i].setTypeName(CUtils.getclass4qname(attr.getType().getName()));
             else
@@ -155,7 +155,7 @@
         for (int i = intAttrFieldSz; i < intAttrFieldSz + intEleFieldSz; i++)
         {
             this.attribs[i] = new AttributeInfo(this.classname);
-            this.attribs[i].setParamName((String) elementfeilds.get(i - attributeParamCount));
+            this.attribs[i].setParamName((String) elementfeilds.get(i - attributeParamCount), wscontext.getTypemap());
             ElementInfo elem = type.getElementForElementName(this.attribs[i].getParamName());
             Type elementType = elem.getType();
             if (CUtils.isAnyType(elementType.getName()))

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/WSDL2Ws.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/WSDL2Ws.java?view=diff&rev=503560&r1=503559&r2=503560
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/WSDL2Ws.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/WSDL2Ws.java Sun Feb  4 21:54:41 2007
@@ -363,7 +363,9 @@
             { 
                 // for non-wrapped style wsdl's
                 String elementName = (String) element.getQName().getLocalPart();
-                pinfo = new ParameterInfo(type, elementName);
+                pinfo = new ParameterInfo();
+                pinfo.setType(type);
+                pinfo.setParamName(elementName, typeMap);
                 pinfo.setElementName(type.getName());
                 if (type.getName().equals(CUtils.anyTypeQname))
                     pinfo.setAnyType(true);
@@ -394,7 +396,9 @@
             eleinfo = type.getElementForElementName(elementname);
             innerType = eleinfo.getType();
             
-            pinfo = new ParameterInfo(innerType, elementname);
+            pinfo = new ParameterInfo();
+            pinfo.setType(innerType);
+            pinfo.setParamName(elementname, typeMap);
             
             if (eleinfo.getMaxOccurs() > 1)
                 pinfo.setArray(true);
@@ -515,7 +519,11 @@
                 { 
                     // for non-wrapped style wsdl's
                     String elementName = (String) element.getQName().getLocalPart();
-                    pinfo = new ParameterInfo(type, elementName);
+                    
+                    pinfo = new ParameterInfo();
+                    
+                    pinfo.setType(type);
+                    pinfo.setParamName(elementName, typeMap);
                     pinfo.setElementName(type.getName());
                     if (type.getName().equals(CUtils.anyTypeQname))
                         pinfo.setAnyType(true);
@@ -540,8 +548,10 @@
         {
             CContainedAttribute attr = (CContainedAttribute)attributes.next();
 
-            ParameterInfo pinfo = new ParameterInfo(attr.getType(), attr.getName());
-            
+            ParameterInfo pinfo = new ParameterInfo();
+
+            pinfo.setType(attr.getType());
+            pinfo.setParamName(attr.getName(), typeMap);
             pinfo.setElementName(attr.getType().getName());
             pinfo.setAttribute(true);
             
@@ -570,7 +580,9 @@
             eleinfo = type.getElementForElementName(elementname);
             Type innerType = eleinfo.getType();
             
-            pinfo = new ParameterInfo(innerType, elementname);
+            pinfo = new ParameterInfo();
+            pinfo.setType(innerType);
+            pinfo.setParamName(elementname, typeMap);            
             
             if (eleinfo.getMaxOccurs() > 1)
                 pinfo.setArray(true);
@@ -1024,9 +1036,12 @@
         Type type = this.typeMap.getType(qname);
         if (type == null)
             throw new WrapperFault("unregistered type " + qname + " referred");
-        ParameterInfo parainfo = new ParameterInfo(type, part.getName());
-        parainfo.setElementName(part.getElementName());
-        return parainfo;
+        
+        ParameterInfo pinfo = new ParameterInfo();
+        pinfo.setType(type);
+        pinfo.setParamName(part.getName(), typeMap);
+        pinfo.setElementName(part.getElementName());
+        return pinfo;
     }
 
     private MethodInfo getMethodInfoByName(String name) throws WrapperFault

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/AllParamWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/AllParamWriter.java?view=diff&rev=503560&r1=503559&r2=503560
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/AllParamWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/AllParamWriter.java Sun Feb  4 21:54:41 2007
@@ -79,7 +79,7 @@
                     if (elementType != null)
                     {
                         if (TypeMap.isAnonymousType(elementType))
-                            elementType = CUtils.sanitiseClassName(elementType);
+                            elementType = CUtils.sanitizeString(elementType);
                         
                         if (WSDL2Ws.verbose)
                             System.out.println("    Array element type " 

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/BeanParamWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/BeanParamWriter.java?view=diff&rev=503560&r1=503559&r2=503560
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/BeanParamWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/BeanParamWriter.java Sun Feb  4 21:54:41 2007
@@ -53,8 +53,6 @@
     {
         try
         {
-            // Ensure writeSerializeGlobalMethod() is first since it ensure attribute name does not conflict with
-            // existing classes
             writeSerializeGlobalMethod();
             writeDeSerializeGlobalMethod();
             writeCreateGlobalMethod();
@@ -149,54 +147,36 @@
 
         writer.write("\t/* If there are any attributes serialize them. If there aren't then close the tag */\n");
         for (int i = 0; i < attributeParamCount; i++)
-        {
-            // Ensure field name is valid and does not cause conflict with class names
-            String sanitizedAttrName = CUtils.sanitiseAttributeName(attribs[i].getParamName());
-            if (CUtils.classExists(wscontext, sanitizedAttrName))
-                sanitizedAttrName += "_Ref";
-            attribs[i].setParamName(sanitizedAttrName);
-            
+        {            
             if (attribs[i].isArray() || !(attribs[i].isSimpleType() || attribs[i].getType().isSimpleType()))
-            {
                 throw new WrapperFault("Error : an attribute is not basic type");
+            
+            Type type = attribs[i].getType();
+            String basicType = null;
+            
+            if (!attribs[i].isSimpleType() && type.isSimpleType())
+                basicType = CUtils.getclass4qname(type.getBaseType());
+            else
+                basicType = attribs[i].getTypeName();
+            
+            if (attribs[i].isOptional())
+                writer.write("\tif (0 != param->" + attribs[i].getParamNameAsMember() + ")\n");
+
+            if (CUtils.isPointerType(basicType) || attribs[i].isOptional())
+            {
+                writer.write("\t\taxiscSoapSerializerSerializeAsAttribute(pSZ,\""
+                        + attribs[i].getParamNameAsSOAPString() + "\", 0, (void*)(param->"
+                        + attribs[i].getParamNameAsMember() + "), "
+                        + CUtils.getXSDTypeForBasicType(basicType) + ");\n");
             }
             else
             {
-                //remove _Ref sufix and _ prefix in SOAP tag name
-                String soapTagName = attribs[i].getParamName();
-                if (soapTagName.lastIndexOf("_Ref") > -1)
-                    soapTagName = soapTagName.substring(0, soapTagName.lastIndexOf("_Ref"));
-                
-                if (soapTagName.charAt(0) == '_')
-                    soapTagName = soapTagName.substring(1, soapTagName.length());
-
-                Type type = attribs[i].getType();
-                String basicType = null;
-                
-                if (!attribs[i].isSimpleType() && type.isSimpleType())
-                    basicType = CUtils.getclass4qname(type.getBaseType());
-                else
-                    basicType = attribs[i].getTypeName();
-                
-                if (attribs[i].isOptional())
-                    writer.write("\tif (0 != param->" + attribs[i].getParamNameAsMember() + ")\n");
-
-                if (CUtils.isPointerType(basicType) || attribs[i].isOptional())
-                {
-                    writer.write("\t\taxiscSoapSerializerSerializeAsAttribute(pSZ,\""
-                            + soapTagName + "\", 0, (void*)(param->"
-                            + attribs[i].getParamNameAsMember() + "), "
-                            + CUtils.getXSDTypeForBasicType(basicType) + ");\n");
-                }
-                else
-                {
-                    writer.write("\taxiscSoapSerializerSerializeAsAttribute(pSZ,\""
-                            + soapTagName
-                            + "\", 0, (void*)&(param->"
-                            + attribs[i].getParamNameAsMember()
-                            + "), "
-                            + CUtils.getXSDTypeForBasicType(attribs[i].getTypeName()) + ");\n");
-                }
+                writer.write("\taxiscSoapSerializerSerializeAsAttribute(pSZ,\""
+                        + attribs[i].getParamNameAsSOAPString()
+                        + "\", 0, (void*)&(param->"
+                        + attribs[i].getParamNameAsMember()
+                        + "), "
+                        + CUtils.getXSDTypeForBasicType(attribs[i].getTypeName()) + ");\n");
             }
         }
 
@@ -236,12 +216,6 @@
         
         for (int i = attributeParamCount; i < attribs.length; i++)
         {
-            // Ensure field name is valid and does not cause conflict with class names
-            String sanitizedAttrName = CUtils.sanitiseAttributeName(attribs[i].getParamName());
-            if (CUtils.classExists(wscontext, sanitizedAttrName))
-                sanitizedAttrName += "_Ref";
-            attribs[i].setParamName(sanitizedAttrName);
-
             String namespace = "NULL";
             if (attribs[i].getNsQualified())
                 namespace = "Axis_URI_" + classname;
@@ -284,10 +258,10 @@
                     else
                         baseTypeName = attribs[i].getTypeName();
                     
-                    writer.write("\taxiscSoapSerializerSerializeBasicArray(pSZ, (const Axisc_Array *)param->" + attribs[i].getParamName()
+                    writer.write("\taxiscSoapSerializerSerializeBasicArray(pSZ, (const Axisc_Array *)param->" + attribs[i].getParamNameAsMember()
                         + ", " + namespace + ","
                         + CUtils.getXSDTypeForBasicType(baseTypeName) + ", \""
-                        + attribs[i].getParamNameAsSOAPElement() + "\");\n");
+                        + attribs[i].getParamNameAsSOAPString() + "\");\n");
                 }
                 else
                 {
@@ -299,11 +273,10 @@
                         namespace = "NULL";
                     
                     writer.write("\taxiscSoapSerializerSerializeCmplxArray(pSZ, (const Axisc_Array *)param->"
-                                    + attribs[i].getParamNameAsMember() + ",\n");
-                    writer.write("\t\t\t\t\t\t (void*) Axis_Serialize_" + arrayType + ",\n");
-                    writer.write("\t\t\t\t\t\t (void*) Axis_Delete_" + arrayType + ",\n");
-                    writer.write("\t\t\t\t\t\t \""
-                            + attribs[i].getElementNameAsString() + "\", " + namespace + ");\n");
+                            + attribs[i].getParamNameAsMember() 
+                            + ", (void*)Axis_Serialize_" + arrayType 
+                            + ", (void*)Axis_Delete_" + arrayType 
+                            + ", \"" + attribs[i].getElementNameAsSOAPString() + "\", " + namespace + ");\n");
                 }
             }
             else if (attribs[i].isSimpleType() || attribs[i].getType().isSimpleType())
@@ -316,14 +289,14 @@
                     baseTypeName = typeName;
                 
                 if (attribs[i].isOptional())
-                    writer.write("\tif (param->" + attribs[i].getParamNameWithoutSymbols() + " != NULL)\n\t\t{\n\t");
+                    writer.write("\tif (param->" + attribs[i].getParamNameAsMember() + " != NULL)\n\t\t{\n\t");
                 
                 if (CUtils.isPointerType(baseTypeName))
                 {
                     writer.write("\taxiscSoapSerializerSerializeAsElement(pSZ, \""
-                            + attribs[i].getSOAPElementNameAsString()
+                            + attribs[i].getElementNameAsSOAPString()
                             + "\", " + namespace
-                            + ", (void*)(param->" + attribs[i].getParamNameWithoutSymbols() + "), "
+                            + ", (void*)(param->" + attribs[i].getParamNameAsMember() + "), "
                             + CUtils.getXSDTypeForBasicType(baseTypeName) + ");\n");
                 }
                 else if (attribs[i].getChoiceElement()
@@ -339,23 +312,23 @@
                             && !(CUtils.isPointerType(attribs[i].getTypeName())) )
                     {
                         writer.write("\t\taxiscSoapSerializerSerializeAsElement(pSZ, \""
-                                + attribs[i].getSOAPElementNameAsString() + "\", " + namespace
-                                + ", (void*)(*(param->" + attribs[i].getParamNameWithoutSymbols()
+                                + attribs[i].getElementNameAsSOAPString() + "\", " + namespace
+                                + ", (void*)(*(param->" + attribs[i].getParamNameAsMember()
                                 + ")), " + CUtils.getXSDTypeForBasicType(baseTypeName) + ");\n");
                     }
                     else
                     {
                         writer.write("\t\taxiscSoapSerializerSerializeAsElement(pSZ, \""
-                                + attribs[i].getSOAPElementNameAsString() + "\", " + namespace
-                                + ", (void*)(param->" + attribs[i].getParamNameWithoutSymbols()
+                                + attribs[i].getElementNameAsSOAPString() + "\", " + namespace
+                                + ", (void*)(param->" + attribs[i].getParamNameAsMember()
                                 + "), " + CUtils.getXSDTypeForBasicType(baseTypeName) + ");\n");
                     }    
                 }                           
                 else
                 {
                     writer.write("\taxiscSoapSerializerSerializeAsElement(pSZ, \""
-                            + attribs[i].getSOAPElementNameAsString() + "\", " + namespace
-                            + ", (void*)&(param->" + attribs[i].getParamNameWithoutSymbols()
+                            + attribs[i].getElementNameAsSOAPString() + "\", " + namespace
+                            + ", (void*)&(param->" + attribs[i].getParamNameAsMember()
                             + "), " + CUtils.getXSDTypeForBasicType(baseTypeName) + ");\n");
                 }
                 
@@ -365,18 +338,13 @@
             else
             {
                 //if complex type
-                String elm = attribs[i].getParamName();
-                if (elm.lastIndexOf("_Ref") > -1)
-                    elm = elm.substring(0, elm.lastIndexOf("_Ref"));
+                String elm = attribs[i].getParamNameAsSOAPString();
 
-                if (elm.charAt(0) == '_')
-                    elm = elm.substring(1, elm.length());
-                
                 if (attribs[i].isReference())
                     elm = attribs[i].getTypeName();
                 
                 if (attribs[i].isOptional())
-                    writer.write("\tif (param->" + attribs[i].getParamName() + " != NULL)\n\t{\n");
+                    writer.write("\tif (param->" + attribs[i].getParamNameAsMember() + " != NULL)\n\t{\n");
                 
                 if (attribs[i].getNsQualified())
                 {
@@ -384,7 +352,7 @@
                                     + type.getName().getNamespaceURI()
                                     + "\", NULL), \":\", \"" + elm + "\", 0);\n");
                     writer.write("\tAxis_Serialize_" + attribs[i].getTypeName()
-                            + "(param->" + attribs[i].getParamName() + ", pSZ, 0);\n");
+                            + "(param->" + attribs[i].getParamNameAsMember() + ", pSZ, 0);\n");
                     writer.write("\taxiscSoapSerializerSerialize(pSZ, \"</\", axiscSoapSerializerGetNamespacePrefix(pSZ, \""
                                     + type.getName().getNamespaceURI()
                                     + "\", NULL), \":\", \"" + elm + "\", \">\", 0);\n");
@@ -393,7 +361,7 @@
                 {
                     writer.write("\taxiscSoapSerializerSerialize(pSZ, \"<" + elm + "\", 0);\n");
                     writer.write("\tAxis_Serialize_" + attribs[i].getTypeName()
-                            + "(param->" + attribs[i].getParamName() + ", pSZ, 0);\n");
+                            + "(param->" + attribs[i].getParamNameAsMember() + ", pSZ, 0);\n");
                     writer.write("\taxiscSoapSerializerSerialize(pSZ, \"</" + elm + "\", \">\", 0);\n");
                 }
                 
@@ -422,10 +390,11 @@
         }
         
         writer.write("\n\tif (!bArray && blnIsNewPrefix)\n");
-        writer.write("\t\taxiscSoapSerializerRemoveNamespacePrefix(pSZ, Axis_URI_" + classname + ");\n\n");
+        writer.write("\t\taxiscSoapSerializerRemoveNamespacePrefix(pSZ, Axis_URI_" + classname + ");\n");
+        writer.write("\n");
         
         writer.write("\treturn AXISC_SUCCESS;\n");
-        writer.write("}\n");
+        writer.write("}\n\n");
     }
 
     /**
@@ -436,10 +405,9 @@
         // For doc/literal objects
         writer.write("\tif (!bArray)\n\t{\n");
         writer.write("\t\tconst AxiscChar* sPrefix = axiscSoapSerializerGetNamespacePrefix(pSZ,Axis_URI_" + classname + ", &blnIsNewPrefix);\n");
-        writer.write("\t\tif (blnIsNewPrefix)\n\t\t{\n");
-        writer.write("\t\t\taxiscSoapSerializerSerialize(pSZ,\" xmlns:\", sPrefix, \"=\\\"\",\n");
-        writer.write("\t\t\t\tAxis_URI_" + classname + ", \"\\\"\", NULL );\n");
-        writer.write("\t\t}\n");
+        writer.write("\t\tif (blnIsNewPrefix)\n");
+        writer.write("\t\t\taxiscSoapSerializerSerialize(pSZ,\" xmlns:\", sPrefix, \"=\\\"\", " 
+                        + "Axis_URI_" + classname + ", \"\\\"\", NULL);\n");
         writer.write("\t}\n\n");
     }
 
@@ -453,36 +421,19 @@
         writer.write( "\t\taxiscSoapSerializerSerialize(pSZ, \"<\", Axis_TypeName_" + classname + ", \">\", NULL);\n");
         writer.write( "\telse\n");
         writer.write( "\t{\n");
-        writer.write( "\t\tconst AxiscChar * sPrefix = axiscSoapSerializerGetNamespacePrefix(pSZ, Axis_URI_" + classname + ",\n" +
-                      "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t&blnIsNewPrefix);\n\n");
-        writer.write( "// If there are objects that require a local namespace, then define it here.\n");
-        writer.write( "// NB: This namespace will go out of scope when the closing tag is reached.\n");
+        writer.write( "\t\tconst AxiscChar * sPrefix = axiscSoapSerializerGetNamespacePrefix(pSZ, Axis_URI_" 
+                + classname + ", &blnIsNewPrefix);\n\n");
+        writer.write( "\t\t// If there are objects that require a local namespace, then define it here.\n");
+        writer.write( "\t\t// NB: This namespace will go out of scope when the closing tag is reached.\n");
         writer.write( "\t\tif( !blnIsNewPrefix)\n");
-        writer.write( "\t\t{\n");
-        writer.write( "\t\t\taxiscSoapSerializerSerialize(pSZ, \"<\",\n\t\t\t\t\t\t\tAxis_TypeName_" + classname + ",\n" +
-                      "\t\t\t\t\t\t\t\" xsi:type=\\\"\",\n" +
-                      "\t\t\t\t\t\t\tsPrefix,\n" +
-                      "\t\t\t\t\t\t\t\":\",\n" +
-                      "\t\t\t\t\t\t\t");
-        writer.write( "Axis_TypeName_" + classname + ",\n" +
-                      "\t\t\t\t\t\t\t\"\\\">\",\n" +
-                      "\t\t\t\t\t\t\tNULL);\n");
-        writer.write( "\t\t}\n");
+        writer.write( "\t\t\taxiscSoapSerializerSerialize(pSZ, \"<\", Axis_TypeName_" + classname + ", " 
+                    + "\" xsi:type=\\\"\", sPrefix, \":\", "
+                    + "Axis_TypeName_" + classname + ", \"\\\">\", NULL);\n");
         writer.write( "\t\telse\n");
-        writer.write( "\t\t{\n");
-        writer.write( "\t\t\taxiscSoapSerializerSerialize(pSZ, \"<\",\n" +
-                      "\t\t\t\t\t\t\tAxis_TypeName_" + classname + ",\n" +
-                      "\t\t\t\t\t\t\t\" xsi:type=\\\"\",\n" +
-                      "\t\t\t\t\t\t\tsPrefix,\n" +
-                      "\t\t\t\t\t\t\t\":\",\n" +
-                      "\t\t\t\t\t\t\tAxis_TypeName_" + classname + ",\n" +
-                      "\t\t\t\t\t\t\t\"\\\" xmlns:\",\n" +
-                      "\t\t\t\t\t\t\tsPrefix,\n" +
-                      "\t\t\t\t\t\t\t\"=\\\"\",\n" +
-                      "\t\t\t\t\t\t\tAxis_URI_" + classname + ",\n" +
-                      "\t\t\t\t\t\t\t\"\\\">\",\n" +
-                      "\t\t\t\t\t\t\tNULL);\n");
-        writer.write("\t\t}\n");
+        writer.write( "\t\t\taxiscSoapSerializerSerialize(pSZ, \"<\", Axis_TypeName_" + classname + ", " 
+                    + "\" xsi:type=\\\"\", sPrefix, \":\", " 
+                    + "Axis_TypeName_" + classname + ", \"\\\" xmlns:\", " 
+                    + "sPrefix, \"=\\\"\", Axis_URI_" + classname + ", \"\\\">\", NULL);\n");
         writer.write("\t}\n\n");
     }
 
@@ -545,6 +496,11 @@
         }  
 
         //=============================================================================
+        // Deserialize attributes.
+        // Makes logic simpler to follow with slight duplication. TODO
+        //=============================================================================        
+        
+        //=============================================================================
         // Deserialize attributes and elements.
         //=============================================================================        
         
@@ -577,7 +533,7 @@
                     writer.write("\telse if");
 
                 writer.write("(strcmp(choiceName,\""
-                        + attribs[i].getElementNameAsString() + "\")==0)\n\t{\n\t");
+                        + attribs[i].getElementNameAsSOAPString() + "\")==0)\n\t{\n\t");
             }
             
             //if the attribute is a 'all' construct we have to check Min
@@ -631,33 +587,23 @@
                             + " = (" + baseTypeName + "_Array *)" 
                             + "axiscSoapDeSerializerGetBasicArray(pDZ, " 
                             + CUtils.getXSDTypeForBasicType(baseTypeName) + ", \"" 
-                            + attribs[i].getParamNameAsSOAPElement() + "\",0);\n");
+                            + attribs[i].getParamNameAsSOAPString() + "\",0);\n");
 
                     writer.write("\n");
                 }
                 else
                 {
                     arrayType = attribs[i].getTypeName();
-                    writer.write("\taxiscSoapDeSerializerGetCmplxArray(pDZ,\n" 
-                            + "\t\t(Axisc_Array *)param->" + attribs[i].getParamName() + ",\n" 
-                            + "\t\t(void*)Axis_DeSerialize_"  + arrayType + ",\n"
-                            + "\t\t(void*)Axis_Create_"       + arrayType + ",\n"
-                            + "\t\t(void*)Axis_Delete_"       + arrayType + ",\n"
-                            + "\t\t\""  + attribs[i].getElementNameAsString() + "\",\n"  
-                            + "\t\tAxis_URI_" + arrayType + ");\n");
-                    
-                    // TODO C-BINDING MEMORY MANAGEMENT?
+                    writer.write("\taxiscSoapDeSerializerGetCmplxArray(pDZ, (Axisc_Array *)param->" + attribs[i].getParamNameAsMember() 
+                            + ", (void*)Axis_DeSerialize_"  + arrayType 
+                            + ", (void*)Axis_Create_" + arrayType 
+                            + ", (void*)Axis_Delete_" + arrayType 
+                            + ", \""  + attribs[i].getElementNameAsSOAPString() + "\", Axis_URI_" + arrayType + ");\n");
                 }
             }
             else if ((attribs[i].isSimpleType() || attribs[i].getType().isSimpleType()))
             {                
-                //remove _Ref sufix and _ prefix in SOAP tag name
-                String soapTagName = (attribs[i].isAttribute() ? attribs[i].getParamName() : attribs[i].getElementNameAsString());
-                if (soapTagName.lastIndexOf("_Ref") > -1)
-                    soapTagName = soapTagName.substring(0, soapTagName.lastIndexOf("_Ref"));
-
-                if (soapTagName.charAt(0) == '_')
-                    soapTagName = soapTagName.substring(1, soapTagName.length());
+                String soapTagName = (attribs[i].isAttribute() ? attribs[i].getParamNameAsSOAPString() : attribs[i].getElementNameAsSOAPString());
                 
                 // We only peek for elements, not element attributes!
                 if (attribs[i].isOptional() && !attribs[i].isAttribute())
@@ -688,7 +634,7 @@
                 }                
                 else
                 {
-                    String elementNameToSearchFor = attribs[i].isAttribute()? attribs[i].getParamNameAsMember():attribs[i].getSOAPElementNameAsString();
+                    String elementNameToSearchFor = attribs[i].isAttribute()? attribs[i].getParamNameAsSOAPString():attribs[i].getElementNameAsSOAPString();
                     
                     writer.write("\t{\n");
                     writer.write("\t" + attribs[i].getTypeName() + " * "
@@ -698,7 +644,7 @@
                         + "(pDZ, \"" + elementNameToSearchFor + "\",0);\n");
                     
                     writer.write("\tif (" + attribs[i].getParamNameAsMember() + " != NULL)\n\t{\n");
-                    writer.write("\t\tparam->" + attribs[i].getParamName() + " = *"
+                    writer.write("\t\tparam->" + attribs[i].getParamNameAsMember() + " = *"
                             + attribs[i].getParamNameAsMember() + ";\n");
 
                     if (CUtils.getXSDTypeForBasicType( attribs[i].getTypeName()).equals("XSDC_HEXBINARY")
@@ -724,17 +670,9 @@
             }
             else
             {
-                writer.write("\n\t{\n"); // start new variable scope
-                
                 //if complex type
-                //remove _Ref sufix and _ prefix in SOAP tag name
-                String soapTagName = attribs[i].getParamName();
-
-                if (soapTagName.lastIndexOf("_Ref") > -1)
-                    soapTagName = soapTagName.substring(0, soapTagName.lastIndexOf("_Ref"));
-
-                if (soapTagName.charAt(0) == '_')
-                    soapTagName = soapTagName.substring(1, soapTagName.length());
+                String soapTagName = attribs[i].getParamNameAsSOAPString();
+                writer.write("\n\t{\n"); // start new variable scope
                 
                 if (attribs[i].isOptional())
                 {
@@ -745,12 +683,10 @@
 
                 writer.write("\tparam->" + attribs[i].getParamNameAsMember() 
                         + " = ("  + attribs[i].getTypeName()
-                        + "*)axiscSoapDeSerializerGetCmplxObject(pDZ,(void*)Axis_DeSerialize_"
-                        + attribs[i].getTypeName()
-                        + "\n\t\t, (void*)Axis_Create_"
-                        + attribs[i].getTypeName() + ", (void*)Axis_Delete_"
-                        + attribs[i].getTypeName() + "\n\t\t, \"" + soapTagName
-                        + "\", Axis_URI_" + attribs[i].getTypeName() + ");\n");
+                        + "*)axiscSoapDeSerializerGetCmplxObject(pDZ,(void*)Axis_DeSerialize_" + attribs[i].getTypeName()
+                        + ", (void*)Axis_Create_" + attribs[i].getTypeName() 
+                        + ", (void*)Axis_Delete_" + attribs[i].getTypeName() 
+                        + ", \"" + soapTagName + "\", Axis_URI_" + attribs[i].getTypeName() + ");\n");
                 
                 if (attribs[i].isOptional())
                 {
@@ -845,7 +781,7 @@
                 }
                 else
                 {
-                        writer.write("\t\tpTemp->" + attribs[i].getParamName() + " = "
+                        writer.write("\t\tpTemp->" + attribs[i].getParamNameAsMember() + " = "
                                 + "Axis_Create_" + attribs[i].getTypeName() + "_Array(0);\n");
                 }     
             }
@@ -948,9 +884,9 @@
                 if (attribs[i].isArray())
                     deleteFunctionSuffix = "_Array";
                 
-                writer.write("\t\tif (param->" + attribs[i].getParamName() + ")\n");
+                writer.write("\t\tif (param->" + attribs[i].getParamNameAsMember() + ")\n");
                 writer.write("\t\t\tAxis_Delete_" + attribs[i].getTypeName() + deleteFunctionSuffix 
-                            + "(param->" + attribs[i].getParamName() + ", 0);\n");  
+                            + "(param->" + attribs[i].getParamNameAsMember() + ", 0);\n");  
                     
             }
         }

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ClientStubWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ClientStubWriter.java?view=diff&rev=503560&r1=503559&r2=503560
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ClientStubWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ClientStubWriter.java Sun Feb  4 21:54:41 2007
@@ -369,7 +369,7 @@
                     writer.write("(Axisc_Array *)Value" + i + ", "
                             + CUtils.getXSDTypeForBasicType(containedType)
                             + ", \""
-                            + ((ParameterInfo) paramsB.get(i)).getParamName()
+                            + ((ParameterInfo) paramsB.get(i)).getParamNameAsSOAPString()
                             + "\"");
                 }
                 else
@@ -379,7 +379,7 @@
                     writer.write("(Axisc_Array *)Value" + i
                             + ",(void *) Axis_Serialize_" + containedType
                             + ",(void *) Axis_Delete_" + containedType
-                            + ",\"" + ((ParameterInfo) paramsB.get(i)).getParamName() + "\""
+                            + ",\"" + ((ParameterInfo) paramsB.get(i)).getParamNameAsSOAPString() + "\""
                             + ",Axis_URI_" + containedType);
                 }
             }
@@ -395,7 +395,7 @@
                             + i
                             + ", \""
                             + ((ParameterInfo) paramsB.get(i))
-                                    .getParamName() + "\", "
+                                    .getParamNameAsSOAPString() + "\", "
                             + CUtils.getXSDTypeForBasicType(paramTypeName));
                 }
                 else
@@ -405,7 +405,7 @@
                             + i
                             + ", \""
                             + ((ParameterInfo) paramsB.get(i))
-                                    .getParamName() + "\", "
+                                    .getParamNameAsSOAPString() + "\", "
                             + CUtils.getXSDTypeForBasicType(paramTypeName));
                 }
             }
@@ -416,7 +416,7 @@
                 writer.write("Value" + i + ",(void *) Axis_Serialize_"
                         + paramTypeName + ",(void *) Axis_Delete_"
                         + paramTypeName + ",\""
-                        + ((ParameterInfo) paramsB.get(i)).getParamName()
+                        + ((ParameterInfo) paramsB.get(i)).getParamNameAsSOAPString()
                         + "\",Axis_URI_" + paramTypeName);
             }
             writer.write(");\n");
@@ -426,21 +426,11 @@
                 + minfo.getOutputMessage().getLocalPart() + "\",\""
                 + wscontext.getWrapInfo().getTargetNameSpaceOfWSDL()
                 + "\"))\n\t\t{\n");
-
-        // Because getParamName will prefix any c++ reserved word with an
-        // underscore (i.e 'return' becomes '_return'), this unnecessary
-        // modification needs to be removed before using the name as a soap
-        // tag identifier.
-        
+      
         String paramTagName = "";
         
         if( returntype != null)
-        {
-            paramTagName = returntype.getParamName();
-
-            if( paramTagName.charAt(0) == '_')
-                paramTagName = paramTagName.substring( 1);
-        }
+            paramTagName = returntype.getParamNameAsSOAPString();
         
         if (isAllTreatedAsOutParams)
         {
@@ -478,7 +468,7 @@
                         writer.write("\n\t\tAxisc_Array * pReturn" + i 
                                 + " = axiscCallGetBasicArray(call, " 
                                 + CUtils.getXSDTypeForBasicType (containedType) 
-                                + ",\"" + currentType.getParamName() + "\",0);\n\n");
+                                + ",\"" + currentType.getParamNameAsSOAPString() + "\",0);\n\n");
                         writer.write("\t\tif( OutValue" + i + " != NULL)\n");
                         writer.write("\t\t{\n");
                         writer.write("\t\t\tif( *OutValue" + i + " != NULL)\n");
@@ -501,7 +491,7 @@
                                 + ",(void *) Axis_DeSerialize_" + containedType
                                 + ",(void *) Axis_Create_" + containedType
                                 + ",(void *) Axis_Delete_" + containedType
-                                + ",\"" +currentType.getElementNameAsString() 
+                                + ",\"" +currentType.getElementNameAsSOAPString() 
                                 + "\",Axis_URI_" + containedType + ");\n");
                         writer.write("\t\t}\n");
                         writer.write("\t\telse\n");
@@ -512,7 +502,7 @@
                                 + ",(void *) Axis_DeSerialize_" + containedType
                                 + ",(void *) Axis_Create_" + containedType
                                 + ",(void *) Axis_Delete_" + containedType
-                                + ",\"" + currentType.getElementNameAsString() 
+                                + ",\"" + currentType.getElementNameAsSOAPString() 
                                 + "\",Axis_URI_" + containedType + ");\n");
                         writer.write("\t\t\t\tAxis_Delete_" + containedType + "_Array(pTemp" + i + ", 0);\n");
                         writer.write("\t\t}\n");
@@ -559,7 +549,7 @@
                         }
                         else 
                         {
-                            writer.write( "\t\t" + currentParaType + " * pReturn" + i + " = axiscCall" + CUtils.getParameterGetValueMethodName( currentParaType, false) + "(call, \"" + currentType.getParamName() + "\", 0);\n");
+                            writer.write( "\t\t" + currentParaType + " * pReturn" + i + " = axiscCall" + CUtils.getParameterGetValueMethodName( currentParaType, false) + "(call, \"" + currentType.getParamNameAsSOAPString() + "\", 0);\n");
                             writer.write( "\n");
                             writer.write( "\t\tif( pReturn" + i + " != NULL && OutValue" + i + " != NULL)\n");
                             writer.write( "\t\t{\n");
@@ -579,7 +569,7 @@
                                         + " *) axiscCallGetCmplxObject(call, (void *) Axis_DeSerialize_" + currentParaType
                                         + ",(void *) Axis_Create_" + currentParaType
                                         + ",(void *) Axis_Delete_" + currentParaType
-                                        + ",\"" + currentType.getParamName()
+                                        + ",\"" + currentType.getParamNameAsSOAPString()
                                         + "\",0);\n");
                     }
                 }

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ParmHeaderFileWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ParmHeaderFileWriter.java?view=diff&rev=503560&r1=503559&r2=503560
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ParmHeaderFileWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ParmHeaderFileWriter.java Sun Feb  4 21:54:41 2007
@@ -123,7 +123,7 @@
             String  restrictionBaseType = type.getRestrictionBaseType();
             if (null != restrictionBaseType )
             {  
-                langTypeName = CUtils.sanitiseClassName(restrictionBaseType);               
+                langTypeName = CUtils.sanitizeString(restrictionBaseType);               
                 writer.write( "#include \"" + langTypeName + ".hpp\"\n\n");
             }
             else
@@ -262,18 +262,12 @@
         try
         {
             for (int i = 0; i < attribs.length; i++)
-            {  
-                // Ensure field name is valid and does not cause conflict with class names
-                String sanitizedAttrName = CUtils.sanitiseAttributeName(attribs[i].getParamName());
-                if (CUtils.classExists(wscontext, sanitizedAttrName))
-                    sanitizedAttrName += "_Ref";
-                attribs[i].setParamName(sanitizedAttrName);
-                
+            {                  
                 // Following will set the correct type 
                 String paramType = getCorrectParmNameConsideringArraysAndComplexTypes(attribs[i]);
                 
                 // Following will set param name - if anyType, we index param name
-                String paramName = attribs[i].getParamName();
+                String paramName = attribs[i].getParamNameAsMember();
                 if(attribs[i].isAnyType())
                 {
                     anyCounter += 1;
@@ -301,7 +295,7 @@
                 writer.write("\t"
                              + getCorrectParmNameConsideringArraysAndComplexTypes(extensionBaseAttrib)
                              + "  "
-                             + extensionBaseAttrib.getParamNameWithoutSymbols() + ";\n");
+                             + extensionBaseAttrib.getParamNameAsMember() + ";\n");
             }            
         }
         catch (IOException e)

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/ClientStubWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/ClientStubWriter.java?view=diff&rev=503560&r1=503559&r2=503560
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/ClientStubWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/ClientStubWriter.java Sun Feb  4 21:54:41 2007
@@ -371,7 +371,7 @@
             if ("string".equals (elementType))
             {
                 writer.write ("\taxiscCallSetSOAPMethodAttribute(call, \""
-                      + param.getParamName () + "\", \"\", Value" + i + ");\n");
+                      + param.getParamNameAsSOAPString () + "\", \"\", Value" + i + ");\n");
             }
             else if ("int".equals (elementType))
             {
@@ -379,7 +379,7 @@
                 writer.write ("\t\tchar buffer[20];\n");
                 writer.write ("\t\tsprintf(buffer,\"%d\", Value" + i + ");\n");
                 writer.write ("\t\taxiscCallSetSOAPMethodAttribute(call, \"" +
-                       param.getParamName () + "\", \"\", buffer);\n");
+                       param.getParamNameAsSOAPString () + "\", \"\", buffer);\n");
                 writer.write ("\t}\n");
             }
         } // end for-loop
@@ -428,7 +428,7 @@
                 writer.write("\taxiscCallAddAnyObject(call, Value" + i);
             else
             {
-                String parameterName = ((ParameterInfo) paramsB.get (i)).getElementNameAsString ();
+                String parameterName = ((ParameterInfo) paramsB.get (i)).getElementNameAsSOAPString ();
                 String namespace = ((ParameterInfo) paramsB.get (i)).getElementName ().getNamespaceURI ();
     
                 if (((ParameterInfo)paramsB.get(i)).isOptional())
@@ -611,7 +611,7 @@
                         
                         writer.write("\n\t\t\tOutValue" + i + " = axiscCallGetBasicArray(call, " 
                                 + CUtils.getXSDTypeForBasicType (containedType) 
-                                + ", \"" + currentType.getParamName ()
+                                + ", \"" + currentType.getParamNameAsSOAPString ()
                                 + "\", 0);\n\n");
                     }
                     else
@@ -628,7 +628,7 @@
                               + ", (void*) Axis_DeSerialize_" + containedType
                               + ", (void*) Axis_Create_" + containedType
                               + ", (void*) Axis_Delete_" + containedType
-                              + ", \"" + currentType.getElementNameAsString () 
+                              + ", \"" + currentType.getElementNameAsSOAPString () 
                               + "\", Axis_URI_" + containedType + ");\n");
                         
                         writer.write("\t\t\t}\n");
@@ -642,7 +642,7 @@
                               + ", (void*) Axis_DeSerialize_" + containedType
                               + ", (void*) Axis_Create_" + containedType
                               + ", (void*) Axis_Delete_" + containedType
-                              + ", \"" + currentType.getElementNameAsString () 
+                              + ", \"" + currentType.getElementNameAsSOAPString () 
                               + "\", Axis_URI_" + containedType + ");\n");
                         writer.write("\t\t\t\tAxis_Delete_" + containedType + "_Array(pTemp" + i + ", 0);\n");
                         writer.write("\t\t\t}\n");                        
@@ -669,7 +669,7 @@
                         writer.write( "\t\t\t" + currentParaType + " pReturn" + i + " = " 
                                 + "axiscCall"
                                 + CUtils.getParameterGetValueMethodName( baseTypeName, false) 
-                                + "(call,  \"" + currentType.getParamName() + "\", 0);\n");
+                                + "(call,  \"" + currentType.getParamNameAsSOAPString() + "\", 0);\n");
                         writer.write( "\n");
                         writer.write( "\t\t\tif( pReturn" + i + " != NULL && OutValue" + i + " != NULL)\n");
                         writer.write( "\t\t\t{\n");
@@ -700,7 +700,7 @@
                         writer.write( "\t\t\t" + currentParaType + " * pReturn" + i + " = " 
                                 + "axiscCall"
                                 + CUtils.getParameterGetValueMethodName( baseTypeName, false) 
-                                + "(call,  \"" + currentType.getParamName() + "\", 0);\n");
+                                + "(call,  \"" + currentType.getParamNameAsSOAPString() + "\", 0);\n");
                         writer.write( "\n");
                         writer.write( "\t\t\tif( pReturn" + i + " != NULL && OutValue" + i + " != NULL)\n");
                         writer.write( "\t\t\t{\n");
@@ -745,7 +745,7 @@
                               + "*)axiscCallGetCmplxObject(call, (void*) Axis_DeSerialize_" + currentParaType 
                               + ", (void*) Axis_Create_" + currentParaType 
                               + ", (void*) Axis_Delete_" + currentParaType + ",\"" 
-                              + currentType.getElementNameAsString () + "\", 0);\n");
+                              + currentType.getElementNameAsSOAPString () + "\", 0);\n");
                 }
             }
             
@@ -774,7 +774,7 @@
                 containedType = CUtils.getclass4qname (qname);
                 writer.write ("\t\t\tRetArray =(" + containedType + "_Array *) axiscCallGetBasicArray(call, " 
                         + CUtils.getXSDTypeForBasicType (containedType) 
-                        + ", \"" + returntype.getParamName () + "\", 0);\n");
+                        + ", \"" + returntype.getParamNameAsSOAPString () + "\", 0);\n");
             }
             else
             {
@@ -784,7 +784,7 @@
                         + containedType 
                         + ", (void*) Axis_Create_" + containedType
                           + ", (void*) Axis_Delete_" + containedType
-                          + ", \"" + returntype.getElementNameAsString ()
+                          + ", \"" + returntype.getElementNameAsSOAPString ()
                           + "\", Axis_URI_" + containedType + ");\n");
             }
             
@@ -801,7 +801,7 @@
                 // Just return the pointer as-is - no need to delete.
                 writer.write( "\t\t\tRet = axiscCall"
                         + CUtils.getParameterGetValueMethodName( outparamType, false) 
-                        + "(call, \"" + returntype.getParamName() + "\", 0);\n");
+                        + "(call, \"" + returntype.getParamNameAsSOAPString() + "\", 0);\n");
 
                 writer.write( "\t\t}\n");
             }
@@ -810,7 +810,7 @@
                 writer.write ("\t\t\t" + outparamType + " * pReturn = " 
                         + "axiscCall"
                         + CUtils.getParameterGetValueMethodName(outparamType, false) 
-                        + "(call, \"" + returntype.getSOAPElementNameAsString() + "\", 0);\n");
+                        + "(call, \"" + returntype.getElementNameAsSOAPString() + "\", 0);\n");
                 
                 writer.write ("\t\t\tif(pReturn)\n");
                 writer.write ("\t\t\t{\n");
@@ -850,7 +850,7 @@
                           ")axiscCallGetCmplxObject(call, (void*) Axis_DeSerialize_" + outparamTypeBase +
                           ", (void*) Axis_Create_" + outparamTypeBase +
                           ", (void*) Axis_Delete_" + outparamTypeBase + ",\"" +
-                          returntype.getElementNameAsString () + "\", 0);\n\t\t}\n");
+                          returntype.getElementNameAsSOAPString () + "\", 0);\n\t\t}\n");
             }
             else
             {
@@ -858,7 +858,7 @@
                           + "*)axiscCallGetCmplxObject(call, (void*) Axis_DeSerialize_" + outparamType +
                           ", (void*) Axis_Create_" + outparamType +
                           ", (void*) Axis_Delete_" + outparamType + ",\"" +
-                          returntype.getElementNameAsString () + "\", 0);\n\t\t}\n");
+                          returntype.getElementNameAsSOAPString () + "\", 0);\n\t\t}\n");
             }
 
             writer.write ("\t}\n");

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/AllParamWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/AllParamWriter.java?view=diff&rev=503560&r1=503559&r2=503560
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/AllParamWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/AllParamWriter.java Sun Feb  4 21:54:41 2007
@@ -72,7 +72,7 @@
                     if (elementType != null)
                     {
                         if (TypeMap.isAnonymousType(elementType))
-                            elementType = CUtils.sanitiseClassName(elementType);
+                            elementType = CUtils.sanitizeString(elementType);
                         
                         if (WSDL2Ws.verbose)
                             System.out.println("    Array element type " 

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/BeanParamWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/BeanParamWriter.java?view=diff&rev=503560&r1=503559&r2=503560
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/BeanParamWriter.java (original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/BeanParamWriter.java Sun Feb  4 21:54:41 2007
@@ -67,8 +67,6 @@
     {
         try
         {
-            // Ensure writeGetSetMethods() is first since it ensure attribute name does not conflict with
-            // existing classes
             writeGetSetMethods();
             writeSerializeGlobalMethod();
             writeDeSerializeGlobalMethod();
@@ -100,18 +98,11 @@
         {
             for (int i = 0; i < attribs.length; i++)
             {
-                // Ensure field name is valid and does not cause conflict with class names
-                String sanitizedAttrName = CUtils.sanitiseAttributeName(attribs[i].getParamName());
-                attribs[i].setMethodName(sanitizedAttrName);
-                if (CUtils.classExists(wscontext, sanitizedAttrName))
-                    sanitizedAttrName += "_Ref";
-                attribs[i].setParamName(sanitizedAttrName);
-
                 // Set method name
                 String methodName = attribs[i].getMethodName();
                 
                 // Set parameter name
-                String parameterName = sanitizedAttrName;
+                String parameterName = attribs[i].getParamNameAsMember();
                 
                 // Set the type to use
                 String properParamType = getCorrectParmNameConsideringArraysAndComplexTypes(attribs[i]);
@@ -190,13 +181,7 @@
                     if (attribs[i].getChoiceElement())
                         for (int j = 0; j < attribs.length; j++)
                             if ((attribs[j].getChoiceElement()) && (j != i))
-                            {
-                                // TODO simplify by doing all attributes before we get into code gen
-                                String realName = attribs[j].getParamNameWithoutSymbols();
-                                if (CUtils.classExists(wscontext, realName))
-                                    realName += "_Ref";
-                                writer.write("\t" + realName + " = NULL; \n");
-                            }
+                                writer.write("\t" + attribs[j].getParamNameAsMember() + " = NULL; \n");
 
                     writer.write("}\n");
                 } 
@@ -286,13 +271,7 @@
                     if (attribs[i].getChoiceElement())
                         for (int j = 0; j < attribs.length; j++)
                             if ((attribs[j].getChoiceElement()) && (j != i))
-                            {
-                                String realName = attribs[j].getParamNameWithoutSymbols();
-                                if (CUtils.classExists(wscontext, realName))
-                                    realName += "_Ref";
-
-                                writer.write("\t" + realName + " = NULL ; \n");
-                            }
+                                writer.write("\t" + attribs[j].getParamNameAsMember() + " = NULL ; \n");
 
                     writer.write("}\n");
                 }
@@ -396,46 +375,36 @@
         for (int i = 0; i < attributeParamCount; i++)
         {
             if (attribs[i].isArray() || !(attribs[i].isSimpleType() || attribs[i].getType().isSimpleType()))
-            {
                 throw new WrapperFault("Error : an attribute is not basic type");
+            
+            String soapTagName = attribs[i].getParamNameAsSOAPString();
+
+            Type type = attribs[i].getType();
+            String basicType = null;
+            
+            if (!attribs[i].isSimpleType() && type.isSimpleType())
+                basicType = CUtils.getclass4qname(type.getBaseType());
+            else
+                basicType = attribs[i].getTypeName();
+
+            if (attribs[i].isOptional())
+                writer.write("\tif (0 != param->" + attribs[i].getParamNameAsMember() + ")\n");
+            
+            if (CUtils.isPointerType(basicType) || attribs[i].isOptional())
+            {
+                writer.write("\t\tpSZ->serializeAsAttribute(\""
+                        + soapTagName + "\", 0, (void*)(param->"
+                        + attribs[i].getParamNameAsMember() + "), "
+                        + CUtils.getXSDTypeForBasicType(basicType) + ");\n");
             }
             else
             {
-                //remove _Ref sufix and _ prefix in SOAP tag name
-                String soapTagName = attribs[i].getParamName();
-                if (soapTagName.lastIndexOf("_Ref") > -1)
-                    soapTagName = soapTagName.substring(0, soapTagName.lastIndexOf("_Ref"));
-                
-                if (soapTagName.charAt(0) == '_')
-                    soapTagName = soapTagName.substring(1, soapTagName.length());
-
-                Type type = attribs[i].getType();
-                String basicType = null;
-                
-                if (!attribs[i].isSimpleType() && type.isSimpleType())
-                    basicType = CUtils.getclass4qname(type.getBaseType());
-                else
-                    basicType = attribs[i].getTypeName();
-
-                if (attribs[i].isOptional())
-                    writer.write("\tif (0 != param->" + attribs[i].getParamNameAsMember() + ")\n");
-                
-                if (CUtils.isPointerType(basicType) || attribs[i].isOptional())
-                {
-                    writer.write("\t\tpSZ->serializeAsAttribute(\""
-                            + soapTagName + "\", 0, (void*)(param->"
-                            + attribs[i].getParamNameAsMember() + "), "
-                            + CUtils.getXSDTypeForBasicType(basicType) + ");\n");
-                }
-                else
-                {
-                    writer.write("\t\tpSZ->serializeAsAttribute(\""
-                            + soapTagName
-                            + "\", 0, (void*)&(param->"
-                            + attribs[i].getParamNameAsMember()
-                            + "), "
-                            + CUtils.getXSDTypeForBasicType(attribs[i].getTypeName()) + ");\n");
-                }
+                writer.write("\t\tpSZ->serializeAsAttribute(\""
+                        + soapTagName
+                        + "\", 0, (void*)&(param->"
+                        + attribs[i].getParamNameAsMember()
+                        + "), "
+                        + CUtils.getXSDTypeForBasicType(attribs[i].getTypeName()) + ");\n");
             }
         }
 
@@ -517,10 +486,10 @@
                     else
                         baseTypeName = attribs[i].getTypeName();
                     
-                    writer.write("\tpSZ->serializeBasicArray(param->" + attribs[i].getParamName()
+                    writer.write("\tpSZ->serializeBasicArray(param->" + attribs[i].getParamNameAsMember()
                         + ", " + namespace + ","
                         + CUtils.getXSDTypeForBasicType(baseTypeName) + ", \""
-                        + attribs[i].getParamNameAsSOAPElement() + "\");\n");
+                        + attribs[i].getParamNameAsSOAPString() + "\");\n");
                 }
                 else
                 {
@@ -531,12 +500,10 @@
                     else
                         namespace = "NULL";
                     
-                    writer.write("\tpSZ->serializeCmplxArray(param->"
-                                    + attribs[i].getParamNameAsMember() + ",\n");
-                    writer.write("\t\t\t\t\t\t (void*) Axis_Serialize_" + arrayType + ",\n");
-                    writer.write("\t\t\t\t\t\t (void*) Axis_Delete_" + arrayType + ",\n");
-                    writer.write("\t\t\t\t\t\t \""
-                            + attribs[i].getElementNameAsString() + "\", " + namespace + ");\n");
+                    writer.write("\tpSZ->serializeCmplxArray(param->" + attribs[i].getParamNameAsMember() 
+                            + ", (void*)Axis_Serialize_" + arrayType 
+                            + ", (void*)Axis_Delete_" + arrayType 
+                            + ", \"" + attribs[i].getElementNameAsSOAPString() + "\", " + namespace + ");\n");
                 }
             }
             else if (attribs[i].isSimpleType() || attribs[i].getType().isSimpleType())
@@ -549,14 +516,14 @@
                     baseTypeName = typeName;
                 
                 if (attribs[i].isOptional())
-                    writer.write("\tif (param->" + attribs[i].getParamNameWithoutSymbols() + " != NULL)\n\t{\n\t");
+                    writer.write("\tif (param->" + attribs[i].getParamNameAsMember() + " != NULL)\n\t{\n\t");
                 
                 if (CUtils.isPointerType(baseTypeName))
                 {
                     writer.write("\tpSZ->serializeAsElement(\""
-                            + attribs[i].getSOAPElementNameAsString()
+                            + attribs[i].getElementNameAsSOAPString()
                             + "\", " + namespace
-                            + ", (void*)(param->" + attribs[i].getParamNameWithoutSymbols() + "), "
+                            + ", (void*)(param->" + attribs[i].getParamNameAsMember() + "), "
                             + CUtils.getXSDTypeForBasicType(baseTypeName) + ");\n");
                 }
                 else if (attribs[i].getChoiceElement()
@@ -572,23 +539,23 @@
                             && !(CUtils.isPointerType(attribs[i].getTypeName())) )
                     {
                         writer.write("\tpSZ->serializeAsElement(\""
-                                + attribs[i].getSOAPElementNameAsString() + "\", " + namespace
-                                + ", (void*)(*(param->" + attribs[i].getParamNameWithoutSymbols()
+                                + attribs[i].getElementNameAsSOAPString() + "\", " + namespace
+                                + ", (void*)(*(param->" + attribs[i].getParamNameAsMember()
                                 + ")), " + CUtils.getXSDTypeForBasicType(baseTypeName) + ");\n");
                     }
                     else
                     {
                         writer.write("\tpSZ->serializeAsElement(\""
-                                + attribs[i].getSOAPElementNameAsString() + "\", " + namespace
-                                + ", (void*)(param->" + attribs[i].getParamNameWithoutSymbols()
+                                + attribs[i].getElementNameAsSOAPString() + "\", " + namespace
+                                + ", (void*)(param->" + attribs[i].getParamNameAsMember()
                                 + "), " + CUtils.getXSDTypeForBasicType(baseTypeName) + ");\n");
                     }    
                 }                           
                 else
                 {
                     writer.write("\tpSZ->serializeAsElement(\""
-                            + attribs[i].getSOAPElementNameAsString() + "\", " + namespace
-                            + ", (void*)&(param->" + attribs[i].getParamNameWithoutSymbols()
+                            + attribs[i].getElementNameAsSOAPString() + "\", " + namespace
+                            + ", (void*)&(param->" + attribs[i].getParamNameAsMember()
                             + "), " + CUtils.getXSDTypeForBasicType(baseTypeName) + ");\n");
                 }
                 
@@ -598,18 +565,12 @@
             else
             {
                 //if complex type
-                String elm = attribs[i].getParamName();
-                if (elm.lastIndexOf("_Ref") > -1)
-                    elm = elm.substring(0, elm.lastIndexOf("_Ref"));
-
-                if (elm.charAt(0) == '_')
-                    elm = elm.substring(1, elm.length());
-                
+                String elm = attribs[i].getParamNameAsSOAPString();
                 if (attribs[i].isReference())
                     elm = attribs[i].getTypeName();
                 
                 if (attribs[i].isOptional())
-                    writer.write("\tif (param->" + attribs[i].getParamName() + " != NULL)\n\t{\n");
+                    writer.write("\tif (param->" + attribs[i].getParamNameAsMember() + " != NULL)\n\t{\n");
                 
                 if (attribs[i].getNsQualified())
                 {
@@ -617,7 +578,7 @@
                                     + type.getName().getNamespaceURI()
                                     + "\"), \":\", \"" + elm + "\", 0);\n");
                     writer.write("\tAxis_Serialize_" + attribs[i].getTypeName()
-                            + "(param->" + attribs[i].getParamName() + ", pSZ);\n");
+                            + "(param->" + attribs[i].getParamNameAsMember() + ", pSZ);\n");
                     writer.write("\tpSZ->serialize(\"</\", pSZ->getNamespacePrefix(\""
                                     + type.getName().getNamespaceURI()
                                     + "\"), \":\", \"" + elm + "\", \">\", 0);\n");
@@ -626,7 +587,7 @@
                 {
                     writer.write("\tpSZ->serialize(\"<" + elm + "\", 0);\n");
                     writer.write("\tAxis_Serialize_" + attribs[i].getTypeName()
-                            + "(param->" + attribs[i].getParamName() + ", pSZ);\n");
+                            + "(param->" + attribs[i].getParamNameAsMember() + ", pSZ);\n");
                     writer.write("\tpSZ->serialize(\"</" + elm + "\", \">\", 0);\n");
                 }
                 
@@ -671,10 +632,9 @@
         writer.write("\tbool blnIsNewPrefix = false;\n");
         writer.write("\tif (!bArray)\n\t{\n");
         writer.write("\t\tconst AxisChar* sPrefix = pSZ->getNamespacePrefix(Axis_URI_" + classname + ", blnIsNewPrefix);\n");
-        writer.write("\t\tif (blnIsNewPrefix)\n\t\t{\n");
-        writer.write("\t\t\tpSZ->serialize(\" xmlns:\", sPrefix, \"=\\\"\",\n");
-        writer.write("\t\t\t\tAxis_URI_" + classname + ", \"\\\"\", NULL );\n");
-        writer.write( "\t\t}\n");
+        writer.write("\t\tif (blnIsNewPrefix)\n");
+        writer.write("\t\t\tpSZ->serialize(\" xmlns:\", sPrefix, \"=\\\"\", "
+                        + "Axis_URI_" + classname + ", \"\\\"\", NULL);\n");
         writer.write( "\t}\n\n");
     }
 
@@ -689,37 +649,19 @@
         writer.write( "\t\tpSZ->serialize( \"<\", Axis_TypeName_" + classname + ", \">\", NULL);\n");
         writer.write( "\telse\n");
         writer.write( "\t{\n");
-        writer.write( "\t\tconst AxisChar *\tsPrefix = pSZ->getNamespacePrefix( Axis_URI_" + classname + ",\n" +
-                      "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tblnIsNewPrefix);\n\n");
-        writer.write( "// If there are objects that require a local namespace, then define it here.\n");
-        writer.write( "// NB: This namespace will go out of scope when the closing tag is reached.\n");
+        writer.write( "\t\tconst AxisChar * sPrefix = pSZ->getNamespacePrefix( Axis_URI_" 
+                + classname + ", blnIsNewPrefix);\n\n");
+        writer.write( "\t\t// If there are objects that require a local namespace, then define it here.\n");
+        writer.write( "\t\t// NB: This namespace will go out of scope when the closing tag is reached.\n");
         writer.write( "\t\tif( !blnIsNewPrefix)\n");
-        writer.write( "\t\t{\n");
-        writer.write( "\t\t\tpSZ->serialize( \"<\",\n\t\t\t\t\t\t\tAxis_TypeName_" + classname + ",\n" +
-                      "\t\t\t\t\t\t\t\" xsi:type=\\\"\",\n" +
-                      "\t\t\t\t\t\t\tsPrefix,\n" +
-                      "\t\t\t\t\t\t\t\":\",\n" +
-                      "\t\t\t\t\t\t\t");
-        writer.write( "Axis_TypeName_" + classname + ",\n" +
-                      "\t\t\t\t\t\t\t\"\\\">\",\n" +
-                      "\t\t\t\t\t\t\tNULL);\n");
-        writer.write( "\t\t}\n");
+        writer.write( "\t\t\tpSZ->serialize( \"<\", Axis_TypeName_" + classname + ", " 
+                    + "\" xsi:type=\\\"\", sPrefix, \":\", " 
+                    + "Axis_TypeName_" + classname + ", \"\\\">\", NULL);\n");
         writer.write( "\t\telse\n");
-        writer.write( "\t\t{\n");
-        writer.write( "\t\t\tpSZ->serialize( \"<\",\n" +
-                      "\t\t\t\t\t\t\tAxis_TypeName_" + classname + ",\n" +
-                      "\t\t\t\t\t\t\t\" xsi:type=\\\"\",\n" +
-                      "\t\t\t\t\t\t\tsPrefix,\n" +
-                      "\t\t\t\t\t\t\t\":\",\n" +
-                      "\t\t\t\t\t\t\tAxis_TypeName_" + classname + ",\n" +
-                      "\t\t\t\t\t\t\t\"\\\" xmlns:\",\n" +
-                      "\t\t\t\t\t\t\tsPrefix,\n" +
-                      "\t\t\t\t\t\t\t\"=\\\"\",\n" +
-                      "\t\t\t\t\t\t\tAxis_URI_" + classname + ",\n" +
-                      "\t\t\t\t\t\t\t\"\\\">\",\n" +
-                      "\t\t\t\t\t\t\tNULL);\n");
-
-        writer.write( "\t\t}\n");
+        writer.write( "\t\t\tpSZ->serialize( \"<\", Axis_TypeName_" + classname + ", " 
+                    + "\" xsi:type=\\\"\", sPrefix, \":\", " 
+                    + "Axis_TypeName_" + classname + ", \"\\\" xmlns:\", " 
+                    + "sPrefix, \"=\\\"\", Axis_URI_" + classname + ", \"\\\">\", NULL);\n");
         writer.write( "\t}\n\n");
     }
 
@@ -786,6 +728,11 @@
             writer.write("}\n\n");
             return;
         }
+
+        //=============================================================================
+        // Deserialize attributes.
+        // Makes logic simpler to follow with slight duplication. TODO
+        //=============================================================================        
         
         //=============================================================================
         // Deserialize attributes and elements.
@@ -820,7 +767,7 @@
                     writer.write("\telse if");
 
                 writer.write("(strcmp(choiceName,\""
-                        + attribs[i].getElementNameAsString() + "\")==0)\n\t{\n\t");
+                        + attribs[i].getElementNameAsSOAPString() + "\")==0)\n\t{\n\t");
             }
 
             //if the attribute is a 'all' construct we have to check Min
@@ -863,7 +810,7 @@
 
                     writer.write("\tAxis_Array * array" + arrayCount + " = pIWSDZ->getBasicArray("
                             + CUtils.getXSDTypeForBasicType(baseTypeName) + ", \""
-                            + attribs[i].getParamNameAsSOAPElement()
+                            + attribs[i].getParamNameAsSOAPString()
                             + "\",0);\n");
                     writer.write("\tif(param->" + attribs[i].getParamNameAsMember() + " == NULL)\n");
                     writer.write("\t\tparam->" + attribs[i].getParamNameAsMember() + " = new " + attribs[i].getTypeName() + "_Array();\n");
@@ -873,25 +820,16 @@
                 else
                 {
                     arrayType = attribs[i].getTypeName();
-                    writer.write("\tpIWSDZ->getCmplxArray(param->" + attribs[i].getParamNameAsMember() + ", (void*)Axis_DeSerialize_"
-                                    + arrayType + ",\n"
-                                    + "\t\t\t\t\t\t\t\t  (void*)Axis_Create_" + arrayType + ",\n"
-                                    + "\t\t\t\t\t\t\t\t  (void*)Axis_Delete_" + arrayType + ",\n"
-                                    + "\t\t\t\t\t\t\t\t  \""
-                                    + attribs[i].getElementNameAsString()
-                                    + "\", Axis_URI_" + arrayType + ");\n\n");
-                    
+                    writer.write("\tpIWSDZ->getCmplxArray(param->" + attribs[i].getParamNameAsMember() 
+                            + ", (void*)Axis_DeSerialize_" + arrayType
+                            + ", (void*)Axis_Create_" + arrayType 
+                            + ", (void*)Axis_Delete_" + arrayType
+                            + ", \"" + attribs[i].getElementNameAsSOAPString() + "\", Axis_URI_" + arrayType + ");\n");
                 }
             }
             else if ((attribs[i].isSimpleType() || attribs[i].getType().isSimpleType()))
             {
-                //remove _Ref sufix and _ prefix in SOAP tag name
-                String soapTagName = (attribs[i].isAttribute() ? attribs[i].getParamName() : attribs[i].getElementNameAsString());
-                if (soapTagName.lastIndexOf("_Ref") > -1)
-                    soapTagName = soapTagName.substring(0, soapTagName.lastIndexOf("_Ref"));
-
-                if (soapTagName.charAt(0) == '_')
-                    soapTagName = soapTagName.substring(1, soapTagName.length());
+                String soapTagName = (attribs[i].isAttribute() ? attribs[i].getParamNameAsSOAPString() : attribs[i].getElementNameAsSOAPString());
                 
                 // We only peek for elements, not element attributes!
                 if (attribs[i].isOptional() && !attribs[i].isAttribute())
@@ -970,7 +908,7 @@
                 }
                 else
                 {
-                    String elementNameToSearchFor = attribs[i].isAttribute()? attribs[i].getParamNameAsMember():attribs[i].getSOAPElementNameAsString();
+                    String elementNameToSearchFor = attribs[i].isAttribute()? attribs[i].getParamNameAsSOAPString():attribs[i].getElementNameAsSOAPString();
                     
                     writer.write("\t" + attribs[i].getTypeName() + " * "
                             + attribs[i].getParamNameAsMember() + " = NULL;\n\n");
@@ -996,14 +934,7 @@
             else
             {
                 //if complex type
-                //remove _Ref sufix and _ prefix in SOAP tag name
-                String soapTagName = attribs[i].getParamName();
-
-                if (soapTagName.lastIndexOf("_Ref") > -1)
-                    soapTagName = soapTagName.substring(0, soapTagName.lastIndexOf("_Ref"));
-
-                if (soapTagName.charAt(0) == '_')
-                    soapTagName = soapTagName.substring(1, soapTagName.length());
+                String soapTagName = attribs[i].getParamNameAsSOAPString();
                 
                 if (attribs[i].isOptional())
                 {
@@ -1014,12 +945,10 @@
 
                 writer.write("\tparam->" + attribs[i].getParamNameAsMember()
                         + " = (" + attribs[i].getTypeName()
-                        + "*)pIWSDZ->getCmplxObject((void*)Axis_DeSerialize_"
-                        + attribs[i].getTypeName()
-                        + "\n\t\t, (void*)Axis_Create_"
-                        + attribs[i].getTypeName() + ", (void*)Axis_Delete_"
-                        + attribs[i].getTypeName() + "\n\t\t, \"" + soapTagName
-                        + "\", Axis_URI_" + attribs[i].getTypeName() + ");\n");
+                        + "*)pIWSDZ->getCmplxObject((void*)Axis_DeSerialize_" + attribs[i].getTypeName()
+                        + ", (void*)Axis_Create_" + attribs[i].getTypeName() 
+                        + ", (void*)Axis_Delete_" + attribs[i].getTypeName() 
+                        + ", \"" + soapTagName + "\", Axis_URI_" + attribs[i].getTypeName() + ");\n");
                 
                 if (attribs[i].isOptional())
                 {
@@ -1179,24 +1108,24 @@
                         writer.write("\t\t// This object is a 'choice' or 'all', so need to ensure that any\n");
                         writer.write("\t\t// other objects belonging to this union of elements are empty.\n");
                         writer.write("\t\t// NB: Hasn't been implemented yet!\n");
-                        writer.write("\t" + attribs[i].getParamName() + " = new " 
+                        writer.write("\t" + attribs[i].getParamNameAsMember() + " = new " 
                                 + attribs[i].getTypeName() + "_Array( *original." 
-                                + attribs[i].getParamName() + ");\n");
+                                + attribs[i].getParamNameAsMember() + ");\n");
                     }
                     else
                     {
-                        writer.write("\t" + attribs[i].getParamName() + " = new " 
+                        writer.write("\t" + attribs[i].getParamNameAsMember() + " = new " 
                                 + attribs[i].getTypeName() + "_Array(*original." 
-                                + attribs[i].getParamName() + ");\n");
+                                + attribs[i].getParamNameAsMember() + ");\n");
                     }
                 }
                 else if (attribs[i].isAnyType())
                 {
                     anyCounter++;
-                    writer.write("\tif (original." + attribs[i].getParamName() + anyCounter + " != NULL)\n");
-                    writer.write("\t\t" + attribs[i].getParamName() + anyCounter + " = new " + attribs[i].getTypeName() + "(*(original." + attribs[i].getParamName() + anyCounter + "));\n");
+                    writer.write("\tif (original." + attribs[i].getParamNameAsMember() + anyCounter + " != NULL)\n");
+                    writer.write("\t\t" + attribs[i].getParamNameAsMember() + anyCounter + " = new " + attribs[i].getTypeName() + "(*(original." + attribs[i].getParamNameAsMember() + anyCounter + "));\n");
                     writer.write("\telse\n");
-                    writer.write("\t\t" + attribs[i].getParamName() + anyCounter + " = NULL;\n");
+                    writer.write("\t\t" + attribs[i].getParamNameAsMember() + anyCounter + " = NULL;\n");
                 }
                 else
                 {
@@ -1209,23 +1138,23 @@
     
                     if ((attribs[i].isSimpleType() || attribs[i].getType().isSimpleType()) && (isPointerType || attribs[i].isOptional() || attribs[i].isNillable() || attribs[i].getChoiceElement() || attribs[i].getAllElement()))
                     {
-                        writer.write("\t" + attribs[i].getParamName() + " = NULL;\n");
-                        writer.write("\t__axis_deepcopy_" + attribs[i].getParamName() + " = false;\n");
-                        writer.write("\tset" + attribs[i].getMethodName() + "(original." + attribs[i].getParamName() + ", original.__axis_deepcopy_" + attribs[i].getParamName() + ");\n\n");
+                        writer.write("\t" + attribs[i].getParamNameAsMember() + " = NULL;\n");
+                        writer.write("\t__axis_deepcopy_" + attribs[i].getParamNameAsMember() + " = false;\n");
+                        writer.write("\tset" + attribs[i].getMethodName() + "(original." + attribs[i].getParamNameAsMember() + ", original.__axis_deepcopy_" + attribs[i].getParamNameAsMember() + ");\n\n");
                     }
                     else if (attribs[i].isSimpleType())
                     {
-                        writer.write("\t" + attribs[i].getParamName() + " = original." 
-                                + attribs[i].getParamName() + ";\n");
+                        writer.write("\t" + attribs[i].getParamNameAsMember() + " = original." 
+                                + attribs[i].getParamNameAsMember() + ";\n");
                     }
                     else
                     {
-                        writer.write("\tif (original." + attribs[i].getParamName() + " != NULL)\n");
-                        writer.write("\t\t" + attribs[i].getParamName() + " = new " 
+                        writer.write("\tif (original." + attribs[i].getParamNameAsMember() + " != NULL)\n");
+                        writer.write("\t\t" + attribs[i].getParamNameAsMember() + " = new " 
                                 + attribs[i].getTypeName() + "(*(original." 
-                                + attribs[i].getParamName() + "));\n");
+                                + attribs[i].getParamNameAsMember() + "));\n");
                         writer.write("\telse\n");
-                        writer.write("\t\t" + attribs[i].getParamName() + " = NULL;\n");
+                        writer.write("\t\t" + attribs[i].getParamNameAsMember() + " = NULL;\n");
                     }
                 }
             }
@@ -1280,7 +1209,7 @@
                 else if (isElementNillable(i) || isElementOptional(i) || attribs[i].getChoiceElement() || attribs[i].getAllElement())
                 {
                     writer.write("\t" + attribs[i].getParamNameAsMember() + " = NULL;\n");
-                    writer.write("\t__axis_deepcopy_" + attribs[i].getParamName() + " = false;\n");
+                    writer.write("\t__axis_deepcopy_" + attribs[i].getParamNameAsMember() + " = false;\n");
                 }
                 else
                 {
@@ -1294,7 +1223,7 @@
                     if(isPointerType)
                     {
                         writer.write("\t"+ attribs[i].getParamNameAsMember() + " = NULL;\n");
-                        writer.write("\t__axis_deepcopy_" + attribs[i].getParamName() + " = false;\n");
+                        writer.write("\t__axis_deepcopy_" + attribs[i].getParamNameAsMember() + " = false;\n");
                     }
                 }
             }



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message