简体   繁体   中英

c# and xml-rpc.net: mismatch exception

I'm using xml-rpc.net to access an e-commerce site (php) from an c# application. The code:

String[] fooResourcesReturn = FoobarProxy.resources(fooLoginReturn);

returns the following XmlRpcTypeMismatchException:

response contains struct value where string expected (as type String) [response : array mapped to type String[] : element 0]

The problem is that the method resources returns an array but I cannot figure out its type. I've used string[] but obviously that's not correct. Here's the def for resources:

    [XmlRpcMethod("resources")]
    String[] resources(String sessionId);

Have you figured this out? #1 You want to match your structure to the response. If you use a struct like

public struct ResourcesResult{
   public string[] resources;
}

it should work assuming the return has an array element called resources with string values.

Please let me know if you've resolved it. We can talk some more.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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