… how to generate classes from XSDs that include

If you have ever consumed a POX web service, you’ve probably been given an XSD.  A typical pattern is to run XSD.EXE against the XSD file to generate C# classes.  You can then use XmlSerializer to deserialize the XML response.  All is good… unless the XSD relies on other XSD files and imports via <xsd:import/> statement.  When you attempt to generate C# classes, the XSD util will complain of missing elements or datatypes.

Previously, I would edit the main XSD and paste in the imported XSD.  Really annoying.  Couldn’t figure out how to the XSD util to follow the directive.  Until now… 🙂

XSD util lets you supply multiple .xsd files. Extemely simple solution.

xsd.exe /c Main.xsd External1.xsd
Advertisements

~ by Bob Banks on 07/30/2009.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: