Using ASP.NET WebServices, by default you can’t pass any IDictionary objects, because xml serialization for IDictionaries isn’t supported. I have found various ways to serialized dictionaries (http://weblogs.asp.net/pwelter34/archive/2006/05/03/444961.aspx, http://blogs.msdn.com/psheill/archive/2005/04/09/406823.aspx, http://www.mattberther.com/2004/06/14/serializing-an-idictionary-object/) but, I can’t find any way to hook this into the Asp.NET web methods.
Is there a way to hook it up so that I can use IDictionaries with WebMethods?
depends on how you are calling these methods, we use the .net 2.0 method with ‘web references’ and you will notice that the WSDL generated class is a partial, we create a (web reference name).cs file and have something like:
Overloading will allow you to call the method name with either type of collection
At the web service side you can convert from a simple collection back to a more powerful collection, most likely with the use of that more powerful collections ctor. One of the ctors will probably consume a simple collection.