<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>JSON and XML Serialization</title><link>http://asp.net</link><pubDate>Mon, 22 Apr 2013 15:24:56 GMT</pubDate><generator>umbraco</generator><description>Comments for JSON and XML Serialization</description><language>en</language><atom:link href="http://asp.net/rss/comments/38983" rel="self" type="application/rss+xml" /><item><title>Comment Posted by erikkl2000</title><link>http://asp.net/web-api/overview/formats-and-model-binding/json-and-xml-serialization</link><pubDate>Wed, 06 Jun 2012 12:58:32 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000015698</guid><description><![CDATA[ <p>Thank you mike...</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/erikkl2000.jpg?forceidenticon=false&amp;dt=635044417800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by nachof</title><link>http://asp.net/web-api/overview/formats-and-model-binding/json-and-xml-serialization</link><pubDate>Sat, 09 Jun 2012 00:19:05 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000015729</guid><description><![CDATA[ <p>Hey Mike, is there a way to cleanup the namespaces the default DataContractSerializer outputs?</p><p></p><p><a rel="nofollow" href="http://stackoverflow.com/questions/3811696/stop-datacontractserializer-putting-in-namespace" target="_blank">stackoverflow.com/</a></p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/nachof.jpg?forceidenticon=false&amp;dt=635044417800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by dcowan</title><link>http://asp.net/web-api/overview/formats-and-model-binding/json-and-xml-serialization</link><pubDate>Tue, 26 Jun 2012 10:46:30 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000015855</guid><description><![CDATA[ <p>Just wanted to let you know there is an error in your last example</p><p></p><p> str = Serialize(xml, value);</p><p></p><p>should be</p><p></p><p> str = Serialize(json, value);</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/dcowan.jpg?forceidenticon=false&amp;dt=635044417800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by MikeWasson</title><link>http://asp.net/web-api/overview/formats-and-model-binding/json-and-xml-serialization</link><pubDate>Wed, 27 Jun 2012 01:49:17 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000015862</guid><description><![CDATA[ <p>@dcowan: Yes, thanks!</p><p></p><p>@nachof: If you use the [DataContract] attribute, you can set the namespace for the type. </p><p></p><p>[DataContract(Namespace=&quot;mynamespace&quot;)] </p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/MikeWasson.jpg?forceidenticon=false&amp;dt=635044417800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by rrjp</title><link>http://asp.net/web-api/overview/formats-and-model-binding/json-and-xml-serialization</link><pubDate>Wed, 27 Jun 2012 16:10:57 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000015870</guid><description><![CDATA[ <p>So, if I want to use [JsonIgnore] in my code, I need to download Json.NET from CodePlex and reference it from the Json.NET library? </p><p></p><p>Just want to make sure you aren&#39;t already exposing it through JsonMediaTypeFormatter somehow before I go and get it.</p><p></p><p></p><p></p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/rrjp.jpg?forceidenticon=false&amp;dt=635044417800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by MikeWasson</title><link>http://asp.net/web-api/overview/formats-and-model-binding/json-and-xml-serialization</link><pubDate>Thu, 28 Jun 2012 18:31:26 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000015876</guid><description><![CDATA[ <p>@rrjp: As of RC, the JsonMediaTypeFormatter uses JSON.Net, so you shouldn&#39;t need to add JSON.Net.</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/MikeWasson.jpg?forceidenticon=false&amp;dt=635044417800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by ognyandim</title><link>http://asp.net/web-api/overview/formats-and-model-binding/json-and-xml-serialization</link><pubDate>Tue, 10 Jul 2012 04:38:20 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000015948</guid><description><![CDATA[ <p>Very good explanation. The code is outdated and some of the properties and namespaces are not existent.</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/ognyandim.jpg?forceidenticon=false&amp;dt=635044417800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by MikeWasson</title><link>http://asp.net/web-api/overview/formats-and-model-binding/json-and-xml-serialization</link><pubDate>Thu, 12 Jul 2012 16:17:59 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000015965</guid><description><![CDATA[ <p>ognyandim: Which properties/namespaces? This topic *should* be up-to-date for the RC release, but it&#39;s possible I have some errors.</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/MikeWasson.jpg?forceidenticon=false&amp;dt=635044417800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by daniel vaughan</title><link>http://asp.net/web-api/overview/formats-and-model-binding/json-and-xml-serialization</link><pubDate>Wed, 22 Aug 2012 10:48:34 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000016250</guid><description><![CDATA[ <p>Thanks for the section on Testing Object Serialization, Mike. Very useful.</p><p></p><p>Cheers,</p><p>Daniel</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/daniel%20vaughan.jpg?forceidenticon=false&amp;dt=635044417800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by jayesh_sorathia</title><link>http://asp.net/web-api/overview/formats-and-model-binding/json-and-xml-serialization</link><pubDate>Sat, 15 Sep 2012 05:20:53 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000016440</guid><description><![CDATA[ <p>To learn more on XML Serialization and Deserialization visit this links.</p><p></p><p>XML Serialization : <a rel="nofollow" href="http://jayeshsorathia.blogspot.com/2012/08/net-tips-c-tips-xml-serialization-of-custom-class-objects.html" target="_blank">jayeshsorathia.blogspot.com/</a></p><p></p><p>XML Deserialization : <a rel="nofollow" href="http://jayeshsorathia.blogspot.com/2012/08/net-tips-c-tips-xml-deserialization.html" target="_blank">jayeshsorathia.blogspot.com/</a></p><p></p><p>These links contains samples to download.</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/jayesh_sorathia.jpg?forceidenticon=false&amp;dt=635044417800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by ramiljoaquin</title><link>http://asp.net/web-api/overview/formats-and-model-binding/json-and-xml-serialization</link><pubDate>Thu, 22 Nov 2012 09:08:14 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000016858</guid><description><![CDATA[ <p>The &quot;Testing Object Serialization&quot; section saves my day. Thanks Mike !</p><p></p><p>I would remove the &quot;Headers&quot; from this line though: formatter.WriteToStreamAsync(typeof(T), value, stream, content.Headers, null).Wait(); </p><p></p><p></p><p></p><p></p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/ramiljoaquin.jpg?forceidenticon=false&amp;dt=635044417800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by ProcuraIsaac</title><link>http://asp.net/web-api/overview/formats-and-model-binding/json-and-xml-serialization</link><pubDate>Thu, 13 Dec 2012 17:09:53 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000016997</guid><description><![CDATA[ <p>Is it possible to have the JSON.NET serializer look at the DataMember Name attribute like the XML serializer does?</p><p></p><p>&quot;To change how a member name appears in the XML, set the Name parameter in the DataMember attribute&quot;</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/ProcuraIsaac.jpg?forceidenticon=false&amp;dt=635044417800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by ProcuraIsaac</title><link>http://asp.net/web-api/overview/formats-and-model-binding/json-and-xml-serialization</link><pubDate>Thu, 13 Dec 2012 17:18:55 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000016998</guid><description><![CDATA[ <p>Relating to my question above, I mean specifically related to ModelBinding and ModelState.    </p><p></p><p>        [DataMember(Name = &quot;start&quot;, IsRequired = true)]</p><p>        public DateTime StartDate { get; set; }</p><p></p><p>JSON passed to my service doesn&#39;t get mapped from start to StartDate.</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/ProcuraIsaac.jpg?forceidenticon=false&amp;dt=635044417800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by Sathyaish</title><link>http://asp.net/web-api/overview/formats-and-model-binding/json-and-xml-serialization</link><pubDate>Thu, 10 Jan 2013 05:36:57 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000017150</guid><description><![CDATA[ <p>Mike, I enjoy reading your articles very much.</p><p></p><p>This article helped me solve an empty 500 HttpStatusCode I was receiving from my Web API for no reason I could see. I landed on this from one of the comments on StackOverflow about circular references in the object graph (which I did have and which would be very common in Entity Framework generated model scenarios). I was pleasantly surprised to see that you are the writer of this article.</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/Sathyaish.jpg?forceidenticon=false&amp;dt=635044417800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by reps</title><link>http://asp.net/web-api/overview/formats-and-model-binding/json-and-xml-serialization</link><pubDate>Mon, 22 Apr 2013 15:24:56 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-0000000018959</guid><description><![CDATA[ <p>I would like to add that DateTime is NOT written in ISO 8601 format (both with JSON and XML serializers). It has no Z suffix. This is the output I get: &quot;2013-04-21T22:10:56.65&quot;. </p><p>To have ISO 8601 format you should use DateTimeOffset data type.</p><p>Maybe it would be a good idea to add this information to this article.</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/reps.jpg?forceidenticon=false&amp;dt=635044417800000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item></channel></rss>