我正在开发一个项目,使用 C# 中的 MWS 将产品上传到亚马逊。我有他们的类库,并尝试从 XSD 文件生成类,就像我为其他类似项目所做的那样。但是,运行 xsd.exe 来生成类会引发错误。如:
Error generating classes for schema 'amzn-envelope'. - Schema with targetNamespace='' has invalid syntax. The simpleType 'BluRayRegionType' has already been declared. Line 130, position 3.
xsd 文件有很多包含并且有多个引用。我是否缺少标准的解决方法/解决方案?还是亚马逊的 XSD 文件不能用于生成类?如果它们不可用,我该怎么做才能实现这一目标?
编辑:
不幸的是,XSD 在 Amazon Seller Central 上需要付费卖家帐户才能登录,所以我无法链接它们。
本题:Is there a (C#) library that will create feeds for Amazon Marketplace Web Services? 类似,也未解决。
最佳答案
您需要使用 xsd.exe 或 xsd2code 实用程序将 xsd 文件转换为 C# 类。 xsd2code 也有 Visual studio 插件。
关于c# - 亚马逊 MWS C# XSD 类生成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28100481/