axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From susan...@apache.org
Subject cvs commit: ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal BeanParamWriter.java ClientStubWriter.java WrapWriter.java
Date Fri, 13 Feb 2004 07:00:30 GMT
susantha    2004/02/12 23:00:30

  Modified:    c/src/wsdl/org/apache/axis/wsdl/wsdl2ws ParamWriter.java
                        WSDL2Ws.java
               c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal
                        BeanParamWriter.java ClientStubWriter.java
                        WrapWriter.java
               c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp
                        BeanParamWriter.java ClientStubWriter.java
               c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal
                        BeanParamWriter.java ClientStubWriter.java
                        WrapWriter.java
  Log:
  corrected doc/literal style code generation issues found by Jeam-Yves Baudy.
  
  Revision  Changes    Path
  1.5       +2 -0      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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ParamWriter.java	3 Feb 2004 13:04:48 -0000	1.4
  +++ ParamWriter.java	13 Feb 2004 07:00:28 -0000	1.5
  @@ -141,6 +141,7 @@
   			}
   			this.attribs[i].setType(attribType);
   			this.attribs[i].setAttribute(true);
  +			this.attribs[i].setElementName(attribType.getName()); //TODO this is wrong. correct
immediately. this will cause attributes serialized incorrectly
   			//TODO : how to find whether this attribute is optional or not ?
   		}
   
  @@ -156,6 +157,7 @@
   				this.attribs[i].setSimpleType(false);
   			}
   			this.attribs[i].setType(elementType);
  +			this.attribs[i].setElementName(elem.getName());
   		   	if(elementType.isArray()){ //soap encoding arrays.
   				Type arrayType = WrapperUtils.getArrayType(elementType); //get contained type
   				this.attribs[i].setArray(true);
  
  
  
  1.14      +11 -3     ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/WSDL2Ws.java
  
  Index: WSDL2Ws.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/WSDL2Ws.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- WSDL2Ws.java	30 Jan 2004 13:30:01 -0000	1.13
  +++ WSDL2Ws.java	13 Feb 2004 07:00:29 -0000	1.14
  @@ -80,7 +80,7 @@
   import org.apache.axis.wsdl.symbolTable.SymTabEntry;
   import org.apache.axis.wsdl.symbolTable.SymbolTable;
   import org.apache.axis.wsdl.symbolTable.TypeEntry;
  -import org.apache.axis.wsdl.toJava.Utils;
  +
   import org.apache.axis.wsdl.wsdl2ws.info.ElementInfo;
   import org.apache.axis.wsdl.wsdl2ws.info.FaultInfo;
   import org.apache.axis.wsdl.wsdl2ws.info.MethodInfo;
  @@ -435,7 +435,6 @@
   			if(type == null){
   				throw new WrapperFault("["+typename+"]unexpected condition occured " +
   					".. please inform the axis-dev@apache.org mailing list ASAP");
  -				
   			}
   			type.getRefType();
   		}
  @@ -459,7 +458,16 @@
   		}
   		System.out.println(
   			"############## the type found =" + type.getQName());
  -		typedata = new Type(type.getQName(), type.getName(), true, targetLanguage);
  +		if (-1 != type.getQName().getLocalPart().indexOf('[')) {/* it seems that this is an array
*/
  +			if (null == type.getRefType())throw new WrapperFault("Array type found without a Ref
type");
  +			QName qn = type.getRefType().getQName();
  +			if (null == qn)throw new WrapperFault("Array type found without a Ref type");
  +			if (CUtils.isSimpleType(qn)) return null;
  +			QName newqn = new QName(type.getQName().getNamespaceURI(), qn.getLocalPart()+"_Array");
  +			typedata = new Type(newqn, newqn.getLocalPart(), true, targetLanguage);
  +		}else {
  +			typedata = new Type(type.getQName(), type.getName(), true, targetLanguage);
  +		}
   		typeMap.addType(type.getQName(), typedata);
   			
   		Node node = type.getNode();
  
  
  
  1.10      +10 -10    ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/BeanParamWriter.java
  
  Index: BeanParamWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/BeanParamWriter.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- BeanParamWriter.java	9 Feb 2004 14:57:07 -0000	1.9
  +++ BeanParamWriter.java	13 Feb 2004 07:00:29 -0000	1.10
  @@ -135,10 +135,10 @@
   			else{
   				if (attribs[i].isOptional()){
   					writer.write("\tif (0 != param->"+attribs[i].getParamName()+")\n");
  -					writer.write("\tpSZ->_functions->SerializeAsAttribute(SZ._object, \""+attribs[i].getParamName()+"\",
0, (void*)&(param->"+attribs[i].getParamName()+"), "+ CUtils.getXSDTypeForBasicType(attribs[i].getTypeName())+");\n");
  +					writer.write("\tpSZ->_functions->SerializeAsAttribute(SZ._object, \""+attribs[i].getElementName().getLocalPart()+"\",
0, (void*)&(param->"+attribs[i].getParamName()+"), "+ CUtils.getXSDTypeForBasicType(attribs[i].getTypeName())+");\n");
   				}
   				else{
  -					writer.write("\tpSZ->_functions->SerializeAsAttribute(SZ._object, \""+attribs[i].getParamName()+"\",
0, (void*)&(param->"+attribs[i].getParamName()+"), "+ CUtils.getXSDTypeForBasicType(attribs[i].getTypeName())+");\n");
  +					writer.write("\tpSZ->_functions->SerializeAsAttribute(SZ._object, \""+attribs[i].getElementName().getLocalPart()+"\",
0, (void*)&(param->"+attribs[i].getParamName()+"), "+ CUtils.getXSDTypeForBasicType(attribs[i].getTypeName())+");\n");
   				}
   			}
   		}
  @@ -149,16 +149,16 @@
   				//if Array
   				arrayType = attribs[i].getTypeName();
   				if (attribs[i].isSimpleType()){
  -					writer.write("\tpSZ->_functions->SerializeBasicArray(SZ._object, (Axis_Array*)(&param->"+attribs[i].getParamName()+"),"+CUtils.getXSDTypeForBasicType(arrayType)+",
\""+attribs[i].getParamName()+"\");\n"); 
  +					writer.write("\tpSZ->_functions->SerializeBasicArray(SZ._object, (Axis_Array*)(&param->"+attribs[i].getParamName()+"),"+CUtils.getXSDTypeForBasicType(arrayType)+",
\""+attribs[i].getElementName().getLocalPart()+"\");\n"); 
   				}
   				else{
   					writer.write("\tpSZ->_functions->SerializeCmplxArray(SZ._object, (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\""+attribs[i].getElementName().getLocalPart()+"\", Axis_URI_"+arrayType+");\n");
   				}
   			}
   			else if (attribs[i].isSimpleType()){
  -				writer.write("\tpSZ->_functions->SerializeAsElement(SZ._object, \""+attribs[i].getParamName()+"\",
(void*)&(param->"+attribs[i].getParamName()+"), "+ CUtils.getXSDTypeForBasicType(attribs[i].getTypeName())+");\n");
  +				writer.write("\tpSZ->_functions->SerializeAsElement(SZ._object, \""+attribs[i].getElementName().getLocalPart()+"\",
(void*)&(param->"+attribs[i].getParamName()+"), "+ CUtils.getXSDTypeForBasicType(attribs[i].getTypeName())+");\n");
   			}else{
   				//if complex type
   				writer.write("\tpSZ->_functions->Serialize(SZ._object, \"<"+attribs[i].getParamName()+"\");\n");
  @@ -197,13 +197,13 @@
   				//if Array
   				String containedType = attribs[i].getTypeName();
   				if (attribs[i].isSimpleType()){
  -					writer.write("\tarray = DZ._functions->GetBasicArray(DZ._object, "+CUtils.getXSDTypeForBasicType(containedType)+
", \""+attribs[i].getParamName()+"\",0);\n");
  +					writer.write("\tarray = DZ._functions->GetBasicArray(DZ._object, "+CUtils.getXSDTypeForBasicType(containedType)+
", \""+attribs[i].getElementName().getLocalPart()+"\",0);\n");
   					writer.write("\tmemcpy(&(param->"+attribs[i].getParamName()+"), &array,
sizeof(Axis_Array));\n");
   				}
   				else{
   					writer.write("\tarray = DZ._functions->GetCmplxArray(DZ._object, (void*)Axis_DeSerialize_"+containedType+

   						"\n\t\t, (void*)Axis_Create_"+containedType+", (void*)Axis_Delete_"+containedType+
  -						"\n\t\t, (void*)Axis_GetSize_"+containedType+", \""+attribs[i].getParamName()+"\",
Axis_URI_"+containedType+");\n");
  +						"\n\t\t, (void*)Axis_GetSize_"+containedType+", \""+attribs[i].getElementName().getLocalPart()+"\",
Axis_URI_"+containedType+");\n");
   					writer.write("\tmemcpy(&(param->"+attribs[i].getParamName()+"), &array,
sizeof(Axis_Array));\n");
   				}
   			}else if(attribs[i].isSimpleType()){
  @@ -212,17 +212,17 @@
   					if (attribs[i].isOptional()){
   						//TODO
   					}else{
  -						writer.write("\tparam->"+attribs[i].getParamName()+" = DZ._functions->"+CUtils.getParameterGetValueMethodName(attribs[i].getTypeName(),
true)+"(DZ._object, \""+attribs[i].getParamName()+"\", 0);\n");
  +						writer.write("\tparam->"+attribs[i].getParamName()+" = DZ._functions->"+CUtils.getParameterGetValueMethodName(attribs[i].getTypeName(),
true)+"(DZ._object, \""+attribs[i].getElementName().getLocalPart()+"\", 0);\n");
   					}
   				}
   				else{
  -					writer.write("\tparam->"+attribs[i].getParamName()+" = DZ._functions->"+CUtils.getParameterGetValueMethodName(attribs[i].getTypeName(),
false)+"(DZ._object, \""+attribs[i].getParamName()+"\", 0);\n");
  +					writer.write("\tparam->"+attribs[i].getParamName()+" = DZ._functions->"+CUtils.getParameterGetValueMethodName(attribs[i].getTypeName(),
false)+"(DZ._object, \""+attribs[i].getElementName().getLocalPart()+"\", 0);\n");
   				}
   			}else{
   				//if complex type
   				writer.write("\tparam->"+attribs[i].getParamName()+" = ("+attribs[i].getTypeName()+"*)DZ._functions->GetCmplxObject(DZ._object,
(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, \""+attribs[i].getElementName().getLocalPart()+"\", Axis_URI_"+attribs[i].getTypeName()+");\n");
   			}		
   		}
   		writer.write("\treturn DZ._functions->GetStatus(DZ._object);\n");
  
  
  
  1.10      +3 -3      ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/ClientStubWriter.java
  
  Index: ClientStubWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/ClientStubWriter.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- ClientStubWriter.java	10 Feb 2004 15:04:22 -0000	1.9
  +++ ClientStubWriter.java	13 Feb 2004 07:00:29 -0000	1.10
  @@ -307,13 +307,13 @@
   			String containedType = null;
   			if (CUtils.isSimpleType(qname)){
   				containedType = CUtils.getclass4qname(qname);
  -				writer.write("\tarray = pCall->_functions->GetBasicArray(pCall->_object, "+CUtils.getXSDTypeForBasicType(containedType)+",
\""+returntype.getParamName()+"\", 0);\n");
  +				writer.write("\tarray = pCall->_functions->GetBasicArray(pCall->_object, "+CUtils.getXSDTypeForBasicType(containedType)+",
\""+returntype.getElementName().getLocalPart()+"\", 0);\n");
   				writer.write("\tmemcpy(&RetArray, &array, sizeof(Axis_Array));\n");
   			}
   			else{
   				containedType = qname.getLocalPart();
   				writer.write("\tarray = pCall->_functions->GetCmplxArray(pCall->_object, (void*)
Axis_DeSerialize_"+containedType);
  -				writer.write(", (void*) Axis_Create_"+containedType+", (void*) Axis_Delete_"+containedType+",
(void*) Axis_GetSize_"+containedType+", \""+returntype.getParamName()+"\", Axis_URI_"+containedType+");\n");
  +				writer.write(", (void*) Axis_Create_"+containedType+", (void*) Axis_Delete_"+containedType+",
(void*) Axis_GetSize_"+containedType+", \""+returntype.getElementName().getLocalPart()+"\",
Axis_URI_"+containedType+");\n");
   				writer.write("\tmemcpy(&RetArray, &array, sizeof(Axis_Array));\n");
   			}
   			writer.write("\t\t}\n");
  @@ -327,7 +327,7 @@
   			writer.write("\treturn Ret;\n");
   		}
   		else{
  -			writer.write("\t\t\tpReturn = ("+outparamType+"*)pCall->_functions->GetCmplxObject(pCall->_object,
(void*) Axis_DeSerialize_"+outparamType+", (void*) Axis_Create_"+outparamType+", (void*) Axis_Delete_"+outparamType+",\""+returntype.getParamName()+"\",
0);\n"); 
  +			writer.write("\t\t\tpReturn = ("+outparamType+"*)pCall->_functions->GetCmplxObject(pCall->_object,
(void*) Axis_DeSerialize_"+outparamType+", (void*) Axis_Create_"+outparamType+", (void*) Axis_Delete_"+outparamType+",\""+returntype.getElementName().getLocalPart()+"\",
0);\n"); 
   			writer.write("\t\t}\n");
   			writer.write("\t}\n\tpCall->_functions->UnInitialize(pCall->_object);\n");
   			writer.write("\treturn pReturn;\n");						
  
  
  
  1.9       +6 -4      ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/WrapWriter.java
  
  Index: WrapWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/WrapWriter.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- WrapWriter.java	9 Feb 2004 14:57:07 -0000	1.8
  +++ WrapWriter.java	13 Feb 2004 07:00:29 -0000	1.9
  @@ -264,6 +264,7 @@
   		writer.write("\tint nStatus;\n");
   		boolean aretherearrayparams = false;
   		String parameterName;
  +		String elementName;
   		for (int i = 0; i < paramsB.size(); i++) {
   			paraTypeName = ((ParameterInfo)paramsB.get(i)).getLangName();
   			if((CUtils.isSimpleType(((ParameterInfo)paramsB.get(i)).getLangName()))){
  @@ -290,29 +291,30 @@
   		for (int i = 0; i < paramsB.size(); i++) {
   			paraTypeName = ((ParameterInfo)paramsB.get(i)).getLangName();
   			parameterName = ((ParameterInfo)paramsB.get(i)).getParamName();
  +			elementName = ((ParameterInfo)paramsB.get(i)).getElementName().getLocalPart();
   			if((CUtils.isSimpleType(((ParameterInfo)paramsB.get(i)).getLangName()))){
   				//for simple types	
  -				writer.write("\tv"+i+" = DZ._functions->"+CUtils.getParameterGetValueMethodName(paraTypeName,
false)+"(DZ._object,\""+parameterName+"\", 0);\n");
  +				writer.write("\tv"+i+" = DZ._functions->"+CUtils.getParameterGetValueMethodName(paraTypeName,
false)+"(DZ._object,\""+elementName+"\", 0);\n");
   			}else if((type = this.wscontext.getTypemap().getType(((ParameterInfo)paramsB.get(i)).getSchemaName()))
!= null && type.isArray()){
   				QName qname = WrapperUtils.getArrayType(type).getName();
   				String containedType = null;
   				if (CUtils.isSimpleType(qname)){
   					containedType = CUtils.getclass4qname(qname);
  -					writer.write("\tarray = DZ._functions->GetBasicArray(DZ._object, "+CUtils.getXSDTypeForBasicType(containedType)+"\""+parameterName+"\",
0);\n");
  +					writer.write("\tarray = DZ._functions->GetBasicArray(DZ._object, "+CUtils.getXSDTypeForBasicType(containedType)+"\""+elementName+"\",
0);\n");
   					writer.write("\tmemcpy(&v"+i+", &array, sizeof(Axis_Array));\n");
   				}
   				else{
   					containedType = qname.getLocalPart();
   					writer.write("\tarray = DZ._functions->GetCmplxArray(DZ._object, (void*)Axis_DeSerialize_"+containedType+

   						"\n\t\t, (void*)Axis_Create_"+containedType+", (void*)Axis_Delete_"+containedType+
  -						"\n\t\t, (void*)Axis_GetSize_"+containedType+", \""+parameterName+"\", Axis_URI_"+containedType+");\n");
  +						"\n\t\t, (void*)Axis_GetSize_"+containedType+", \""+elementName+"\", Axis_URI_"+containedType+");\n");
   					writer.write("\tmemcpy(&v"+i+", &array, sizeof(Axis_Array));\n");
   				}
   			}else{
   				//for complex types 
   				writer.write("\tv"+i+" = ("+paraTypeName+"*)DZ._functions->GetCmplxObject(DZ._object,
(void*)Axis_DeSerialize_"+paraTypeName+
   					"\n\t\t, (void*)Axis_Create_"+paraTypeName+", (void*)Axis_Delete_"+paraTypeName+
  -					"\n\t\t,\""+parameterName+"\", Axis_URI_"+paraTypeName+");\n");
  +					"\n\t\t,\""+elementName+"\", Axis_URI_"+paraTypeName+");\n");
   			}
   		}
   		writer.write("\tif (AXIS_SUCCESS != (nStatus = DZ._functions->GetStatus(DZ._object)))
return nStatus;\n");				
  
  
  
  1.15      +1 -1      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.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- BeanParamWriter.java	20 Jan 2004 14:05:18 -0000	1.14
  +++ BeanParamWriter.java	13 Feb 2004 07:00:29 -0000	1.15
  @@ -216,7 +216,7 @@
   		writer.write("\t\t\t"+classname+"* pNew = new "+classname+"[nSize];\n");
   		writer.write("\t\t\tmemcpy(pNew, pObj, sizeof("+classname+")*nSize/2);\n");
   		writer.write("\t\t\tmemset(pObj, 0, sizeof("+classname+")*nSize/2);\n");
  -		writer.write("\t\t\tdelete [] pObj);\n");
  +		writer.write("\t\t\tdelete [] pObj;\n");
   		writer.write("\t\t\treturn pNew;\n\t\t}\n\t\telse\n\t\t{\n");
   		writer.write("\t\t\treturn new "+classname+"[nSize];\n\t\t}\n\t}\n");
   		writer.write("\telse\n\t\treturn new "+classname+";\n}\n\n");
  
  
  
  1.22      +1 -1      ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubWriter.java
  
  Index: ClientStubWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ClientStubWriter.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- ClientStubWriter.java	9 Feb 2004 14:57:07 -0000	1.21
  +++ ClientStubWriter.java	13 Feb 2004 07:00:30 -0000	1.22
  @@ -335,7 +335,7 @@
   			writer.write("\treturn RetArray;\n");
   		}
   		else if(returntypeissimple){
  -			writer.write("\t\t\tRet = m_pCall->"+ CUtils.getParameterGetValueMethodName(outparamType,
false)+"(\""+ returntype.getParamName()+"\", 0);\n\t\t}\n");
  +			writer.write("\t\t\tRet = m_pCall->"+ CUtils.getParameterGetValueMethodName(outparamType,
false)+"(\""+returntype.getElementName().getLocalPart()+"\", 0);\n\t\t}\n");
   			writer.write("\t}\n\tm_pCall->UnInitialize();\n");
   			writer.write("\treturn Ret;\n");
   		}
  
  
  
  1.7       +10 -10    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.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- BeanParamWriter.java	20 Jan 2004 14:05:18 -0000	1.6
  +++ BeanParamWriter.java	13 Feb 2004 07:00:30 -0000	1.7
  @@ -134,10 +134,10 @@
   			else{
   				if (attribs[i].isOptional()){
   					writer.write("\tif (0 != param->"+attribs[i].getParamName()+")\n");
  -					writer.write("\t\tpSZ->SerializeAsAttribute(\""+attribs[i].getParamName()+"\",
(void*)(param->"+attribs[i].getParamName()+"), "+ CUtils.getXSDTypeForBasicType(attribs[i].getTypeName())+");\n");
  +					writer.write("\t\tpSZ->SerializeAsAttribute(\""+attribs[i].getElementName().getLocalPart()+"\",
(void*)(param->"+attribs[i].getParamName()+"), "+ CUtils.getXSDTypeForBasicType(attribs[i].getTypeName())+");\n");
   				}
   				else{
  -					writer.write("\tpSZ->SerializeAsAttribute(\""+attribs[i].getParamName()+"\", (void*)&(param->"+attribs[i].getParamName()+"),
"+ CUtils.getXSDTypeForBasicType(attribs[i].getTypeName())+");\n");				
  +					writer.write("\tpSZ->SerializeAsAttribute(\""+attribs[i].getElementName().getLocalPart()+"\",
(void*)&(param->"+attribs[i].getParamName()+"), "+ CUtils.getXSDTypeForBasicType(attribs[i].getTypeName())+");\n");
			
   				}
   			}
   		}
  @@ -147,17 +147,17 @@
   			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].getParamName()+"),"+CUtils.getXSDTypeForBasicType(attribs[i].getTypeName())+",
