说真的,我很困惑。我有一个由类制成的 .XSD,以便我可以传递给 Web 服务。它把它作为一个 XMLSchema 对象传递给 web 服务,现在我需要将它变成一个类,以便我可以在 web 服务端用它制作对象。我知道 XSD.exe 是答案,但如果我能确切地弄清楚如何实现这个东西,我会被诅咒的。我需要它在运行时进行此转换,因此我需要将它的代码放入我的项目中,并且我看到的所有使用 XSD.exe 的参考都谈到从命令行调用它。我的 .XSD 在下面。
<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="Field">
<xs:complexType>
<xs:sequence>
<xs:element name="Name" type="xs:string" />
<xs:element name="Type" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
在我的项目中,它存在于 XMLSchema 对象中。我如何把它变成一个类?
- 非常感谢您提供的任何帮助。