Reputation: 12071
I'm writing an API for NOAA forecast data, and I'm trying to get the information from a XML document like this into a de-serialized object. I Downloaded the schema and it's two dependacies (meta_data.xsd & ndfd_data.xsd ) and tried running this command
svcutil C:\DWML.xsd /dconly
But it returns with
Error: Cannot read D:\DWML.xsd.
Cannot load file D:\DWML.xsd as an Assembly. Check the FusionLogs for more information.
Can someone please walk me through the steps to create data contract for this xml document?
If there is an easier way to get this information into a easily querable form that doesn't require Data Contracts I'm willing to change my approach.
Upvotes: 1
Views: 1249
Reputation: 3915
You need to supply all the xsd files to SvcUtil like so
svcutil *.xsd /dconly
However trying this with NOAA schema gives bunch of errors and it suggested to use /importXmlTypes
. But the following did not work for me either:
svcutil *.xsd /dconly /ser:XmlSerializer /importXmlTypes
Finally, used Xsd2Code
xsd2Code.exe DWML.xsd
and it worked like a charm.
Upvotes: 1