【问题标题】:Amazon MWS client library C# AWS Access Key Id error亚马逊 MWS 客户端库 C# AWS 访问密钥 ID 错误
【发布时间】:2017-08-07 04:59:08
【问题描述】:

我正在使用 Amazon C# 客户端库获取产品信息并不断收到错误消息“您提供的 AWS 访问密钥 ID 在我们的记录中不存在。” (是的,我试过卖家论坛,但没有得到答案)。当我使用他们的暂存器使用相同的访问密钥时,我得到了正确的响应。我确实看到了这篇文章 (Getting 'The AWS Access Key Id you provided does not exist in our records' error with Amazon MWS) 并尝试交换参数,但没有成功。这是我的 C# 代码。任何帮助将不胜感激

string AccessKey = "xxx";
            string SecretKey = "xxx";
            string AppName = "ProductFunctionsApp";
            string AppVersion = "1.0";
            string ServiceURL = "https://mws.amazonservices.com/Products/2011-10-01";
            string SellerId="xxxx";
            string MarketPlaceId = "xxx";//US
            //right now MWSAuthToken is only if a developer is using a sellers account
              MarketplaceWebServiceProductsConfig config = new MarketplaceWebServiceProductsConfig();
             config.ServiceURL = ServiceURL;
             config.SignatureMethod = "HmacSHA256";
             config.SignatureVersion = "2";
 MarketplaceWebServiceProductsClient client = new MarketplaceWebServiceProductsClient(AppName, AccessKey, SecretKey, AppVersion, config);
  ASINListType type = new ASINListType();
            List<string> ASINList = new List<string>();
            ASINList.Add("B001E6C08E");
            type.ASIN = ASINList;
           ;
          GetCompetitivePricingForASINRequest request = new GetCompetitivePricingForASINRequest();
            request.SellerId = SellerId;
            request.ASINList = type;
            request.MarketplaceId = MarketPlaceId;
  GetCompetitivePricingForASINResponse response = client.GetCompetitivePricingForASIN(request);

【问题讨论】:

  • 我对 PHP 包也有同样的问题。有这方面的消息吗?
  • 好吧,没关系,解决了:我在脚本中间定义了常量,结果它们是空的; PHP基础-.-我发现这个转储了MarketplaceWebService_Client的构造函数的参数

标签: c# amazon-mws


【解决方案1】:

他们的一些 API 客户端具有以不同顺序定义的类初始化参数。

因此,如果您复制并粘贴初始化代码,最终会发送应用程序名称而不是访问密钥。

        var service = new MarketplaceWebServiceProductsClient(
            applicationName, applicationVersion, accessKeyId, secretAccessKey, config);

这里不一样:

        var service = new FBAInventoryServiceMWSClient(
            accessKeyId, secretAccessKey, applicationName, applicationVersion, config);

仔细检查每一个。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多