Saturday, July 23, 2011

Generate DataContract from an XML Schema

In the contract-first development approach, one can generate data contracts using an XML Schema.


Use WCF ServiceModel Metadata Utility Tool (Svcutil.exe) to generate DataContract type source code based on any XML Schema. Following is the sample command on how to use the Svcutil.exe tool:



svcutil.exe /target:code /dataContractOnly /serializer:DataContractSerializer /importXmlTypes MySchema.xsd


source: http://msdn.microsoft.com/en-us/magazine/cc163800.aspx

No comments:

Post a Comment