Im trying to send a List of Items with generic Keys and Value Types to a asp.net webservice.
How can i do this?
I tried it with List<Dictionary<String, String>>, but this doens’t work. I do not get an exception, but when i break in the webserivice, my collection is null.
The Data could look like this:
{"Data":{"fieldtype":"integer","isrequired":true,"isrequirederror":"Invalid Data"}}.
But as i said, the Keys are generic, sometimes there are more properties, sometimes not.
Thx alot
This post couldn’t help my btw:
How to send a hashtable to an asmx webservice?
You are going to have hard times with SOA and WCF in particular if you want to introduce any kind of generics in your service – starting from serialization/deserialization issues and finishing interoperability issues.
Don’t use generic parameters. Hashtable (or Dictionary) makes sense only within in-process usage due to read/write operations performance. If you want to transmit something in such format over the wire, use something like the following structure:
List of pairs (string, string).