views:

97

answers:

1

I have a silverlight control which makes an HttpWebRequest to an HttpHandler on the server side. The request is a post. The body of the post is an object serialized using the DataContractJsonSerializer. The Silverlight control is SL 4.0 Beta and the Handler is .net 4.0 Beta. When i inspect the streams in the silverlight control the serialized object looks like this

{"MethodName":"MyMethod","Parameters":[{"_type":"KeyValuePairOfstringstring:#System.Collections.Generic","Key":"Param1","Value":"Value1"},{"_type":"KeyValuePairOfstringstring:#System.Collections.Generic","Key":"Param2","Value":"Value2"}]}

If I construct the same object from scratch on the server and serialize it the same way i get a json object that looks like this.

{"MethodName":"MyMethod","Parameters":[{"key":"Param1","value":"Value1"},{"key":"Param2","value":"Value2"}]}

The Net-Net is that serializing in SL4.0 and deserializing in ASP.Net 4.0 doesnt work for me. Any suggestions ?

A: 

Do you use DataContract, DataMember attributes for serialized class on both sides?

FFire
Yes, those attributes are used on both sides
F.A.B