正在使用xml-rpc.net从c#应用程序访问电子商务网站(php)。代码:
String[] fooResourcesReturn = FoobarProxy.resources(fooLoginReturn);
返回以下XmlRpcTypeMismatchException:
response contains struct value where string expected (as type String) [response : array mapped to type String[] : element 0]
问题是方法资源返回一个数组,但我无法弄清楚它的类型。我用过string [],但显然这是不正确的。这里是资源的def:
[XmlRpcMethod("resources")]
String[] resources(String sessionId);
发布于 2018-06-01 08:41:33
你希望将你的结构与响应进行匹配。如果你使用一个像
public struct ResourcesResult{
public string[] resources;
}
它应该工作假设有回报称为数组元素resources
与string
价值观。
https://stackoverflow.com/questions/-100000203
复制相似问题