【问题标题】:Is there a (C#) library that will create feeds for Amazon Marketplace Web Services?是否有(C#)库可以为 Amazon Marketplace Web Services 创建提要?
【发布时间】:2011-02-11 06:51:58
【问题描述】:

有谁知道那里有一个库(最好是 C#),它可以接受类并生成适用于亚马逊市场网络服务提要的 XML 或平面文件?

换句话说,我想做这样的事情:

        var feed = new AmazonProductFeed();
        var list = new AmazonProductList();

        var product1 = new AmazonProduct();
        product1.Name = "Product 1";
        list.Add(product1);

        var product2 = new AmazonProduct();
        product2.Name = "Product 2";
        list.Add(product2);

        feed.Products = list;
        // spits out XML compliant with Amazon's schema
        Console.Write(feed.ToXml());

看起来亚马逊提供的唯一代码是 Web 服务本身的包装器和基于目录的传输实用程序 (AMTU)。

【问题讨论】:

    标签: c# amazon


    【解决方案1】:

    .NET XML Schema Definition Tool 可用于从任何 XSD 生成类,并可与 XML 序列化程序结合使用以执行所描述的操作。

    Selling On Amazon XML 指南 (SOA-GuideToXML.pdf) 不包含对正确 XSD 的引用。链接与文档中重新打印的 XSD 不一致。我用于更正 XSD 的旧链接不再有效。我最好的猜测是可以在here 找到它们(需要登录卖家中心)。

    据我所知,这个(很长的)命令将生成所有需要的类。请注意,您需要对生成的文件进行一些小的更改。我不记得它的工作方式,但我需要将某些二维数组更改为一维数组([][] 到 []),反之亦然。我记得我必须做出这些改变的地方是相当明显的:

    xsd xsd\amzn-base.xsd xsd\amzn-envelope.xsd xsd\amzn-header.xsd xsd\AttributeGroups.xsd xsd\AutoAccessory.xsd xsd\Beauty.xsd xsd\CameraPhoto.xsd xsd\CatPIL.xsd xsd\CE.xsd xsd\ClothingAccessories.xsd xsd\Customer.xsd xsd\CustomerAddress.xsd xsd\FoodAndBeverages.xsd xsd\FulfillmentCenter.xsd xsd\FulfillmentOrderCancellationRequest.xsd xsd\FulfillmentOrderRequest.xsd xsd\Gourmet.xsd xsd\Health.xsd xsd\Home.xsd xsd\HomeImprovement.xsd xsd\Image.xsd xsd\Inventory.xsd xsd\Item.xsd xsd\Jewelry.xsd xsd\Lighting.xsd xsd\Listings.xsd xsd\ListingSummary.xsd xsd\Loyalty.xsd xsd\MerchantListingsReport.xsd xsd\Miscellaneous.xsd xsd\MultiChannelOrderReport.xsd xsd\Music.xsd xsd\MusicalInstruments.xsd xsd\NavigationReport.xsd xsd\Offer.xsd xsd\Office.xsd xsd\OrderAcknowledgement.xsd xsd\OrderAdjustment.xsd xsd\OrderFulfillment.xsd xsd\OrderNotificationReport.xsd xsd\OrderReport.xsd xsd\Override.xsd xsd\PaymentMethod.xsd xsd\PetSupplies.xsd xsd\Price.xsd xsd\ProcessingReport.xsd xsd\Product.xsd xsd\ProductAttributes.xsd xsd\ProductClothing.xsd xsd\ProductImage.xsd xsd\Relationship.xsd xsd\ReverseFeed.xsd xsd\SettlementReport.xsd xsd\Sports.xsd xsd\Store.xsd xsd\SWVG.xsd xsd\TiresAndWheels.xsd xsd\Tools.xsd xsd\ToysBaby.xsd xsd\TypeDefinitions.xsd xsd\Video.xsd xsd\WebstoreItem.xsd xsd\Wireless.xsd  /c /n:WebLinc.Services.Amazon.Marketplace > output.txt 2>&1
    pause
    

    【讨论】:

    • Josh 你能把正确的 xsd 放在外部链接中吗?因为每次我登录网站后尝试打开链接时都会告诉我“你没有查看此页面的权限”虽然我是登录 谢谢
    • 我一直在尝试,但无法生成文件。我收到这样的错误:错误:为架构生成类时出错... - 带有 targetNamespace='' 的架构语法无效。已经声明了 simpleType 'PercentageType'。第 4 46 行,位置 3。 - simpleType 'PercentageType' 已被声明。有什么想法吗?
    • 抱歉回复晚了。代理类生成器有很大的吸引力。据我所知,您只需手动修复这些错误。
    猜你喜欢
    • 1970-01-01
    • 2019-04-15
    • 1970-01-01
    • 2010-10-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-05-06
    • 2015-05-26
    相关资源
    最近更新 更多