1
我有一個具體問題,我還沒有找到答案。基本上我需要將一個數字列表傳遞給一個函數做一些數學運算並返回它們。我可以一次傳遞一個數字,但沒有問題,但是當我想傳入數組時,我開始遇到問題。在VB.net中構造函數SOAP web服務接收數組
我VB.net代碼看起來像這樣...
<WebMethod()> _
Public Function ArrayTest(test As Double) As Double()
Return test
End Function
我測試對這種使用Python用肥皂水爲我的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>
我在代碼中設置一個破發點,並看了看測試變量的輸入值,和數組的大小始終保持在零。我試過ParamArray,List和其他一些東西,但我沒有運氣。當然,如果我不指定輸入是一個數組,它會從SOAP請求中傳入第一個項並返回它,但是我想要返回所有項。
這是我嘗試實施的其他東西。我確定它很簡單,一般來說我對編程相當陌生。 Related link