<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: XmlSerializer vs DataContractSerializer: Serialization in Wcf</title>
	<atom:link href="http://www.danrigsby.com/blog/index.php/2008/03/07/xmlserializer-vs-datacontractserializer-serialization-in-wcf/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.danrigsby.com/blog/index.php/2008/03/07/xmlserializer-vs-datacontractserializer-serialization-in-wcf/</link>
	<description>Developer.Speaker.Blogger</description>
	<lastBuildDate>Sun, 14 Aug 2011 06:09:27 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Jeff D</title>
		<link>http://www.danrigsby.com/blog/index.php/2008/03/07/xmlserializer-vs-datacontractserializer-serialization-in-wcf/comment-page-1/#comment-3349</link>
		<dc:creator>Jeff D</dc:creator>
		<pubDate>Thu, 20 Aug 2009 19:14:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.danrigsby.com/blog/index.php/2008/03/07/xmlserializer-vs-datacontractserializer-serialization-in-wcf/#comment-3349</guid>
		<description>Is the DataContractSerializer really faster than the XML serializer?  I can believe in the 10% faster piece, but the size of the XML for DCS (since you can&#039;t use attributes) seems much much higher than for the XmlSerializer.  I expect that the network speed is more important than serialization speed.

&lt;a href=&quot;http://stackoverflow.com/questions/1307768/datacontractserializer-xml-double-the-size-of-xml-serializer-output-is-this-rea&quot; title=&quot;StackOverflow Link&quot; rel=&quot;nofollow&quot;&gt;I asked this question on stackoverflow&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>Is the DataContractSerializer really faster than the XML serializer?  I can believe in the 10% faster piece, but the size of the XML for DCS (since you can&#8217;t use attributes) seems much much higher than for the XmlSerializer.  I expect that the network speed is more important than serialization speed.</p>
<p><a href="http://stackoverflow.com/questions/1307768/datacontractserializer-xml-double-the-size-of-xml-serializer-output-is-this-rea" title="StackOverflow Link" rel="nofollow">I asked this question on stackoverflow</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JK</title>
		<link>http://www.danrigsby.com/blog/index.php/2008/03/07/xmlserializer-vs-datacontractserializer-serialization-in-wcf/comment-page-1/#comment-3279</link>
		<dc:creator>JK</dc:creator>
		<pubDate>Sat, 11 Jul 2009 22:31:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.danrigsby.com/blog/index.php/2008/03/07/xmlserializer-vs-datacontractserializer-serialization-in-wcf/#comment-3279</guid>
		<description>Custom serialization doesn&#039;t work... I created the attribute, behavior, and serailizer, decorated my operation with said attribute and even though the behavior is added to the operation description (as seen when I step-through), when the object to be serialized (being the return value) is serialized it defaults back to the original XML serializer and none of my breakpoints are ever lit up. This is quite irritating because I can&#039;t do what I need to do with the default XmlSerializer. I need to be able to define my own start and end elements because I need to add doc types to my document. Unfortunately, the IXmlSerializable interface only lets me define the inner elements. I have yet to get the custom serializer working...</description>
		<content:encoded><![CDATA[<p>Custom serialization doesn&#8217;t work&#8230; I created the attribute, behavior, and serailizer, decorated my operation with said attribute and even though the behavior is added to the operation description (as seen when I step-through), when the object to be serialized (being the return value) is serialized it defaults back to the original XML serializer and none of my breakpoints are ever lit up. This is quite irritating because I can&#8217;t do what I need to do with the default XmlSerializer. I need to be able to define my own start and end elements because I need to add doc types to my document. Unfortunately, the IXmlSerializable interface only lets me define the inner elements. I have yet to get the custom serializer working&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: robotix1986</title>
		<link>http://www.danrigsby.com/blog/index.php/2008/03/07/xmlserializer-vs-datacontractserializer-serialization-in-wcf/comment-page-1/#comment-3275</link>
		<dc:creator>robotix1986</dc:creator>
		<pubDate>Mon, 06 Jul 2009 21:51:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.danrigsby.com/blog/index.php/2008/03/07/xmlserializer-vs-datacontractserializer-serialization-in-wcf/#comment-3275</guid>
		<description>this is a very informational blog...</description>
		<content:encoded><![CDATA[<p>this is a very informational blog&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike V</title>
		<link>http://www.danrigsby.com/blog/index.php/2008/03/07/xmlserializer-vs-datacontractserializer-serialization-in-wcf/comment-page-1/#comment-3024</link>
		<dc:creator>Mike V</dc:creator>
		<pubDate>Fri, 27 Mar 2009 17:50:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.danrigsby.com/blog/index.php/2008/03/07/xmlserializer-vs-datacontractserializer-serialization-in-wcf/#comment-3024</guid>
		<description>Thanks for the great article.  I have a question though that I&#039;ve been struggling with; how would you support serializing a derived class and then deserializing it to its base class?  So, for example, I might have a generic list of Animals, some of which are Cats or Dogs, and I want to serialize this list, then deserialize it as List.  I get an exception when I try to do this.

The same applies to simply serializing a single Dog and deserializing it as an Animal.</description>
		<content:encoded><![CDATA[<p>Thanks for the great article.  I have a question though that I&#8217;ve been struggling with; how would you support serializing a derived class and then deserializing it to its base class?  So, for example, I might have a generic list of Animals, some of which are Cats or Dogs, and I want to serialize this list, then deserialize it as List.  I get an exception when I try to do this.</p>
<p>The same applies to simply serializing a single Dog and deserializing it as an Animal.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: svs</title>
		<link>http://www.danrigsby.com/blog/index.php/2008/03/07/xmlserializer-vs-datacontractserializer-serialization-in-wcf/comment-page-1/#comment-3013</link>
		<dc:creator>svs</dc:creator>
		<pubDate>Thu, 19 Mar 2009 16:13:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.danrigsby.com/blog/index.php/2008/03/07/xmlserializer-vs-datacontractserializer-serialization-in-wcf/#comment-3013</guid>
		<description>hi dan,

i was implement the XMLDocument with soapheader in WCF service.but XmlDocument doesn&#039;t searialize in wcf when we using soap header.so do u have any idea about this...plz let me know if u have any idea..

here is my code:

namespace WCFServices.Contracts
{    
    [ServiceContract(Namespace = &quot;http://test.com/Contracts&quot;)]  
    [SoapHeaders]
    public interface IAdapter
    {
     [OperationContract]
        [SoapHeader(&quot;RunwayAuthenticationWCFSoapHeader&quot;, typeof(RunwayAuthenticationWCFSoapHeader), Direction = SoapHeaderDirection.In)]
        [XmlSerializerFormat]
        XmlDocument GetTechAnalysisXml(int? analystID, int tasID, int assetID);
    }
}</description>
		<content:encoded><![CDATA[<p>hi dan,</p>
<p>i was implement the XMLDocument with soapheader in WCF service.but XmlDocument doesn&#8217;t searialize in wcf when we using soap header.so do u have any idea about this&#8230;plz let me know if u have any idea..</p>
<p>here is my code:</p>
<p>namespace WCFServices.Contracts<br />
{<br />
    [ServiceContract(Namespace = "http://test.com/Contracts")]<br />
    [SoapHeaders]<br />
    public interface IAdapter<br />
    {<br />
     [OperationContract]<br />
        [SoapHeader("RunwayAuthenticationWCFSoapHeader", typeof(RunwayAuthenticationWCFSoapHeader), Direction = SoapHeaderDirection.In)]<br />
        [XmlSerializerFormat]<br />
        XmlDocument GetTechAnalysisXml(int? analystID, int tasID, int assetID);<br />
    }<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Boris Modylevsky</title>
		<link>http://www.danrigsby.com/blog/index.php/2008/03/07/xmlserializer-vs-datacontractserializer-serialization-in-wcf/comment-page-1/#comment-3010</link>
		<dc:creator>Boris Modylevsky</dc:creator>
		<pubDate>Wed, 18 Mar 2009 12:26:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.danrigsby.com/blog/index.php/2008/03/07/xmlserializer-vs-datacontractserializer-serialization-in-wcf/#comment-3010</guid>
		<description>Thank yo for great article!

I am having problem with DataContractSerializer while trying to serialize a generic tree from WCF to Silverlight. The tree is something like this: http://dvanderboom.wordpress.com/2008/03/15/treet-implementing-a-non-binary-tree-in-c/
I can send you the actual source code if needed.

I am using IsReference set to &quot;true&quot; and it results that the first node is itself child. I mean that in the original tree a node is not itself child, but when it&#039;s serialzed then a node have a child with the same Id. So when the tree is deserialized on Silverlight side and we traverse on the tree, we came up with an endless loop.

Have you encounter similar behavior? Any ideas what might have cause this and how to resolve it?

Thanks in advance!</description>
		<content:encoded><![CDATA[<p>Thank yo for great article!</p>
<p>I am having problem with DataContractSerializer while trying to serialize a generic tree from WCF to Silverlight. The tree is something like this: <a href="http://dvanderboom.wordpress.com/2008/03/15/treet-implementing-a-non-binary-tree-in-c/" rel="nofollow">http://dvanderboom.wordpress.com/2008/03/15/treet-implementing-a-non-binary-tree-in-c/</a><br />
I can send you the actual source code if needed.</p>
<p>I am using IsReference set to &#8220;true&#8221; and it results that the first node is itself child. I mean that in the original tree a node is not itself child, but when it&#8217;s serialzed then a node have a child with the same Id. So when the tree is deserialized on Silverlight side and we traverse on the tree, we came up with an endless loop.</p>
<p>Have you encounter similar behavior? Any ideas what might have cause this and how to resolve it?</p>
<p>Thanks in advance!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pankaj Pant</title>
		<link>http://www.danrigsby.com/blog/index.php/2008/03/07/xmlserializer-vs-datacontractserializer-serialization-in-wcf/comment-page-1/#comment-2996</link>
		<dc:creator>Pankaj Pant</dc:creator>
		<pubDate>Thu, 12 Mar 2009 10:36:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.danrigsby.com/blog/index.php/2008/03/07/xmlserializer-vs-datacontractserializer-serialization-in-wcf/#comment-2996</guid>
		<description>Gr8 explanation...
Thanks
Pankaj Pant</description>
		<content:encoded><![CDATA[<p>Gr8 explanation&#8230;<br />
Thanks<br />
Pankaj Pant</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: devvvy</title>
		<link>http://www.danrigsby.com/blog/index.php/2008/03/07/xmlserializer-vs-datacontractserializer-serialization-in-wcf/comment-page-1/#comment-2995</link>
		<dc:creator>devvvy</dc:creator>
		<pubDate>Wed, 11 Mar 2009 05:48:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.danrigsby.com/blog/index.php/2008/03/07/xmlserializer-vs-datacontractserializer-serialization-in-wcf/#comment-2995</guid>
		<description>I think [KnownType(&quot;GetKnownType&quot;)] will be ignored by XmlSerializer/WCF for classes which opt for [Serializable] over [DataContract] - how can known type be registered in this case?

Thanks</description>
		<content:encoded><![CDATA[<p>I think [KnownType("GetKnownType")] will be ignored by XmlSerializer/WCF for classes which opt for [Serializable] over [DataContract] &#8211; how can known type be registered in this case?</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: XmlSerializer vs DataContractSerializer - Shlomo</title>
		<link>http://www.danrigsby.com/blog/index.php/2008/03/07/xmlserializer-vs-datacontractserializer-serialization-in-wcf/comment-page-1/#comment-1559</link>
		<dc:creator>XmlSerializer vs DataContractSerializer - Shlomo</dc:creator>
		<pubDate>Mon, 08 Dec 2008 16:09:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.danrigsby.com/blog/index.php/2008/03/07/xmlserializer-vs-datacontractserializer-serialization-in-wcf/#comment-1559</guid>
		<description>[...] ההבדלים העיקריים בין ש</description>
		<content:encoded><![CDATA[<p>[...] ההבדלים העיקריים בין ש</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ajay</title>
		<link>http://www.danrigsby.com/blog/index.php/2008/03/07/xmlserializer-vs-datacontractserializer-serialization-in-wcf/comment-page-1/#comment-1435</link>
		<dc:creator>Ajay</dc:creator>
		<pubDate>Mon, 03 Nov 2008 12:18:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.danrigsby.com/blog/index.php/2008/03/07/xmlserializer-vs-datacontractserializer-serialization-in-wcf/#comment-1435</guid>
		<description>Hi Dan,
Nice article... I have one question.
I am creating a REST service using WCF. We have c++ client also. Currently i have used the DataContractSerialize to serialize/deserialize. It is working perfectly with c# client. We have yet to test with c++ client. My question : Whether c++ client can deserialize the object serialized using DataContractSerilizer or my service need to use XMLSerialization instead of DataContractSerialize.

Thanks in advance..
Ajay</description>
		<content:encoded><![CDATA[<p>Hi Dan,<br />
Nice article&#8230; I have one question.<br />
I am creating a REST service using WCF. We have c++ client also. Currently i have used the DataContractSerialize to serialize/deserialize. It is working perfectly with c# client. We have yet to test with c++ client. My question : Whether c++ client can deserialize the object serialized using DataContractSerilizer or my service need to use XMLSerialization instead of DataContractSerialize.</p>
<p>Thanks in advance..<br />
Ajay</p>
]]></content:encoded>
	</item>
</channel>
</rss>

