从C#将ArrayList发送到PHP WebService

问题描述:

嗨!我必须使用C#编写的PHP WebService,但无法将多维数组参数发送到PHP WebService.如何将多维数组发送到PHP WebService.

Hi! I must use a PHP WebService by C# but I can''t send multidimensional array parameter to PHP WebService. How can I send a multidimensional array to PHP WebService.

string[,] _multidimensionelArray = new string[5, 5];
richTextBox1.Text = _imp.importSelling(_token, _selling, _multidimensionelArray);


转为错误消息是:错误2参数"3":无法从"string [*,*]"转换为"WindowsFormsApplication2.exportSelling.SepetList" D:\ Belgelerim \ Desktop \ WindowsFormsApplication2 \ WindowsFormsApplication2 \ Form1.cs


Turned error message is: Error 2 Argument ''3'': cannot convert from ''string[*,*]'' to ''WindowsFormsApplication2.exportSelling.SepetList'' D:\Belgelerim\Desktop\WindowsFormsApplication2\WindowsFormsApplication2\Form1.cs

错误2参数"3":无法从"string [*,*]"转换到''WindowsFormsApplication2.exportSelling.SepetList
错误说明了一切.您在网络服务中的第三个参数是您定义的 SepetList 类型.但是,在上面的代码行中,您尝试将字符串[*,*]作为参数传递.因此,错误.

要么将您的数据转换为''WindowsFormsApplication2.exportSelling.SepetList'',然后将其传递.

更改Web服务中的实现.将参数替换为string [*,*]
类型 或
使用新方法重载Web服务以允许您进行呼叫.
Error 2 Argument ''3'': cannot convert from ''string[*,*]'' to ''WindowsFormsApplication2.exportSelling.SepetList
Error says it all. Your 3rd parameter in webservice is of type SepetList defined by you. But, in the code lines above, you are trying to pass a string[*,*] as a parameter. Hence the error.

Either, convert your data into ''WindowsFormsApplication2.exportSelling.SepetList'' and then pass it.
OR
Change the implementation in the webservice. Replace the argument with type string[*,*]
OR
Overload webservice with a new method to allow your call.