axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From baud...@apache.org
Subject cvs commit: ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp BeanParamWriter.java
Date Mon, 05 Apr 2004 11:47:11 GMT
baudyjy     2004/04/05 04:47:10

  Modified:    c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp
                        BeanParamWriter.java
  Log:
  Fix complex schemas compilation (include cycle).
  
  Revision  Changes    Path
  1.18      +26 -9     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.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- BeanParamWriter.java	8 Mar 2004 05:43:46 -0000	1.17
  +++ BeanParamWriter.java	5 Apr 2004 11:47:10 -0000	1.18
  @@ -94,11 +94,19 @@
   		while(itr.hasNext())
   		{
   			typeName = itr.next().toString();
  -			writer.write("extern int Axis_DeSerialize_"+typeName+"("+typeName+"* param, IWrapperSoapDeSerializer
*pDZ);\n");
  -			writer.write("extern void* Axis_Create_"+typeName+"("+typeName+"* pObj, bool bArray
= false, int nSize=0);\n");
  -			writer.write("extern void Axis_Delete_"+typeName+"("+typeName+"* param, bool bArray
= false, int nSize=0);\n");
  -			writer.write("extern int Axis_Serialize_"+typeName+"("+typeName+"* param, IWrapperSoapSerializer*
pSZ, bool bArray = false);\n");
  -			writer.write("extern int Axis_GetSize_"+typeName+"();\n\n");			
  +			if ( ! typeName.equals(type.getName().getLocalPart())) {
  +				writer.write("extern int Axis_DeSerialize_"+typeName+"("+typeName+"* param, IWrapperSoapDeSerializer
*pDZ);\n");
  +				writer.write("extern void* Axis_Create_"+typeName+"("+typeName+"* pObj, bool bArray
= false, int nSize=0);\n");
  +				writer.write("extern void Axis_Delete_"+typeName+"("+typeName+"* param, bool bArray
= false, int nSize=0);\n");
  +				writer.write("extern int Axis_Serialize_"+typeName+"("+typeName+"* param, IWrapperSoapSerializer*
pSZ, bool bArray = false);\n");
  +				writer.write("extern int Axis_GetSize_"+typeName+"();\n\n");
  +			} else {
  +				writer.write("int Axis_DeSerialize_"+typeName+"("+typeName+"* param, IWrapperSoapDeSerializer
*pDZ);\n");
  +				writer.write("void* Axis_Create_"+typeName+"("+typeName+"* pObj, bool bArray, int nSize);\n");
  +				writer.write("void Axis_Delete_"+typeName+"("+typeName+"* param, bool bArray, int nSize);\n");
  +				writer.write("int Axis_Serialize_"+typeName+"("+typeName+"* param, IWrapperSoapSerializer*
pSZ, bool bArray);\n");
  +				writer.write("int Axis_GetSize_"+typeName+"();\n\n");
  +			}		
   		}
   		writeSerializeGlobalMethod();
   		writeDeSerializeGlobalMethod();
  @@ -145,10 +153,13 @@
   					writer.write("\tpSZ->SerializeBasicArray((Axis_Array*)(&param->"+attribs[i].getParamName()+"),"+CUtils.getXSDTypeForBasicType(attribs[i].getTypeName())+",
\""+attribs[i].getParamName()+"\");\n"); 
   				}
   				else{
  -					arrayType = attribs[i].getTypeName();
  +					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("\t\t(void*) Axis_Serialize_"+arrayType+", (void*) Axis_Delete_"+arrayType+",
(void*) Axis_GetSize_"+arrayType+",\n"); 
  -					writer.write("\t\t\""+attribs[i].getParamName()+"\", Axis_URI_"+arrayType+");\n");
  +					writer.write("\t\t\""+elm+"\", Axis_URI_"+arrayType+");\n");
   				}
   			}
   			else if (attribs[i].isSimpleType()){
  @@ -191,19 +202,25 @@
   					writer.write("\tparam->"+attribs[i].getParamName()+" = ("+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+

   						"\n\t\t, (void*)Axis_Create_"+arrayType+", (void*)Axis_Delete_"+arrayType+
  -						"\n\t\t, (void*)Axis_GetSize_"+arrayType+", \""+attribs[i].getParamName()+"\", Axis_URI_"+arrayType+");\n");
  +						"\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");
   			} 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()+
   					"\n\t\t, (void*)Axis_Create_"+attribs[i].getTypeName()+", (void*)Axis_Delete_"+attribs[i].getTypeName()+
  -					"\n\t\t, \""+attribs[i].getParamName()+"\", Axis_URI_"+attribs[i].getTypeName()+");\n");
			
  +					"\n\t\t, \""+elm+"\", Axis_URI_"+attribs[i].getTypeName()+");\n");				
   			}		
   		}
   		writer.write("\treturn pIWSDZ->GetStatus();\n");
  
  
  

Mime
View raw message