No DataContract attribute added

Oct 1, 2009 at 11:57 AM

Hi

Firstly, thanks for developing - and making open source - your product. It looks fantastic!

I'm experiementing with your software - trying to generate data contracts from xsd - and I noticed that the generated code does not contain a [DataContract()] class attribute or DataMember.

Is this an error, or am I misunderstanding something?

 

Thanks

Coordinator
Oct 1, 2009 at 12:45 PM
Edited Oct 1, 2009 at 12:47 PM

WSCF.blue v1 currently always generates XmlSerializer-compatible types. The DataContract feature (i.e. DataContractSerializer) does not support a lot of XSD constructs (by design), so falling back to XmlSerializer is the safest way to guarantee proper code generation.

We are thinking about enhancing the code generation engine to first try to create [DataContract] code, and if it fails to fall back to XmlSerializer.

 

Thanks,

-Christian

Oct 1, 2009 at 1:44 PM

Hi Christian

Thanks for the reply.

I found this nice comparison between the two serializers, if anyone is interested.

http://www.danrigsby.com/blog/index.php/2008/03/07/xmlserializer-vs-datacontractserializer-serialization-in-wcf/