C # and xml-rpc.net: mismatch exception

I am using xml-rpc.net to access an ecommerce site (php) from a C # application. 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 resources of the method are returning an array, but I cannot determine its type. I used the line [], but obviously it is not correct. Here's the def for resources:

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

      

0


source to share


1 answer


Do you get it? # 1 You want to match your structure to the answer. If you are using a structure like

public struct ResourcesResult{
   public string[] resources;
}

      



it should work assuming return has a named array element resources

with string

values.

Please let me know if you have allowed this. We can talk some more.

+1


source







All Articles