5

I'm trying to replace the Json converter that is used by WCF with an open source Json.NET (http://json.codeplex.com) mainly due the need to serialize objects with circular references [DataContract(IsReference=true)] I tried to inject it in custom IDispatchMessageFormatter with no success. Has anyone encounter in this kind of customization? Do you know where can I get a sample or reference to depend on?

Thanks

2 Answers2

6

Refer to Supporting different data and serialization formats in WCF by Carlos Figueira.

paramosh
  • 2,258
  • 1
  • 15
  • 23
  • +1 Thats what got my dispatch message formatter going, Carlos seems to know what he is talking about :) – PJUK May 16 '12 at 12:33
0

You can use NETFx Json.NET MediaTypeFormatter to swap the default DataContractJsonSerializer with Json.Net serializer. See this SO question for more info.

This page talks about how to preserve references during serialization/deserialization in Json.Net

Community
  • 1
  • 1
muruge
  • 4,083
  • 3
  • 38
  • 45