![](/img/trans.png)
[英]Cannot implicitly convert type 'String' to 'string' in C#
[英]Cannot implicitly convert type string to string[] in c# soap call
在嘗試創建的Soap調用中,錯誤“無法將類型字符串隱式轉換為string []”使我非常困惑。 我在C#中使用VS2015。 看一下代碼:
ServiceReference1.ServiceClient client = new ServiceReference1.ServiceClient();
ServiceReference1.Request req = new ServiceReference1.Request();
req.requestID = "validRequestIDString"; // I get the error here
如果我使用Bear SoapUI,則沒有問題,可以發送相同的requestID並獲得有效的響應。
我猜該錯誤告訴我響應是一個數組而不是單個字符串,但是我知道這是不正確的。
任何方向都會有所幫助。 謝謝
怎么樣:
request.requestID = new String[] { "validRequestIDString" };
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.