Web Service Proxy Generator
Calling service with many parameters
Gravatar is a globally recognized avatar based on your email address. Calling service with many parameters
  Marcin
  All
  Apr 9, 2019 @ 06:36pm

Hi Rick,

I have the problem with calling the service method which has 22 parameters. I already spent a lot of time tracing and checking various parameter preparation. The result is always the same. The service is not called and the error message: File 'laparms.prg' does not exist is generated in dotnetbridge.prg procedure named: InvokeMethod_ParameterArray when the instruction: loArray.AddItem(laParms[lnX]) is executed for the first parameter. I am calling more than twenty other service methods using dotnetbridge. The calls have various parameters types, arrays passed by value or reference etc. and all of them are working perfectly. The major difference between them and the one causing the error is the number of parameters. In case of more than 10 parameters your implementation is to pass them via array. Could it be the reason of the problem? So far when I faced the problem with parameters the error was rather like "method does not exist" but with the one described above I am confused and I don't know how to avoid it. Please advice.

Here is the part of InvokeMethod_ParameterArray code where error occures.

	CASE TYPE("laParms.Count") = "N"
		*** It's a .NET array/collection
	    FOR lnX =1 TO laParms.Count
	    	loArray.AddItem(laParms[lnX])
	    ENDFOR

Here is the part of my code calling service method:

*!! respected procedure in DLL generated by WWProxyGenerator based on WSDL 7.4.2019   

*!*	public ItemInfoStruct[] doGetItemsInfo(string sessionHandle, long[] itemsIdArray, ;												
*!*		int getDesc, bool getDescSpecified, int getImageUrl, bool getImageUrlSpecified, ;				
*!*		int getAttribs, bool getAttribsSpecified, int getPostageOptions, bool getPostageOptionsSpecified,;
*!*		int getCompanyInfo, bool getCompanyInfoSpecified, int getProductInfo, bool getProductInfoSpecified,;
*!*		int getAfterSalesServiceConditions, bool getAfterSalesServiceConditionsSpecified, int getEan, bool getEanSpecified, ;
*!*		int getAdditionalServicesGroup, bool getAdditionalServicesGroupSpecified,;
*!*		out long[] arrayItemsNotFound, out long[] arrayItemsAdminKilled);


** IN Param 

loVal = go.DotNet.ConvertToDotnetValue(pnItemId,"int64")

LOCAL itemsIdArray as System.Int64[]
LOCAL itemsIdArrayComValue as Westwind.WebConnection.ComValue
itemsIdArray = go.Proxy.oBridge.CreateArray("System.Int64")
itemsIdArray.additem(loVal )
itemsIdArrayComValue = go.Proxy.oBridge.CreateComValue()
go.Proxy.oBridge.SetProperty(itemsIdArrayComValue ,"Value",itemsIdArray)


** OUT Param 

LOCAL ItemsNotFound as System.Int64[]				
ItemsNotFound= go.Proxy.oBridge.CreateArray("System.Int64")

LOCAL ItemsAdminKilled as System.Int64[]				
ItemsAdminKilled= go.Proxy.oBridge.CreateArray("System.Int64")


LOCAL ItemInfoArray as Westwind.WebConnection.ComArray													
** Service call, cHandle is a string				
ItemInfoArray= go.Proxy.doGetItemsInfo(go.Auth.cHandle, itemsIdArrayComValue, ;   
				1,.T., 0,.F., 1,.T., 0,.F., 0,.F., 0,.F., 0,.F., 1,.T., 0,.F., ;
				@ItemsNotFound, @ItemsAdminKilled)   
										
									

I know that there is an example in samples showing similar case, but I really don't know what is wrong in my code.

Regards, Marcin

© 1996-2024