The DataContractJsonSerializer is not able to serialize Dictionaries properly.
Whereas JavaScriptSerializer serializes Dictionaries as {"abc":"xyz","def":42}
for example,
the DataContractJsonSerializer gives [{"Key":"abc","Value":"xyz"},{"Key":"def","Value":42}]
instead.
This is really problematic and I want to know how can I serialize Dictionary objects correctly in my WCF service. I am looking for a solution that would require least amount of effort.
ref: http://msdn.microsoft.com/en-us/library/bb412170.aspx
This is the workaround I finally used to serilize dictionaries properly in WCF: http://social.msdn.microsoft.com/forums/en-US/wcf/thread/765f1569-0422-4471-8ec2-1d03b2026771