axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sam...@apache.org
Subject cvs commit: ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info AttributeInfo.java
Date Tue, 12 Oct 2004 08:21:27 GMT
samisa      2004/10/12 01:21:27

  Modified:    c/src/wsdl/org/apache/axis/wsdl/wsdl2ws ParamWriter.java
               c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp
                        BeanParamWriter.java
               c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal
                        BeanParamWriter.java
               c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info
                        AttributeInfo.java
  Log:
  Fixed the problem of class member having the same name as that of class.
  Fix for AXISCPP-198
  
  Revision  Changes    Path
  1.13      +4 -4      ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/ParamWriter.java
  
  Index: ParamWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/ParamWriter.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- ParamWriter.java	11 Oct 2004 08:32:50 -0000	1.12
  +++ ParamWriter.java	12 Oct 2004 08:21:27 -0000	1.13
  @@ -63,7 +63,7 @@
           try{
   			writer.write("/*\n");
   			writer.write(" * This file was auto-generated by the Axis C++ Web Service Generator
(WSDL2Ws)\n");
  -			writer.write(" * This file contains functions to manipulate complex type "+ classname+"\n");
  +			writer.write(" * This file contains functions to manipulate complex type "+ this.classname+"\n");
   			writer.write(" */\n\n");
       	   } catch (IOException e) {
               e.printStackTrace();
  @@ -77,7 +77,7 @@
    	private void populateAttribList(String Qualifiedname) throws WrapperFault {
    		ElementInfo elemi = type.getExtensionBaseType();
    		if ( elemi != null){
  -			extensionBaseAttrib = new AttributeInfo();
  +			extensionBaseAttrib = new AttributeInfo(this.classname);
   			extensionBaseAttrib.setParamName(elemi.getName().getLocalPart());
   			extensionBaseAttrib.setTypeName(CUtils.getclass4qname(elemi.getType().getName()));
   			extensionBaseAttrib.setType(elemi.getType());
  @@ -99,7 +99,7 @@
   		int intEleFieldSz = elementfeilds.size();
   		this.attribs = new AttributeInfo[intAttrFieldSz+intEleFieldSz];
   		for (int i = 0 ; i < intAttrFieldSz; i++) {
  -			this.attribs[i] = new AttributeInfo();
  +			this.attribs[i] = new AttributeInfo(this.classname);
   			this.attribs[i].setParamName((String)attribfeilds.get(i));
   			Type attribType = type.getTypForAttribName(this.attribs[i].getParamName());        
   
   			if(CUtils.isSimpleType(attribType.getName()))
  @@ -115,7 +115,7 @@
   		}
   
   		for (int i = intAttrFieldSz ; i < intAttrFieldSz+intEleFieldSz; i++) {
  -			this.attribs[i] = new AttributeInfo();
  +			this.attribs[i] = new AttributeInfo(this.classname);
   			this.attribs[i].setParamName((String) elementfeilds.get(i-attributeParamCount));   
   			ElementInfo elem = type.getElementForElementName(this.attribs[i].getParamName());
   			Type elementType = elem.getType();
  
  
  
  1.25      +16 -16    ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/BeanParamWriter.java
  
  Index: BeanParamWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/BeanParamWriter.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- BeanParamWriter.java	12 Oct 2004 06:45:55 -0000	1.24
  +++ BeanParamWriter.java	12 Oct 2004 08:21:27 -0000	1.25
  @@ -115,14 +115,14 @@
   			else if(attribs[i].isArray()){
   				//if Array
   				if (attribs[i].isSimpleType()){
  -					writer.write("\tpSZ->serializeBasicArray((Axis_Array*)(&param->"+attribs[i].getParamName()+"),"+CUtils.getXSDTypeForBasicType(attribs[i].getTypeName())+",
\""+attribs[i].getParamName()+"\");\n"); 
  +					writer.write("\tpSZ->serializeBasicArray((Axis_Array*)(&param->"+attribs[i].getParamNameAsMember()+"),"+CUtils.getXSDTypeForBasicType(attribs[i].getTypeName())+",
\""+attribs[i].getParamName()+"\");\n"); 
   				}
   				else{
   					String elm = attribs[i].getParamName();
   					if ( attribs[i].isReference() )
   						elm = attribs[i].getTypeName();
   					arrayType =  attribs[i].getTypeName();
  -					writer.write("\tpSZ->serializeCmplxArray((Axis_Array*)(&param->"+attribs[i].getParamName()+"),\n");

  +					writer.write("\tpSZ->serializeCmplxArray((Axis_Array*)(&param->"+attribs[i].getParamNameAsMember()+"),\n");

   					writer.write("\t\t(void*) Axis_Serialize_"+arrayType+", (void*) Axis_Delete_"+arrayType+",
(void*) Axis_GetSize_"+arrayType+",\n"); 
   					writer.write("\t\t\""+elm+"\", Axis_URI_"+arrayType+");\n");
   				}
  @@ -130,18 +130,18 @@
   			else if (attribs[i].isSimpleType()){
   				if (attribs[i].isAttribute()){
   					if (attribs[i].isOptional()){
  -						writer.write("\tif (0 != param->"+attribs[i].getParamName()+")\n");
  -						writer.write("\t\tpSZ->serializeAsAttribute(\""+attribs[i].getParamName()+"\",
0, (void*)(param->"+attribs[i].getParamName()+"), "+ CUtils.getXSDTypeForBasicType(attribs[i].getTypeName())+");\n");
  +						writer.write("\tif (0 != param->"+attribs[i].getParamNameAsMember()+")\n");
  +						writer.write("\t\tpSZ->serializeAsAttribute(\""+attribs[i].getParamName()+"\",
0, (void*)(param->"+attribs[i].getParamNameAsMember()+"), "+ CUtils.getXSDTypeForBasicType(attribs[i].getTypeName())+");\n");
   					}
   					else{
  -						writer.write("\tpSZ->serializeAsAttribute(\""+attribs[i].getParamName()+"\", 0,
(void*)&(param->"+attribs[i].getParamName()+"), "+ CUtils.getXSDTypeForBasicType(attribs[i].getTypeName())+");\n");
			
  +						writer.write("\tpSZ->serializeAsAttribute(\""+attribs[i].getParamName()+"\", 0,
(void*)&(param->"+attribs[i].getParamNameAsMember()+"), "+ CUtils.getXSDTypeForBasicType(attribs[i].getTypeName())+");\n");
			
   					}
   				}
   				else
  -					writer.write("\tpSZ->serializeAsElement(\""+attribs[i].getParamName()+"\", (void*)&(param->"+attribs[i].getParamName()+"),
"+ CUtils.getXSDTypeForBasicType(attribs[i].getTypeName())+");\n");				
  +					writer.write("\tpSZ->serializeAsElement(\""+attribs[i].getParamName()+"\", (void*)&(param->"+attribs[i].getParamNameAsMember()+"),
"+ CUtils.getXSDTypeForBasicType(attribs[i].getTypeName())+");\n");				
   			}else{
   				//if complex type
  -				writer.write("\tAxis_Serialize_"+attribs[i].getTypeName()+"(param->"+attribs[i].getParamName()+",
pSZ);\n");
  +				writer.write("\tAxis_Serialize_"+attribs[i].getTypeName()+"(param->"+attribs[i].getParamNameAsMember()+",
pSZ);\n");
   			}
   		}
   		writer.write("\n\tpSZ->serialize(\"</\", Axis_TypeName_"+classname+", \">\",
NULL);\n");
  @@ -167,26 +167,26 @@
                           else if(attribs[i].isArray()){
   				//if Array
   				if (attribs[i].isSimpleType()){
  -					writer.write("\tparam->"+attribs[i].getParamName()+" = ("+CUtils.getBasicArrayNameforType(attribs[i].getTypeName())+"&)pIWSDZ->getBasicArray("+CUtils.getXSDTypeForBasicType(attribs[i].getTypeName())+
", \""+attribs[i].getParamName()+"\",0);\n");
  +					writer.write("\tparam->"+attribs[i].getParamNameAsMember()+" = ("+CUtils.getBasicArrayNameforType(attribs[i].getTypeName())+"&)pIWSDZ->getBasicArray("+CUtils.getXSDTypeForBasicType(attribs[i].getTypeName())+
", \""+attribs[i].getParamName()+"\",0);\n");
   				}
   				else{
   					String elm = attribs[i].getParamName();
   					if ( attribs[i].isReference() )
   						elm = attribs[i].getTypeName();					
   					arrayType = attribs[i].getTypeName();
  -					writer.write("\tparam->"+attribs[i].getParamName()+" = ("+attribs[i].getTypeName()+"_Array&)pIWSDZ->getCmplxArray((void*)Axis_DeSerialize_"+arrayType+

  +					writer.write("\tparam->"+attribs[i].getParamNameAsMember()+" = ("+attribs[i].getTypeName()+"_Array&)pIWSDZ->getCmplxArray((void*)Axis_DeSerialize_"+arrayType+

   						"\n\t\t, (void*)Axis_Create_"+arrayType+", (void*)Axis_Delete_"+arrayType+
   						"\n\t\t, (void*)Axis_GetSize_"+arrayType+", \""+elm+"\", Axis_URI_"+arrayType+");\n");
   				}
   			}else if(attribs[i].isSimpleType()){
   				//TODO handle optional attributes
  -				writer.write("\tparam->"+attribs[i].getParamName()+" = pIWSDZ->"+CUtils.getParameterGetValueMethodName(attribs[i].getTypeName(),
attribs[i].isAttribute())+"(\""+attribs[i].getParamName()+"\",0);\n");
  +				writer.write("\tparam->"+attribs[i].getParamNameAsMember()+" = pIWSDZ->"+CUtils.getParameterGetValueMethodName(attribs[i].getTypeName(),
attribs[i].isAttribute())+"(\""+attribs[i].getParamName()+"\",0);\n");
   			} else{
   				//if complex type
   				String elm = attribs[i].getParamName();
   				if ( attribs[i].isReference() )
   					elm = attribs[i].getTypeName();					
  -				writer.write("\tparam->"+attribs[i].getParamName()+" = ("+attribs[i].getTypeName()+"*)pIWSDZ->getCmplxObject((void*)Axis_DeSerialize_"+attribs[i].getTypeName()+
  +				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, \""+attribs[i].getTypeName()+"\", Axis_URI_"+attribs[i].getTypeName()+");\n");
			
   			}		
  @@ -231,11 +231,11 @@
   		writer.write("\t/*do not allocate memory to any pointer members here\n\t because deserializer
will allocate memory anyway. */\n");
   		for(int i = 0; i< attribs.length;i++){
   			if (attribs[i].isArray()){
  -				writer.write("\t"+attribs[i].getParamName()+".m_Array = 0;\n");
  -				writer.write("\t"+attribs[i].getParamName()+".m_Size = 0;\n");
  +				writer.write("\t"+attribs[i].getParamNameAsMember()+".m_Array = 0;\n");
  +				writer.write("\t"+attribs[i].getParamNameAsMember()+".m_Size = 0;\n");
   			}
   			else if (!attribs[i].isSimpleType()){
  -				writer.write("\t"+attribs[i].getParamName()+"=0;\n");
  +				writer.write("\t"+attribs[i].getParamNameAsMember()+"=0;\n");
   			}
   		}			
   		writer.write("}\n");
  @@ -253,10 +253,10 @@
   		writer.write("\t/*delete any pointer and array members here*/\n");
   		for(int i = 0; i< attribs.length;i++){
   			if(attribs[i].isArray()){
  -				writer.write("\tdelete [] (("+attribs[i].getTypeName()+"*)"+attribs[i].getParamName()+".m_Array);\n");
  +				writer.write("\tdelete [] (("+attribs[i].getTypeName()+"*)"+attribs[i].getParamNameAsMember()+".m_Array);\n");
   			}
   			else if (!attribs[i].isSimpleType()){
  -				writer.write("\tdelete "+attribs[i].getParamName()+";\n");				
  +				writer.write("\tdelete "+attribs[i].getParamNameAsMember()+";\n");				
   			}
   		}			
   		writer.write("}\n");
  
  
  
  1.32      +24 -24    ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/BeanParamWriter.java
  
  Index: BeanParamWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/BeanParamWriter.java,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- BeanParamWriter.java	11 Oct 2004 08:32:50 -0000	1.31
  +++ BeanParamWriter.java	12 Oct 2004 08:21:27 -0000	1.32
  @@ -105,7 +105,7 @@
   		if (attribs.length == 0) {
   			writer.write("\tpSZ->serialize(\">\", NULL);\n");
   			if (extensionBaseAttrib != null){
  -				writer.write("\tpSZ->serializeAsChardata((void*)&(param->"+extensionBaseAttrib.getParamName()+"),
"+CUtils.getXSDTypeForBasicType(extensionBaseAttrib.getTypeName())+");\n");
  +				writer.write("\tpSZ->serializeAsChardata((void*)&(param->"+extensionBaseAttrib.getParamNameAsMember()+"),
"+CUtils.getXSDTypeForBasicType(extensionBaseAttrib.getTypeName())+");\n");
   			}else{
   				System.out.println("Possible error in class "  + classname + ": class with no attributes....................");
   			}
  @@ -138,9 +138,9 @@
   				if( soapTagName.charAt(0) == '_' )
   					soapTagName = soapTagName.substring(1, soapTagName.length() );
   				//end remove _Ref sufix and _ prefix in SOAP tag name
  -				writer.write("\tif (0 != param->"+attribs[i].getParamName()+")\n");
  +				writer.write("\tif (0 != param->"+attribs[i].getParamNameAsMember()+")\n");
   				//writer.write("\t\tpSZ->serializeAsAttribute(\""+attribs[i].getParamName()+"\",
0, (void*)&(param->"+attribs[i].getParamName()+"), "+ CUtils.getXSDTypeForBasicType(attribs[i].getTypeName())+");\n");
			
  -				writer.write("\t\tpSZ->serializeAsAttribute(\""+ soapTagName +"\", 0, (void*)&(param->"+attribs[i].getParamName()+"),
"+ CUtils.getXSDTypeForBasicType(attribs[i].getTypeName())+");\n");				
  +				writer.write("\t\tpSZ->serializeAsAttribute(\""+ soapTagName +"\", 0, (void*)&(param->"+attribs[i].getParamNameAsMember()+"),
"+ CUtils.getXSDTypeForBasicType(attribs[i].getTypeName())+");\n");				
   				if (!attribs[i].isOptional()){
   					/* This avoid segmentation fault at runtime */
   					/*writer.write("\telse\n");
  @@ -150,7 +150,7 @@
   		}
   		writer.write("\tpSZ->serialize(\">\", 0);\n");
   		if (extensionBaseAttrib != null && extensionBaseAttrib.getTypeName() != null){
  -			writer.write("\tpSZ->serializeAsChardata((void*)&(param->"+extensionBaseAttrib.getParamName()+"),
"+CUtils.getXSDTypeForBasicType(extensionBaseAttrib.getTypeName())+");\n");
  +			writer.write("\tpSZ->serializeAsChardata((void*)&(param->"+extensionBaseAttrib.getParamNameAsMember()+"),
"+CUtils.getXSDTypeForBasicType(extensionBaseAttrib.getTypeName())+");\n");
   		}
   		writer.write("\t/* then serialize elements if any*/\n");
   		for(int i = attributeParamCount; i< attribs.length;i++){
  @@ -160,11 +160,11 @@
   			else if(attribs[i].isArray()){
   				//if Array
   				if (attribs[i].isSimpleType()){
  -					writer.write("\tpSZ->serializeBasicArray((Axis_Array*)(&param->"+attribs[i].getParamName()+"),"+CUtils.getXSDTypeForBasicType(attribs[i].getTypeName())+",
\""+attribs[i].getParamName()+"\");\n"); 
  +					writer.write("\tpSZ->serializeBasicArray((Axis_Array*)(&param->"+attribs[i].getParamNameAsMember()+"),"+CUtils.getXSDTypeForBasicType(attribs[i].getTypeName())+",
\""+attribs[i].getParamName()+"\");\n"); 
   				}
   				else{
   					arrayType = attribs[i].getTypeName();
  -					writer.write("\tpSZ->serializeCmplxArray((Axis_Array*)(&param->"+attribs[i].getParamName()+"),\n");

  +					writer.write("\tpSZ->serializeCmplxArray((Axis_Array*)(&param->"+attribs[i].getParamNameAsMember()+"),\n");

   					writer.write("\t\t(void*) Axis_Serialize_"+arrayType+", (void*) Axis_Delete_"+arrayType+",
(void*) Axis_GetSize_"+arrayType+",\n");
   					//writer.write("\t\t\""+attribs[i].getElementName().getLocalPart()+"\", Axis_URI_"+arrayType+");\n");
   					writer.write("\t\t\""+attribs[i].getElementNameAsString()+"\", Axis_URI_"+arrayType+");\n");
  @@ -173,7 +173,7 @@
   			else if (attribs[i].isSimpleType()){
   				//writer.write("\tpSZ->serializeAsElement(\""+attribs[i].getElementName().getLocalPart()+"\",
(void*)&(param->"+attribs[i].getParamName()+"), "+ CUtils.getXSDTypeForBasicType(attribs[i].getTypeName())+");\n");
   				//Samisa 22/08/2004
  -				writer.write("\tpSZ->serializeAsElement(\""+attribs[i].getElementNameAsString()+"\",
(void*)&(param->"+attribs[i].getParamName()+"), "+ CUtils.getXSDTypeForBasicType(attribs[i].getTypeName())+");\n");
  +				writer.write("\tpSZ->serializeAsElement(\""+attribs[i].getElementNameAsString()+"\",
(void*)&(param->"+attribs[i].getParamNameAsMember()+"), "+ CUtils.getXSDTypeForBasicType(attribs[i].getTypeName())+");\n");
   				//Samisa
   			}else{
   				//if complex type
  @@ -181,7 +181,7 @@
   				if ( attribs[i].isReference() )
   					elm = attribs[i].getTypeName();
   				writer.write("\tpSZ->serialize(\"<"+elm+"\", 0);\n");
  -				writer.write("\tAxis_Serialize_"+attribs[i].getTypeName()+"(param->"+attribs[i].getParamName()+",
pSZ);\n");
  +				writer.write("\tAxis_Serialize_"+attribs[i].getTypeName()+"(param->"+attribs[i].getParamNameAsMember()+",
pSZ);\n");
   				writer.write("\tpSZ->serialize(\"</"+elm+">\", 0);\n");
   			}
   		}
  @@ -195,7 +195,7 @@
   		writer.write("int Axis_DeSerialize_"+classname+"("+classname+"* param, IWrapperSoapDeSerializer*
pIWSDZ)\n{\n");
   		if (attribs.length == 0) {
   			if (extensionBaseAttrib != null){
  -				writer.write("\tpIWSDZ->getChardataAs((void*)&(param->"+extensionBaseAttrib.getParamName()+"),
"+CUtils.getXSDTypeForBasicType(extensionBaseAttrib.getTypeName())+");\n");
  +				writer.write("\tpIWSDZ->getChardataAs((void*)&(param->"+extensionBaseAttrib.getParamNameAsMember()+"),
"+CUtils.getXSDTypeForBasicType(extensionBaseAttrib.getTypeName())+");\n");
   			}else{
   				System.out.println("Possible error in class "  + classname + ": class with no attributes....................");
   			}
  @@ -219,7 +219,7 @@
   				//if Array
   				if (attribs[i].isSimpleType()){
   					writer.write("\tarray = pIWSDZ->getBasicArray("+CUtils.getXSDTypeForBasicType(attribs[i].getTypeName())+
", \""+attribs[i].getParamName()+"\",0);\n");
  -					writer.write("\tparam->"+attribs[i].getParamName()+" = ("+CUtils.getBasicArrayNameforType(attribs[i].getTypeName())+"&)array;\n");
				
  +					writer.write("\tparam->"+attribs[i].getParamNameAsMember()+" = ("+CUtils.getBasicArrayNameforType(attribs[i].getTypeName())+"&)array;\n");
				
   				}
   				else{
   					arrayType = attribs[i].getTypeName();
  @@ -227,7 +227,7 @@
   						"\n\t\t, (void*)Axis_Create_"+arrayType+", (void*)Axis_Delete_"+arrayType+
   					//	"\n\t\t, (void*)Axis_GetSize_"+arrayType+", \""+attribs[i].getElementName().getLocalPart()+"\",
Axis_URI_"+arrayType+");\n");
   						"\n\t\t, (void*)Axis_GetSize_"+arrayType+", \""+attribs[i].getElementNameAsString()+"\",
Axis_URI_"+arrayType+");\n");
  -					writer.write("\tparam->"+attribs[i].getParamName()+" = ("+attribs[i].getTypeName()+"_Array&)array;\n");

  +					writer.write("\tparam->"+attribs[i].getParamNameAsMember()+" = ("+attribs[i].getTypeName()+"_Array&)array;\n");

   				}
   			}else if(attribs[i].isSimpleType()){
   				//TODO handle optional attributes
  @@ -239,7 +239,7 @@
   				if( soapTagName.charAt(0) == '_' )
   					soapTagName = soapTagName.substring(1, soapTagName.length() );
   				//end remove _Ref sufix and _ prefix in SOAP tag name
  -				writer.write("\tparam->"+attribs[i].getParamName()+" = pIWSDZ->"+CUtils.getParameterGetValueMethodName(attribs[i].getTypeName(),
attribs[i].isAttribute())+"(\""+ soapTagName +"\",0);\n");
  +				writer.write("\tparam->"+attribs[i].getParamNameAsMember()+" = pIWSDZ->"+CUtils.getParameterGetValueMethodName(attribs[i].getTypeName(),
attribs[i].isAttribute())+"(\""+ soapTagName +"\",0);\n");
   				//Samisa
   			} else{
   				//if complex type
  @@ -251,13 +251,13 @@
   				if( soapTagName.charAt(0) == '_' )
   					soapTagName = soapTagName.substring(1, soapTagName.length() );
   				//end remove _Ref sufix and _ prefix in SOAP tag name
  -				writer.write("\tparam->"+attribs[i].getParamName()+" = ("+attribs[i].getTypeName()+"*)pIWSDZ->getCmplxObject((void*)Axis_DeSerialize_"+attribs[i].getTypeName()+
  +				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");				
   			}		
   		}
   		if (extensionBaseAttrib != null && extensionBaseAttrib.getTypeName() != null){
  -			writer.write("\tpIWSDZ->getChardataAs((void*)&(param->"+extensionBaseAttrib.getParamName()+"),
"+CUtils.getXSDTypeForBasicType(extensionBaseAttrib.getTypeName())+");\n");
  +			writer.write("\tpIWSDZ->getChardataAs((void*)&(param->"+extensionBaseAttrib.getParamNameAsMember()+"),
"+CUtils.getXSDTypeForBasicType(extensionBaseAttrib.getTypeName())+");\n");
   		}
   		writer.write("\treturn pIWSDZ->getStatus();\n");
   		writer.write("}\n");
  @@ -299,14 +299,14 @@
   		writer.write("\t/*do not allocate memory to any pointer members here\n\t because deserializer
will allocate memory anyway. */\n");
   		for(int i = 0; i< attribs.length;i++){
   			if (attribs[i].isArray()){
  -				writer.write("\t"+attribs[i].getParamName()+".m_Array = 0;\n");
  -				writer.write("\t"+attribs[i].getParamName()+".m_Size = 0;\n");
  +				writer.write("\t"+attribs[i].getParamNameAsMember()+".m_Array = 0;\n");
  +				writer.write("\t"+attribs[i].getParamNameAsMember()+".m_Size = 0;\n");
   			}
   			else if (!attribs[i].isSimpleType()){
  -				writer.write("\t"+attribs[i].getParamName()+"=0;\n");
  +				writer.write("\t"+attribs[i].getParamNameAsMember()+"=0;\n");
   			} else {
   				/* Needed for shared libraries */
  -				   writer.write("\tmemset( &" + attribs[i].getParamName() + ", 0, sizeof( " + attribs[i].getTypeName()
+ "));\n");
  +				   writer.write("\tmemset( &" + attribs[i].getParamNameAsMember() + ", 0, sizeof(
" + attribs[i].getTypeName() + "));\n");
   //FJP				if ("xsd__string".equals(attribs[i].getTypeName()))
   //FJP				   writer.write("\t"+attribs[i].getParamName()+" = 0;\n");
   			}
  @@ -326,19 +326,19 @@
   		writer.write("\t/*delete any pointer and array members here*/\n");
   		for(int i = 0; i< attribs.length;i++){
   			if(attribs[i].isArray()){
  -				writer.write("\tdelete [] (("+attribs[i].getTypeName()+"*)"+attribs[i].getParamName()+".m_Array);\n");
  +				writer.write("\tdelete [] (("+attribs[i].getTypeName()+"*)"+attribs[i].getParamNameAsMember()+".m_Array);\n");
   			}
   			else if (attribs[i].isAnyType()){
  -				writer.write("\tif ("+attribs[i].getParamName()+") \n\t{ \n");
  -				writer.write("\t\tfor (int i=0; i<"+attribs[i].getParamName()+"->_size; i++)\n\t\t{\n");
  -				writer.write("\t\t\tif ("+attribs[i].getParamName()+"->_array[i]) free("+attribs[i].getParamName()+"->_array[i]);\n");
  +				writer.write("\tif ("+attribs[i].getParamNameAsMember()+") \n\t{ \n");
  +				writer.write("\t\tfor (int i=0; i<"+attribs[i].getParamNameAsMember()+"->_size;
i++)\n\t\t{\n");
  +				writer.write("\t\t\tif ("+attribs[i].getParamNameAsMember()+"->_array[i]) free("+attribs[i].getParamNameAsMember()+"->_array[i]);\n");
   				writer.write("\t\t}\n");
  -				writer.write("\t\tfree("+attribs[i].getParamName()+");\n");
  +				writer.write("\t\tfree("+attribs[i].getParamNameAsMember()+");\n");
   				writer.write("\t}\n");
   				
   			}
   			else if (!attribs[i].isSimpleType()){
  -				writer.write("\tdelete "+attribs[i].getParamName()+";\n");				
  +				writer.write("\tdelete "+attribs[i].getParamNameAsMember()+";\n");				
   			}
   		}			
   		writer.write("}\n");
  
  
  
  1.4       +25 -1     ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/AttributeInfo.java
  
  Index: AttributeInfo.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/info/AttributeInfo.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- AttributeInfo.java	11 Jun 2004 05:01:29 -0000	1.3
  +++ AttributeInfo.java	12 Oct 2004 08:21:27 -0000	1.4
  @@ -34,12 +34,15 @@
   	private boolean isArray = false;
   	private String typeName;
   	private String typeNamespace;
  +        private String className;
  +        private String attribNameAsMember;
   	
   	/**
   	 * @param type
   	 * @param attribName
   	 */
  -	public AttributeInfo() {
  +	public AttributeInfo(String className) {
  +            this.className = className;
   	}
   	
   	/**
  @@ -130,4 +133,25 @@
   		this.isSimpleType = isSimpleType;
   	}
   
  +    public String getParamNameAsMember() {
  +         attribNameAsMember = super.getParamName();
  +         // need to deal with _Ref stuff :(
  +         if (this.className != null && this.className.equals(attribNameAsMember))
  +            this.attribNameAsMember = "m_" + attribNameAsMember;
  +         else
  +            this.attribNameAsMember = attribNameAsMember;
  +
  +         return attribNameAsMember;
  +    }
  +
  +    public void setParamName(String paramName) {
  +        super.setParamName(paramName);
  +        // make sure attributes does not have the same name as class name
  +        
  +        if (this.className != null && this.className.equals(attribName))
  +            this.attribNameAsMember = "m_" + attribName;
  +        else
  +            this.attribNameAsMember = attribName;
  +    }
   }
  +
  
  
  

Mime
View raw message