无法在 C# soap 调用中将类型字符串隐式转换为字符串 []
Cannot implicitly convert type string to string[] in c# soap call
我对错误感到非常困惑,"Cannot implicitly convert type string to string[]" 在我试图创建的 soap 调用中。我在 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" };
我对错误感到非常困惑,"Cannot implicitly convert type string to string[]" 在我试图创建的 soap 调用中。我在 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" };