Posted by Kirby Turner on April 23, 2002

System.Xml.Serialization namespace in .NET totally kicks ass. It makes consuming and producing XML almost as easy as writing a class definition. Let me explain.

I am working on a project that includes a set of SOAP calls. These calls must consume and return XML. Lucky for me, an XML schema (.xsd file) already exist. Using the xsd.exe utility included with Visual Studio.NET, I generated a C# source file containing the class definitions and appropriate Xml.Serialization attributes needed to serialize/deserialize XML that adheres to the rules defined in the schema. And the great thing about xsd.exe is that expect for one attribute setting the generated code worked perfectly from the get go. This was a great time saver for me, and allowed me to focus on the implementation of the web service stubs for the SOAP calls.

In the future, whenever I need to consume or produce XML especially complex XML I plan to use System.Xml.Serialization.

Posted in uncategorized. Tagged in .