\""+attribs[i].getElementName().getLocalPart()+"\");\n"); 
   				}
   				else{
   					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\""+attribs[i].getElementName().getLocalPart()+"\", Axis_URI_"+arrayType+");\n");
   				}
   			}
   			else if (attribs[i].isSimpleType()){
  -				writer.write("\tpSZ->SerializeAsElement(\""+attribs[i].getParamName()+"\", (void*)&(param->"+attribs[i].getParamName()+"),
"+ CUtils.getXSDTypeForBasicType(attribs[i].getTypeName())+");\n");				
  +				writer.write("\tpSZ->SerializeAsElement(\""+attribs[i].getElementName().getLocalPart()+"\",
(void*)&(param->"+attribs[i].getParamName()+"), "+ CUtils.getXSDTypeForBasicType(attribs[i].getTypeName())+");\n");
			
   			}else{
   				//if complex type
   				writer.write("\tpSZ->Serialize(\"<"+attribs[i].getParamName()+"\", 0);\n");
  @@ -184,22 +184,22 @@
   			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].getParamName()+" = ("+CUtils.getBasicArrayNameforType(attribs[i].getTypeName())+"&)pIWSDZ->GetBasicArray("+CUtils.getXSDTypeForBasicType(attribs[i].getTypeName())+
", \""+attribs[i].getElementName().getLocalPart()+"\",0);\n");
   				}
   				else{
   					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+", \""+attribs[i].getElementName().getLocalPart()+"\",
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].getParamName()+" = pIWSDZ->"+CUtils.getParameterGetValueMethodName(attribs[i].getTypeName(),
attribs[i].isAttribute())+"(\""+attribs[i].getElementName().getLocalPart()+"\",0);\n");
   			} else{
   				//if complex type
   				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, \""+attribs[i].getElementName().getLocalPart()+"\", Axis_URI_"+attribs[i].getTypeName()+");\n");
			
   			}		
   		}
   		writer.write("\treturn pIWSDZ->GetStatus();\n");
  @@ -212,7 +212,7 @@
   		writer.write("\t\t\t"+classname+"* pNew = new "+classname+"[nSize];\n");
   		writer.write("\t\t\tmemcpy(pNew, pObj, sizeof("+classname+")*nSize/2);\n");
   		writer.write("\t\t\tmemset(pObj, 0, sizeof("+classname+")*nSize/2);\n");
  -		writer.write("\t\t\tdelete [] pObj);\n");
  +		writer.write("\t\t\tdelete [] pObj;\n");
   		writer.write("\t\t\treturn pNew;\n\t\t}\n\t\telse\n\t\t{\n");
   		writer.write("\t\t\treturn new "+classname+"[nSize];\n\t\t}\n\t}\n");
   		writer.write("\telse\n\t\treturn new "+classname+";\n}\n\n");
  
  
  
  1.7       +8 -8      ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubWriter.java
  
  Index: ClientStubWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ClientStubWriter.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ClientStubWriter.java	9 Feb 2004 14:57:07 -0000	1.6
  +++ ClientStubWriter.java	13 Feb 2004 07:00:30 -0000	1.7
  @@ -268,15 +268,15 @@
   				//TODO initialize return parameter appropriately.
   			}
   		}
  -		writer.write("\tif (AXIS_SUCCESS != m_pCall->Initialize(CPP_RPC_PROVIDER)) return
");
  +		writer.write("\tif (AXIS_SUCCESS != m_pCall->Initialize(CPP_DOC_PROVIDER)) return
");
   		if (returntype != null){
   			writer.write((returntypeisarray?"RetArray":returntypeissimple?"Ret":"pReturn")+";\n\t");
   		}
   		else{
  -			writer.write(";\n\t");
  +			writer.write(";\n");
   		}
   		writer.write("\tm_pCall->SetTransportProperty(SOAPACTION_HEADER , \""+minfo.getSoapAction()+"\");\n");
  -		writer.write("m_pCall->SetSOAPVersion(SOAP_VER_1_1);\n"); //TODO check which version
is it really.
  +		writer.write("\tm_pCall->SetSOAPVersion(SOAP_VER_1_1);\n"); //TODO check which version
is it really.
   		writer.write("\tm_pCall->SetOperation(\""+minfo.getInputMessage().getLocalPart()+"\",
\""+ minfo.getInputMessage().getNamespaceURI()+"\");\n");
   		for (int i = 0; i < paramsB.size(); i++) {
   			type = wscontext.getTypemap().getType(((ParameterInfo)paramsB.get(i)).getSchemaName());
  @@ -315,7 +315,7 @@
   			writer.write(");\n");
   		}
   		writer.write("\tif (AXIS_SUCCESS == m_pCall->Invoke())\n\t{\n");
  -		writer.write("\t\tif(AXIS_SUCCESS != m_pCall->CheckMessage(\""+minfo.getOutputMessage().getLocalPart()+"\",
\""+minfo.getOutputMessage().getNamespaceURI()+"\"))\n\t\t{\n");
  +		writer.write("\t\tif(AXIS_SUCCESS == m_pCall->CheckMessage(\""+minfo.getOutputMessage().getLocalPart()+"\",
\""+minfo.getOutputMessage().getNamespaceURI()+"\"))\n\t\t{\n");
   		if (returntype == null){
   			writer.write("\t\t\t/*not successful*/\n\t\t}\n");
			writer.write("\t}\n\tm_pCall->UnInitialize();\n");
   		}
  @@ -324,23 +324,23 @@
   			String containedType = null;
   			if (CUtils.isSimpleType(qname)){
   				containedType = CUtils.getclass4qname(qname);
  -				writer.write("\tRetArray = ("+outparamType+"&)m_pCall->GetBasicArray("+CUtils.getXSDTypeForBasicType(containedType)+",
\""+returntype.getParamName()+"\", 0);\n\t\t}\n");
  +				writer.write("\tRetArray = ("+outparamType+"&)m_pCall->GetBasicArray("+CUtils.getXSDTypeForBasicType(containedType)+",
\""+returntype.getElementName().getLocalPart()+"\", 0);\n\t\t}\n");
   			}
   			else{
   				containedType = qname.getLocalPart();
   				writer.write("\tRetArray = ("+outparamType+"&)m_pCall->GetCmplxArray((void*)
Axis_DeSerialize_"+containedType);
  -				writer.write(", (void*) Axis_Create_"+containedType+", (void*) Axis_Delete_"+containedType+",
(void*) Axis_GetSize_"+containedType+", \""+returntype.getParamName()+"\", Axis_URI_"+containedType+");\n\t\t}\n");
  +				writer.write(", (void*) Axis_Create_"+containedType+", (void*) Axis_Delete_"+containedType+",
(void*) Axis_GetSize_"+containedType+", \""+returntype.getElementName().getLocalPart()+"\",
Axis_URI_"+containedType+");\n\t\t}\n");
   			}
   			writer.write("\t}\n\tm_pCall->UnInitialize();\n");
   			writer.write("\treturn RetArray;\n");
   		}
   		else if(returntypeissimple){
  -			writer.write("\t\t\tRet = m_pCall->"+ CUtils.getParameterGetValueMethodName(outparamType,
false)+"(\""+ returntype.getParamName()+"\", 0);\n\t\t}\n");
  +			writer.write("\t\t\tRet = m_pCall->"+ CUtils.getParameterGetValueMethodName(outparamType,
false)+"(\""+returntype.getElementName().getLocalPart()+"\", 0);\n\t\t}\n");
   			writer.write("\t}\n\tm_pCall->UnInitialize();\n");
   			writer.write("\treturn Ret;\n");
   		}
   		else{
  -			writer.write("\t\t\tpReturn = ("+outparamType+"*)m_pCall->GetCmplxObject((void*)
Axis_DeSerialize_"+outparamType+", (void*) Axis_Create_"+outparamType+", (void*) Axis_Delete_"+outparamType+",\""+returntype.getParamName()+"\",
0);\n\t\t}\n"); 
  +			writer.write("\t\t\tpReturn = ("+outparamType+"*)m_pCall->GetCmplxObject((void*)
Axis_DeSerialize_"+outparamType+", (void*) Axis_Create_"+outparamType+", (void*) Axis_Delete_"+outparamType+",\""+returntype.getElementName().getLocalPart()+"\",
0);\n\t\t}\n"); 
   			writer.write("\t}\n\tm_pCall->UnInitialize();\n");
   			writer.write("\treturn pReturn;\n");						
   		}
  
  
  
  1.7       +6 -4      ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/WrapWriter.java
  
  Index: WrapWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/WrapWriter.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- WrapWriter.java	21 Jan 2004 07:43:15 -0000	1.6
  +++ WrapWriter.java	13 Feb 2004 07:00:30 -0000	1.7
  @@ -257,32 +257,34 @@
   		//create and populate variables for each parameter
   		String paraTypeName;
   		String parameterName;
  +		String elementName;
   		ArrayList paramsB = new ArrayList(params);
   		for (int i = 0; i < paramsB.size(); i++) {
   			paraTypeName = ((ParameterInfo)paramsB.get(i)).getLangName();
   			parameterName = ((ParameterInfo)paramsB.get(i)).getParamName();
  +			elementName = ((ParameterInfo)paramsB.get(i)).getElementName().getLocalPart();
   			Type type;
   			if((CUtils.isSimpleType(((ParameterInfo)paramsB.get(i)).getLangName()))){
   				//for simple types	
  -				writer.write("\t"+paraTypeName+" v"+i+" = pIWSDZ->"+CUtils.getParameterGetValueMethodName(paraTypeName,
false)+"(\""+parameterName+"\",0);\n");
  +				writer.write("\t"+paraTypeName+" v"+i+" = pIWSDZ->"+CUtils.getParameterGetValueMethodName(paraTypeName,
false)+"(\""+elementName+"\",0);\n");
   			}else if((type = this.wscontext.getTypemap().getType(((ParameterInfo)paramsB.get(i)).getSchemaName()))
!= null && type.isArray()){
   				QName qname = WrapperUtils.getArrayType(type).getName();
   				String containedType = null;
   				if (CUtils.isSimpleType(qname)){
   					containedType = CUtils.getclass4qname(qname);
  -					writer.write("\t"+paraTypeName+" v"+i+" = ("+CUtils.getBasicArrayNameforType(containedType)+"&)pIWSDZ->GetBasicArray("+CUtils.getXSDTypeForBasicType(containedType)+
", \""+parameterName+"\",0);\n");
  +					writer.write("\t"+paraTypeName+" v"+i+" = ("+CUtils.getBasicArrayNameforType(containedType)+"&)pIWSDZ->GetBasicArray("+CUtils.getXSDTypeForBasicType(containedType)+
", \""+elementName+"\",0);\n");
   				}
   				else{
   					containedType = qname.getLocalPart();
   					writer.write("\t"+paraTypeName+" v"+i+" = ("+paraTypeName+"&)pIWSDZ->GetCmplxArray((void*)Axis_DeSerialize_"+containedType+

   						"\n\t\t, (void*)Axis_Create_"+containedType+", (void*)Axis_Delete_"+containedType+
  -						"\n\t\t, (void*)Axis_GetSize_"+containedType+", \""+parameterName+"\", Axis_URI_"+containedType+");\n");
  +						"\n\t\t, (void*)Axis_GetSize_"+containedType+", \""+elementName+"\", Axis_URI_"+containedType+");\n");
   				}
   			}else{
   				//for complex types 
   				writer.write("\t"+paraTypeName+" *v"+i+" = ("+paraTypeName+"*)pIWSDZ->GetCmplxObject((void*)Axis_DeSerialize_"+paraTypeName+
   					"\n\t\t, (void*)Axis_Create_"+paraTypeName+", (void*)Axis_Delete_"+paraTypeName+
  -					"\n\t\t, \""+parameterName+"\", Axis_URI_"+paraTypeName+");\n");				
  +					"\n\t\t, \""+elementName+"\", Axis_URI_"+paraTypeName+");\n");				
   			}
   		}
   		writer.write("\tif (AXIS_SUCCESS != (nStatus = pIWSDZ->GetStatus())) return nStatus;\n");
  
  
  

Mime
View raw message