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 ServiceHeaderWriter.java ServiceWriter.java WrapWriter.java
Date Fri, 20 Feb 2004 13:37:44 GMT
susantha    2004/02/20 05:37:44

  Modified:    c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c ServiceWriter.java
                        WrapWriter.java
               c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal
                        ServiceWriter.java WrapWriter.java
               c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp
                        ServiceHeaderWriter.java ServiceWriter.java
                        WrapWriter.java
               c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal
                        ServiceHeaderWriter.java ServiceWriter.java
                        WrapWriter.java
  Log:
  improved WSDL2Ws tool to generate the server side code when
  there are multiple return parameters
  
  Revision  Changes    Path
  1.8       +1 -1      ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ServiceWriter.java
  
  Index: ServiceWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/ServiceWriter.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ServiceWriter.java	28 Jan 2004 10:19:15 -0000	1.7
  +++ ServiceWriter.java	20 Feb 2004 13:37:44 -0000	1.8
  @@ -144,7 +144,7 @@
   					params = minfo.getOutputParameterTypes().iterator();
   					for(int j =0; params.hasNext();j++){
   						ParameterInfo nparam = (ParameterInfo)params.next();
  -						writer.write(", AXIS_OUT_PARAM"+WrapperUtils.getClassNameFromParamInfoConsideringArrays(nparam,wscontext)+"
*OutValue"+j);
  +						writer.write(", AXIS_OUT_PARAM "+WrapperUtils.getClassNameFromParamInfoConsideringArrays(nparam,wscontext)+"
*OutValue"+j);
   					}					
   				}
   				writer.write(")\n{\n}\n");
  
  
  
  1.20      +63 -2     ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/WrapWriter.java
  
  Index: WrapWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/WrapWriter.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- WrapWriter.java	9 Feb 2004 14:57:07 -0000	1.19
  +++ WrapWriter.java	20 Feb 2004 13:37:44 -0000	1.20
  @@ -212,12 +212,11 @@
   		}
   		else{
   			isAllTreatedAsOutParams = true;
  -			//TODO make all outparams when there are more than one return params
  -			throw new WrapperFault("WSDL2Ws does not still handle more than one return parameters");
   		}
   		Collection params = minfo.getInputParameterTypes();
   		String methodName = minfo.getMethodname();
   		Type retType = null;
  +		String outparamType = null;		
   		String outparamTypeName = null;
   		boolean returntypeissimple = false;
   		boolean returntypeisarray = false;
  @@ -233,6 +232,7 @@
   			}
   		}
   		String paramTypeName;
  +		String returnParamName;
   		ArrayList paramsB = new ArrayList(params);
   		Type type;
   
  @@ -253,6 +253,13 @@
   				aretherearrayparams = true;
   			}
   		}
  +		if ( isAllTreatedAsOutParams ) {
  +			ArrayList paramsC = (ArrayList)minfo.getOutputParameterTypes();
  +			for (int i = 0; i < paramsC.size(); i++) {
  +				type = wscontext.getTypemap().getType(((ParameterInfo)paramsC.get(i)).getSchemaName());
  +				writer.write(", AXIS_OUT_PARAM "+WrapperUtils.getClassNameFromParamInfoConsideringArrays((ParameterInfo)paramsC.get(i),wscontext)+"*");
  +			}
  +		}
   		writer.write(");\n");
   		writer.write("\n/*\n");
   		writer.write(" * This method wrap the service method \n");
  @@ -270,6 +277,14 @@
   		if (aretherearrayparams){
   			writer.write("\tAxis_Array array;\n");
   		}
  +		// Multiples parameters so fill the methods prototype
  +		if ( isAllTreatedAsOutParams ) {
  +			ArrayList paramsC = (ArrayList)minfo.getOutputParameterTypes();
  +			for (int i = 0; i < paramsC.size(); i++) {
  +				type = wscontext.getTypemap().getType(((ParameterInfo)paramsC.get(i)).getSchemaName());
  +				writer.write("\t"+WrapperUtils.getClassNameFromParamInfoConsideringArrays((ParameterInfo)paramsC.get(i),wscontext)+"
out"+i+";\n");
  +			}
  +		}	
   		writer.write("\tif (AXIS_SUCCESS != DZ._functions->CheckMessageBody(DZ._object, \""+methodName+"\",
\""+wscontext.getWrapInfo().getTargetNameSpaceOfWSDL()+"\")) return AXIS_FAIL;\n");
   		writer.write("\tSZ._functions->CreateSoapMethod(SZ._object, \""+methodName+"Response\",
\""+wscontext.getWrapInfo().getTargetNameSpaceOfWSDL()+"\");\n");
   		//create and populate variables for each parameter
  @@ -332,6 +347,52 @@
   				outparamTypeName = returntype.getLangName();//need to have complex type name without
*
   				writer.write("\treturn SZ._functions->AddOutputCmplxParam(SZ._object, ret, (void*)Axis_Serialize_"+outparamTypeName+",
(void*)Axis_Delete_"+outparamTypeName+", \""+methodName+"Return\", 0);\n");
   			}
  +		}else if (isAllTreatedAsOutParams){
  +			writer.write("\t" + methodName + "(");
  +			if (0<paramsB.size()){
  +				for (int i = 0; i <  paramsB.size(); i++) {
  +					writer.write("v" + i + ",");
  +				}
  +			}
  +			ArrayList paramsC = (ArrayList)minfo.getOutputParameterTypes();
  +			for (int i = 0; i < paramsC.size()-1; i++) {
  +				writer.write("&out" + i +",");
  +			}
  +			writer.write("&out" + ( paramsC.size()-1));
  +			writer.write(");\n");
  +			paramsC = (ArrayList)minfo.getOutputParameterTypes();
  +			for (int i = 0; i < paramsC.size(); i++) {
  +				retType = wscontext.getTypemap().getType(((ParameterInfo)paramsC.get(i)).getSchemaName());
  +				if (retType != null){
  +					outparamType = retType.getLanguageSpecificName();
  +					returntypeisarray = retType.isArray();
  +				}
  +				else{
  +					outparamType = returntype.getLangName();
  +				}
  +				returntypeissimple = CUtils.isSimpleType(outparamType);
  +				returnParamName = ((ParameterInfo)paramsC.get(i)).getParamName();
  +				if (returntypeissimple){
  +					writer.write("\tSZ._functions->AddOutputParam(SZ._object, \""+returnParamName+"\",
(void*)&out"+i+", "+CUtils.getXSDTypeForBasicType(outparamType)+");\n");
  +				}else if(returntypeisarray){
  +					QName qname = WrapperUtils.getArrayType(retType).getName();
  +					String containedType = null;
  +					if (CUtils.isSimpleType(qname)){
  +						containedType = CUtils.getclass4qname(qname);
  +						writer.write("\tSZ._functions->AddOutputBasicArrayParam(SZ._object, (Axis_Array*)(&out"+i+"),
"+CUtils.getXSDTypeForBasicType(containedType)+ ", \""+returnParamName+"\");\n");
  +					}
  +					else{
  +						containedType = qname.getLocalPart();
  +						writer.write("\tSZ._functions->AddOutputCmplxArrayParam(SZ._object, (Axis_Array*)(&out"+i+"),"+

  +						"(void*) Axis_Serialize_"+containedType+", (void*) Axis_Delete_"+containedType+",
(void*) Axis_GetSize_"+containedType+", \""+returnParamName+"\", Axis_URI_"+containedType+");\n");
  +					}
  +				}
  +				else{
  +					//complex type
  +					writer.write("\tSZ._functions->AddOutputCmplxParam(SZ._object, out"+i+", (void*)Axis_Serialize_"+outparamType+",
(void*)Axis_Delete_"+outparamType+", \""+returnParamName+"\", Axis_URI_"+outparamType+");\n");
  +				}
  +			}			
  +			writer.write("\treturn AXIS_SUCCESS;\n");
   		}else{//method does not return anything
   			/* Invoke the service when return type is void */
   			writer.write("\t" + methodName + "(");
  
  
  
  1.4       +1 -1      ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/ServiceWriter.java
  
  Index: ServiceWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/c/literal/ServiceWriter.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ServiceWriter.java	12 Jan 2004 12:20:56 -0000	1.3
  +++ ServiceWriter.java	20 Feb 2004 13:37:44 -0000	1.4
  @@ -144,7 +144,7 @@
   					params = minfo.getOutputParameterTypes().iterator();
   					for(int j =0; params.hasNext();j++){
   						ParameterInfo nparam = (ParameterInfo)params.next();
  -						writer.write(", AXIS_OUT_PARAM"+WrapperUtils.getClassNameFromParamInfoConsideringArrays(nparam,wscontext)+"
*OutValue"+j);
  +						writer.write(", AXIS_OUT_PARAM "+WrapperUtils.getClassNameFromParamInfoConsideringArrays(nparam,wscontext)+"
*OutValue"+j);
   					}
   				}
   				writer.write(")\n{\n}\n");
  
  
  
  1.11      +63 -1     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.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- WrapWriter.java	17 Feb 2004 12:47:44 -0000	1.10
  +++ WrapWriter.java	20 Feb 2004 13:37:44 -0000	1.11
  @@ -255,6 +255,13 @@
   				writer.write(paraTypeName+"*");
   			}
   		}
  +		if ( isAllTreatedAsOutParams ) {
  +			ArrayList paramsC = (ArrayList)minfo.getOutputParameterTypes();
  +			for (int i = 0; i < paramsC.size(); i++) {
  +				type = wscontext.getTypemap().getType(((ParameterInfo)paramsC.get(i)).getSchemaName());
  +				writer.write(", AXIS_OUT_PARAM "+WrapperUtils.getClassNameFromParamInfoConsideringArrays((ParameterInfo)paramsC.get(i),wscontext)+"*");
  +			}
  +		}		
   		writer.write(");\n");
   		writer.write("\n/*\n");
   		writer.write(" * This method wrap the service method \n");
  @@ -265,6 +272,7 @@
   		boolean aretherearrayparams = false;
   		String parameterName;
   		String elementName;
  +		String returnParamName;
   		for (int i = 0; i < paramsB.size(); i++) {
   			paraTypeName = ((ParameterInfo)paramsB.get(i)).getLangName();
   			if((CUtils.isSimpleType(((ParameterInfo)paramsB.get(i)).getLangName()))){
  @@ -285,6 +293,14 @@
   		if (aretherearrayparams){
   			writer.write("\tAxis_Array array;\n");
   		}
  +		// Multiples parameters so fill the methods prototype
  +		if ( isAllTreatedAsOutParams ) {
  +			ArrayList paramsC = (ArrayList)minfo.getOutputParameterTypes();
  +			for (int i = 0; i < paramsC.size(); i++) {
  +				type = wscontext.getTypemap().getType(((ParameterInfo)paramsC.get(i)).getSchemaName());
  +				writer.write("\t"+WrapperUtils.getClassNameFromParamInfoConsideringArrays((ParameterInfo)paramsC.get(i),wscontext)+"
out"+i+";\n");
  +			}
  +		}	
   		writer.write("\tif (AXIS_SUCCESS != DZ._functions->CheckMessageBody(DZ._object, \""+minfo.getInputMessage().getLocalPart()+"\",
\""+minfo.getInputMessage().getNamespaceURI()+"\")) return AXIS_FAIL;\n");
   		writer.write("\tpSZ->_functions->CreateSoapMethod(SZ._object, \""+minfo.getOutputMessage().getLocalPart()+"\",
\""+minfo.getOutputMessage().getNamespaceURI()+"\");\n");
   		//create and populate variables for each parameter
  @@ -319,7 +335,7 @@
   		}
   		writer.write("\tif (AXIS_SUCCESS != (nStatus = DZ._functions->GetStatus(DZ._object)))
return nStatus;\n");				
   		if(returntype != null){
  -			String returnParamName = returntype.getElementName().getLocalPart();
  +			returnParamName = returntype.getElementName().getLocalPart();
   			/* Invoke the service when return type not void */
   			writer.write("\tret = "+methodName+"(");
   			if (0<paramsB.size()){
  @@ -349,6 +365,52 @@
   				//complex type
   				writer.write("\treturn pSZ->_functions->AddOutputCmplxParam(SZ._object, ret,
(void*)Axis_Serialize_"+outparamType+", (void*)Axis_Delete_"+outparamType+", \""+returnParamName+"\",
Axis_URI_"+outparamType+");\n");
   			}
  +		}else if (isAllTreatedAsOutParams){
  +			writer.write("\t" + methodName + "(");
  +			if (0<paramsB.size()){
  +				for (int i = 0; i <  paramsB.size(); i++) {
  +					writer.write("v" + i + ",");
  +				}
  +			}
  +			ArrayList paramsC = (ArrayList)minfo.getOutputParameterTypes();
  +			for (int i = 0; i < paramsC.size()-1; i++) {
  +				writer.write("&out" + i +",");
  +			}
  +			writer.write("&out" + ( paramsC.size()-1));
  +			writer.write(");\n");
  +			paramsC = (ArrayList)minfo.getOutputParameterTypes();
  +			for (int i = 0; i < paramsC.size(); i++) {
  +				retType = wscontext.getTypemap().getType(((ParameterInfo)paramsC.get(i)).getSchemaName());
  +				if (retType != null){
  +					outparamType = retType.getLanguageSpecificName();
  +					returntypeisarray = retType.isArray();
  +				}
  +				else{
  +					outparamType = returntype.getLangName();
  +				}
  +				returntypeissimple = CUtils.isSimpleType(outparamType);
  +				returnParamName = ((ParameterInfo)paramsC.get(i)).getParamName();
  +				if (returntypeissimple){
  +					writer.write("\tSZ._functions->AddOutputParam(SZ._object, \""+returnParamName+"\",
(void*)&out"+i+", "+CUtils.getXSDTypeForBasicType(outparamType)+");\n");
  +				}else if(returntypeisarray){
  +					QName qname = WrapperUtils.getArrayType(retType).getName();
  +					String containedType = null;
  +					if (CUtils.isSimpleType(qname)){
  +						containedType = CUtils.getclass4qname(qname);
  +						writer.write("\tSZ._functions->AddOutputBasicArrayParam(SZ._object, (Axis_Array*)(&out"+i+"),
"+CUtils.getXSDTypeForBasicType(containedType)+ ", \""+returnParamName+"\");\n");
  +					}
  +					else{
  +						containedType = qname.getLocalPart();
  +						writer.write("\tSZ._functions->AddOutputCmplxArrayParam(SZ._object, (Axis_Array*)(&out"+i+"),"+

  +						"(void*) Axis_Serialize_"+containedType+", (void*) Axis_Delete_"+containedType+",
(void*) Axis_GetSize_"+containedType+", \""+returnParamName+"\", Axis_URI_"+containedType+");\n");
  +					}
  +				}
  +				else{
  +					//complex type
  +					writer.write("\tSZ._functions->AddOutputCmplxParam(SZ._object, out"+i+", (void*)Axis_Serialize_"+outparamType+",
(void*)Axis_Delete_"+outparamType+", \""+returnParamName+"\", Axis_URI_"+outparamType+");\n");
  +				}
  +			}			
  +			writer.write("\treturn AXIS_SUCCESS;\n");
   		}else{//method does not return anything
   			/* Invoke the service when return type is void */
   			writer.write("\t" + methodName + "(");
  
  
  
  1.12      +1 -1      ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ServiceHeaderWriter.java
  
  Index: ServiceHeaderWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ServiceHeaderWriter.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- ServiceHeaderWriter.java	15 Jan 2004 13:45:24 -0000	1.11
  +++ ServiceHeaderWriter.java	20 Feb 2004 13:37:44 -0000	1.12
  @@ -178,7 +178,7 @@
   					params = minfo.getOutputParameterTypes().iterator();
   					for(int j =0; params.hasNext();j++){
   						ParameterInfo nparam = (ParameterInfo)params.next();
  -						writer.write(", AXIS_OUT_PARAM"+WrapperUtils.getClassNameFromParamInfoConsideringArrays(nparam,wscontext)+"
*OutValue"+j);
  +						writer.write(", AXIS_OUT_PARAM "+WrapperUtils.getClassNameFromParamInfoConsideringArrays(nparam,wscontext)+"
*OutValue"+j);
   					}
   				}			  	
   			  	writer.write(");\n");
  
  
  
  1.9       +1 -1      ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ServiceWriter.java
  
  Index: ServiceWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/ServiceWriter.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ServiceWriter.java	15 Jan 2004 13:45:24 -0000	1.8
  +++ ServiceWriter.java	20 Feb 2004 13:37:44 -0000	1.9
  @@ -166,7 +166,7 @@
   					params = minfo.getOutputParameterTypes().iterator();
   					for(int j =0; params.hasNext();j++){
   						ParameterInfo nparam = (ParameterInfo)params.next();
  -						writer.write(", AXIS_OUT_PARAM"+WrapperUtils.getClassNameFromParamInfoConsideringArrays(nparam,wscontext)+"
*OutValue"+j);
  +						writer.write(", AXIS_OUT_PARAM "+WrapperUtils.getClassNameFromParamInfoConsideringArrays(nparam,wscontext)+"
*OutValue"+j);
   					}
   				}
   				writer.write(")\n{\n}\n");
  
  
  
  1.17      +61 -7     ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/WrapWriter.java
  
  Index: WrapWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/WrapWriter.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- WrapWriter.java	21 Jan 2004 07:43:15 -0000	1.16
  +++ WrapWriter.java	20 Feb 2004 13:37:44 -0000	1.17
  @@ -219,12 +219,11 @@
   		}
   		else{
   			isAllTreatedAsOutParams = true;
  -			//TODO make all outparams when there are more than one return params
  -			throw new WrapperFault("WSDL2Ws does not still handle more than one return parameters");
   		}
   		Collection params = minfo.getInputParameterTypes();
   		String methodName = minfo.getMethodname();
   		Type retType = null;
  +		Type type;
   		String outparamType = null;
   		boolean returntypeissimple = false;
   		boolean returntypeisarray = false;
  @@ -257,11 +256,11 @@
   		//create and populate variables for each parameter
   		String paraTypeName;
   		String parameterName;
  +		String returnParamName;
   		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();
  -			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");
  @@ -286,6 +285,14 @@
   			}
   		}
   		writer.write("\tif (AXIS_SUCCESS != (nStatus = pIWSDZ->GetStatus())) return nStatus;\n");
		
  +		// Multiples parameters so fill the methods prototype
  +		if ( isAllTreatedAsOutParams ) {
  +			ArrayList paramsC = (ArrayList)minfo.getOutputParameterTypes();
  +			for (int i = 0; i < paramsC.size(); i++) {
  +				type = wscontext.getTypemap().getType(((ParameterInfo)paramsC.get(i)).getSchemaName());
  +				writer.write("\t"+WrapperUtils.getClassNameFromParamInfoConsideringArrays((ParameterInfo)paramsC.get(i),wscontext)+"
out"+i+";\n");
  +			}
  +		}
   		if(returntype != null){				
   			/* Invoke the service when return type not void */
   			writer.write("\t"+outparamType+((returntypeisarray || returntypeissimple)?" ":" *")+
"ret = "+"pWs->"+methodName+"(");
  @@ -304,18 +311,65 @@
   				String containedType = null;
   				if (CUtils.isSimpleType(qname)){
   					containedType = CUtils.getclass4qname(qname);
  -					writer.write("\treturn pIWSSZ->AddOutputBasicArrayParam(\""+methodName+"Return\",
(Axis_Array*)(&ret),"+CUtils.getXSDTypeForBasicType(containedType)+");\n");
  +					writer.write("\treturn pIWSSZ->AddOutputBasicArrayParam((Axis_Array*)(&ret),"+CUtils.getXSDTypeForBasicType(containedType)+",
\""+methodName+"Return\");\n");
   				}
   				else{
   					containedType = qname.getLocalPart();
  -					writer.write("\treturn pIWSSZ->AddOutputParam(\""+methodName+"Return\", (Axis_Array*)(&ret),"+

  -					"(void*) Axis_Serialize_"+containedType+", (void*) Axis_Delete_"+containedType+",
(void*) Axis_GetSize_"+containedType+", Axis_TypeName_"+containedType+", Axis_URI_"+containedType+");\n");
  +					writer.write("\treturn pIWSSZ->AddOutputCmplxArrayParam((Axis_Array*)(&ret),"+

  +					"(void*) Axis_Serialize_"+containedType+", (void*) Axis_Delete_"+containedType+",
(void*) Axis_GetSize_"+containedType+", \""+methodName+"Return\", 0);\n");
   				}
   			}
   			else{
   				//complex type
  -				writer.write("\treturn pIWSSZ->AddOutputParam(\""+methodName+"Return\", ret, (void*)Axis_Serialize_"+outparamType+",
(void*)Axis_Delete_"+outparamType+");\n");
  +				writer.write("\treturn pIWSSZ->AddOutputCmplxParam(ret, (void*)Axis_Serialize_"+outparamType+",
(void*)Axis_Delete_"+outparamType+", \""+methodName+"Return\", 0);\n");
  +			}
  +		}else if (isAllTreatedAsOutParams){
  +			writer.write("\tpWs->" + methodName + "(");
  +			if (0<paramsB.size()){
  +				for (int i = 0; i <  paramsB.size(); i++) {
  +					writer.write("v" + i + ",");
  +				}
  +			}
  +			ArrayList paramsC = (ArrayList)minfo.getOutputParameterTypes();
  +			for (int i = 0; i < paramsC.size()-1; i++) {
  +				writer.write("&out" + i+",");
   			}
  +			writer.write("&out" + (paramsC.size()-1));
  +
  +			writer.write(");\n");
  +			paramsC = (ArrayList)minfo.getOutputParameterTypes();
  +			for (int i = 0; i < paramsC.size(); i++) {
  +				retType = wscontext.getTypemap().getType(((ParameterInfo)paramsC.get(i)).getSchemaName());
  +				if (retType != null){
  +					outparamType = retType.getLanguageSpecificName();
  +					returntypeisarray = retType.isArray();
  +				}
  +				else{
  +					outparamType = returntype.getLangName();
  +				}
  +				returntypeissimple = CUtils.isSimpleType(outparamType);
  +				returnParamName = ((ParameterInfo)paramsC.get(i)).getParamName();
  +				if (returntypeissimple){
  +					writer.write("\tpIWSSZ->AddOutputParam(\""+returnParamName+"\", (void*)&out"+i+",
"+CUtils.getXSDTypeForBasicType(outparamType)+");\n");
  +				}else if(returntypeisarray){
  +					QName qname = WrapperUtils.getArrayType(retType).getName();
  +					String containedType = null;
  +					if (CUtils.isSimpleType(qname)){
  +						containedType = CUtils.getclass4qname(qname);
  +						writer.write("\tpIWSSZ->AddOutputBasicArrayParam((Axis_Array*)(&out"+i+"),"+CUtils.getXSDTypeForBasicType(containedType)+",
\""+returnParamName+"\");\n");
  +					}
  +					else{
  +						containedType = qname.getLocalPart();
  +						writer.write("\tpIWSSZ->AddOutputCmplxArrayParam((Axis_Array*)(&out"+i+"),"+

  +						"(void*) Axis_Serialize_"+containedType+", (void*) Axis_Delete_"+containedType+",
(void*) Axis_GetSize_"+containedType+", \""+returnParamName+"\", 0);\n");
  +					}
  +				}
  +				else{
  +					//complex type
  +					writer.write("\tpIWSSZ->AddOutputCmplxParam(out"+i+", (void*)Axis_Serialize_"+outparamType+",
(void*)Axis_Delete_"+outparamType+", \""+returnParamName+"\", 0);\n");
  +				}
  +			}			
  +			writer.write("\treturn AXIS_SUCCESS;\n");
   		}else{//method does not return anything
   			/* Invoke the service when return type is void */
   	 		writer.write("\tpWs->" + methodName + "(");
  
  
  
  1.4       +1 -1      ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ServiceHeaderWriter.java
  
  Index: ServiceHeaderWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ServiceHeaderWriter.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ServiceHeaderWriter.java	12 Jan 2004 12:20:56 -0000	1.3
  +++ ServiceHeaderWriter.java	20 Feb 2004 13:37:44 -0000	1.4
  @@ -178,7 +178,7 @@
   					params = minfo.getOutputParameterTypes().iterator();
   					for(int j =0; params.hasNext();j++){
   						ParameterInfo nparam = (ParameterInfo)params.next();
  -						writer.write(", AXIS_OUT_PARAM"+WrapperUtils.getClassNameFromParamInfoConsideringArrays(nparam,wscontext)+"
*OutValue"+j);
  +						writer.write(", AXIS_OUT_PARAM "+WrapperUtils.getClassNameFromParamInfoConsideringArrays(nparam,wscontext)+"
*OutValue"+j);
   					}
   				}			  	
   			  	writer.write(");\n");
  
  
  
  1.4       +1 -1      ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ServiceWriter.java
  
  Index: ServiceWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ServiceWriter.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ServiceWriter.java	12 Jan 2004 12:20:56 -0000	1.3
  +++ ServiceWriter.java	20 Feb 2004 13:37:44 -0000	1.4
  @@ -166,7 +166,7 @@
   					params = minfo.getOutputParameterTypes().iterator();
   					for(int j =0; params.hasNext();j++){
   						ParameterInfo nparam = (ParameterInfo)params.next();
  -						writer.write(", AXIS_OUT_PARAM"+WrapperUtils.getClassNameFromParamInfoConsideringArrays(nparam,wscontext)+"
*OutValue"+j);
  +						writer.write(", AXIS_OUT_PARAM "+WrapperUtils.getClassNameFromParamInfoConsideringArrays(nparam,wscontext)+"
*OutValue"+j);
   					}
   				}
   				writer.write(")\n{\n}\n");
  
  
  
  1.9       +61 -8     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.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- WrapWriter.java	17 Feb 2004 12:47:44 -0000	1.8
  +++ WrapWriter.java	20 Feb 2004 13:37:44 -0000	1.9
  @@ -208,6 +208,7 @@
   	 */
   
   	public void writeMethodInWrapper(MethodInfo minfo) throws WrapperFault,IOException {
  +		Type type;
   		boolean isAllTreatedAsOutParams = false;
   		ParameterInfo returntype = null;
   		int noOfOutParams = minfo.getOutputParameterTypes().size();
  @@ -219,8 +220,6 @@
   		}
   		else{
   			isAllTreatedAsOutParams = true;
  -			//TODO make all outparams when there are more than one return params
  -			throw new WrapperFault("WSDL2Ws does not still handle more than one return parameters");
   		}
   		Collection params = minfo.getInputParameterTypes();
   		String methodName = minfo.getMethodname();
  @@ -258,12 +257,12 @@
   		String paraTypeName;
   		String parameterName;
   		String elementName;
  +		String returnParamName;
   		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)+"(\""+elementName+"\",0);\n");
  @@ -288,8 +287,16 @@
   			}
   		}
   		writer.write("\tif (AXIS_SUCCESS != (nStatus = pIWSDZ->GetStatus())) return nStatus;\n");
  +		// Multiples parameters so fill the methods prototype
  +		if ( isAllTreatedAsOutParams ) {
  +			ArrayList paramsC = (ArrayList)minfo.getOutputParameterTypes();
  +			for (int i = 0; i < paramsC.size(); i++) {
  +				type = wscontext.getTypemap().getType(((ParameterInfo)paramsC.get(i)).getSchemaName());
  +				writer.write("\t"+WrapperUtils.getClassNameFromParamInfoConsideringArrays((ParameterInfo)paramsC.get(i),wscontext)+"
out"+i+";\n");
  +			}
  +		}
   		if(returntype != null){	/* Invoke the service when return type not void */
  -			String returnParamName = returntype.getElementName().getLocalPart();
  +			returnParamName = returntype.getElementName().getLocalPart();
   			writer.write("\t"+outparamType+((returntypeisarray || returntypeissimple)?" ":" *")+
"ret = "+"pWs->"+methodName+"(");
   			if (0<paramsB.size()){
   				for (int i = 0; i <  paramsB.size() - 1; i++) {
  @@ -306,18 +313,64 @@
   				String containedType = null;
   				if (CUtils.isSimpleType(qname)){
   					containedType = CUtils.getclass4qname(qname);
  -					writer.write("\treturn pIWSSZ->AddOutputBasicArrayParam(\""+returnParamName+"\",
(Axis_Array*)(&ret),"+CUtils.getXSDTypeForBasicType(containedType)+");\n");
  +					writer.write("\treturn pIWSSZ->AddOutputBasicArrayParam((Axis_Array*)(&ret),"+CUtils.getXSDTypeForBasicType(containedType)+",
\""+returnParamName+"\");\n");
   				}
   				else{
   					containedType = qname.getLocalPart();
  -					writer.write("\treturn pIWSSZ->AddOutputParam(\""+returnParamName+"\", (Axis_Array*)(&ret),"+

  -					"(void*) Axis_Serialize_"+containedType+", (void*) Axis_Delete_"+containedType+",
(void*) Axis_GetSize_"+containedType+", Axis_TypeName_"+containedType+", Axis_URI_"+containedType+");\n");
  +					writer.write("\treturn pIWSSZ->AddOutputCmplxArrayParam((Axis_Array*)(&ret),"+

  +					"(void*) Axis_Serialize_"+containedType+", (void*) Axis_Delete_"+containedType+",
(void*) Axis_GetSize_"+containedType+", \""+returnParamName+"\", Axis_URI_"+containedType+");\n");
   				}
   			}
   			else{
   				//complex type
  -				writer.write("\treturn pIWSSZ->AddOutputParam(\""+returnParamName+"\", ret, (void*)Axis_Serialize_"+outparamType+",
(void*)Axis_Delete_"+outparamType+");\n");
  +				writer.write("\treturn pIWSSZ->AddOutputCmplxParam(ret, (void*)Axis_Serialize_"+outparamType+",
(void*)Axis_Delete_"+outparamType+", \""+returnParamName+"\", Axis_URI_"+outparamType+");\n");
  +			}
  +		}else if (isAllTreatedAsOutParams){
  +			writer.write("\tpWs->" + methodName + "(");
  +			if (0<paramsB.size()){
  +				for (int i = 0; i <  paramsB.size(); i++) {
  +					writer.write("v" + i + ",");
  +				}
  +			}
  +			ArrayList paramsC = (ArrayList)minfo.getOutputParameterTypes();
  +			for (int i = 0; i < paramsC.size()-1; i++) {
  +				writer.write("&out" + i +",");
   			}
  +			writer.write("&out" + ( paramsC.size()-1));
  +			writer.write(");\n");
  +			paramsC = (ArrayList)minfo.getOutputParameterTypes();
  +			for (int i = 0; i < paramsC.size(); i++) {
  +				retType = wscontext.getTypemap().getType(((ParameterInfo)paramsC.get(i)).getSchemaName());
  +				if (retType != null){
  +					outparamType = retType.getLanguageSpecificName();
  +					returntypeisarray = retType.isArray();
  +				}
  +				else{
  +					outparamType = returntype.getLangName();
  +				}
  +				returntypeissimple = CUtils.isSimpleType(outparamType);
  +				returnParamName = ((ParameterInfo)paramsC.get(i)).getElementName().getLocalPart();
  +				if (returntypeissimple){
  +					writer.write("\tpIWSSZ->AddOutputParam(\""+returnParamName+"\", (void*)&out"+i+",
"+CUtils.getXSDTypeForBasicType(outparamType)+");\n");
  +				}else if(returntypeisarray){
  +					QName qname = WrapperUtils.getArrayType(retType).getName();
  +					String containedType = null;
  +					if (CUtils.isSimpleType(qname)){
  +						containedType = CUtils.getclass4qname(qname);
  +						writer.write("\tpIWSSZ->AddOutputBasicArrayParam((Axis_Array*)(&out"+i+"),"+CUtils.getXSDTypeForBasicType(containedType)+",
\""+returnParamName+"\");\n");
  +					}
  +					else{
  +						containedType = qname.getLocalPart();
  +						writer.write("\tpIWSSZ->AddOutputCmplxArrayParam((Axis_Array*)(&out"+i+"),"+

  +						"(void*) Axis_Serialize_"+containedType+", (void*) Axis_Delete_"+containedType+",
(void*) Axis_GetSize_"+containedType+", \""+returnParamName+"\", Axis_URI_"+containedType+");\n");
  +					}
  +				}
  +				else{
  +					//complex type
  +					writer.write("\tpIWSSZ->AddOutputCmplxParam(out"+i+", (void*)Axis_Serialize_"+outparamType+",
(void*)Axis_Delete_"+outparamType+", \""+returnParamName+"\", Axis_URI_"+outparamType+");\n");
  +				}
  +			}			
  +			writer.write("\treturn AXIS_SUCCESS;\n");
   		}else{//method does not return anything
   			/* Invoke the service when return type is void */
   	 		writer.write("\tpWs->" + methodName + "(");
  
  
  

Mime
View raw message