简体   繁体   English

无法在C#soap调用中将类型字符串隐式转换为string []

[英]Cannot implicitly convert type string to string[] in c# soap call

I am very much perplexed by the error, "Cannot implicitly convert type string to string[]" in a soap call I am attempting to create. 在尝试创建的Soap调用中,错误“无法将类型字符串隐式转换为string []”使我非常困惑。 I am using VS2015 in C#. 我在C#中使用VS2015。 Looking at the code: 看一下代码:

ServiceReference1.ServiceClient client = new ServiceReference1.ServiceClient();
ServiceReference1.Request req = new ServiceReference1.Request();
req.requestID = "validRequestIDString"; // I get the error here 

If I am using Bear SoapUI I have no issues sending the same requestID and getting a valid response. 如果我使用Bear SoapUI,则没有问题,可以发送相同的requestID并获得有效的响应。

I am guessing that the error is telling me that the response is an array and not a single string but I know that is incorrect. 我猜该错误告诉我响应是一个数组而不是单个字符串,但是我知道这是不正确的。

Any direction would be helpful. 任何方向都会有所帮助。 Thank you 谢谢

怎么样:

request.requestID = new String[] { "validRequestIDString" };

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM