Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ionic-framework/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在VB.net SOAP web服务中构造函数以接收数组_Vb.net_Arrays_Function_Parameters_Suds - Fatal编程技术网

在VB.net SOAP web服务中构造函数以接收数组

在VB.net SOAP web服务中构造函数以接收数组,vb.net,arrays,function,parameters,suds,Vb.net,Arrays,Function,Parameters,Suds,我有一个具体的问题,我还没有找到答案。基本上,我需要将一个数字列表传递到一个函数中,做一些数学运算并返回它们。我可以一次传递一个数字而没有问题,但是当我想要传递数组时,我开始有问题 我的VB.net代码如下所示 <WebMethod()> _ Public Function ArrayTest(test As Double) As Double() Return test End Function _ 公共函数数组测试(测试为Double)为Double() 回归试验 端函

我有一个具体的问题,我还没有找到答案。基本上,我需要将一个数字列表传递到一个函数中,做一些数学运算并返回它们。我可以一次传递一个数字而没有问题,但是当我想要传递数组时,我开始有问题

我的VB.net代码如下所示

<WebMethod()> _
Public Function ArrayTest(test As Double) As Double()
    Return test
End Function
_
公共函数数组测试(测试为Double)为Double()
回归试验
端函数
我使用Python和SUDS作为SOAP客户机进行测试。这是XML

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
  xmlns:ns0="http://tempuri.org/"
  xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
    <SOAP-ENV:Header/>
    <ns1:Body>
      <ns0:ArrayTest>
        <ns0:test>603</ns0:test>
        <ns0:test>603</ns0:test>
        <ns0:test>607</ns0:test>
        <ns0:test>609</ns0:test>
      </ns0:ArrayTest>
    </ns1:Body>
</SOAP-ENV:Envelope>

603
603
607
609
我在代码中设置了一个断点,并查看了测试变量的输入值,数组大小始终保持为零。我试过数组、列表和其他一些东西,但运气不好。当然,如果我没有将输入指定为数组,它将获取从SOAP请求传入的第一个项并返回它,但我希望返回所有项


这是我试图实现的其他东西。我相信这很简单,我对编程基本上是新手

根据您的代码:

Public Function ArrayTest(test As Double) As Double()
ArrayTest
接收一个
Double
,并返回
Double
的数组。也许你应该改一下你的签名? 此外,从您提供的链接:

Public Function GetObjectValues(ByVal objIds As List(Of String), ByVal objProperty As String) As List(Of String)
查看
objIds
参数-是
数组的替代变量