[英]c# and xml-rpc.net: mismatch exception
我正在使用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 [],但显然这是不正确的。 这是资源的定义:
[XmlRpcMethod("resources")]
String[] resources(String sessionId);
你知道了吗? #1您想要使结构与响应匹配。 如果您使用类似的结构
public struct ResourcesResult{
public string[] resources;
}
假设返回值包含一个称为resources
带有string
值的数组元素,它应该可以工作。
如果您已解决,请告诉我。 我们可以谈更多。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.