[英]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.