【问题标题】:Amazon GetAuthToken c#亚马逊 GetAuthToken c#
【发布时间】:2015-05-29 18:06:39
【问题描述】:

我正在尝试从 Amazon Web Services 调用 GetAuthToken:

http://docs.developer.amazonservices.com/en_US/auth_token/AuthToken_GetAuthToken.html

我检查了 C# 客户端库,但找不到 GetAuthToken 作为方法。这是否已实施?我试图在没有库的情况下发出 POST 请求,但它失败了。这是我手动编写的请求和响应:

请求

POST https://mws.amazonservices.com/ HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Host: mws.amazonservices.com
Content-Length: 238
Expect: 100-continue
Connection: Keep-Alive

AWSAccessKeyId=XX&Action=GetAuthToken&SellerId=XX&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2014-09-01T16%3A41%3A16Z&Version=2011-07-01&Signature=vRBxMEXAMPLES2y0FGPufG4u7WY2HqhcsYUW6IVI9%2BQ%3D

回复:

HTTP/1.1 404 Not Found
Date: Fri, 03 Oct 2014 17:14:53 GMT
Server: AmazonMWS
x-mws-request-id: 1a0bd189-d3e9-40b8-a55d-a420c9ed4805
x-mws-timestamp: 2014-10-03T17:14:54.195Z
x-mws-response-context:   VaGpX6JmTb+cM7WqwM6Fs8/E4oExbxl5c7li/EU0ho2j0/WpcYuG1XZSQzkuyrlr+kVTKBdKeG6F 3nwhM5s2gg==
Content-Type: text/xml
Content-Length: 368
Vary: User-Agent

<?xml version="1.0"?>
<ErrorResponse xmlns="https://mws.amazonservices.com/">
 <Error>
   <Type>Sender</Type>
   <Code>InvalidAddress</Code>
   <Message>Resource / is not found on this server. API Section is missing or you have provided an invalid operation name.</Message>
 </Error>
 <RequestID>1a0bd189-d3e9-40b8-a55d-a420c9ed4805</RequestID>
</ErrorResponse>

【问题讨论】:

    标签: amazon-web-services amazon


    【解决方案1】:

    您的 ServiceURL 设置有误。您不能将其作为“mws.amazonservices.com”,您必须根据商店位置指定正确的 ServiceURL。使用以下设置之一(取自亚马逊库示例)或查看更完整的开发人员指南:

    // North America:
    $serviceUrl = "https://mws.amazonservices.com/Products/2011-10-01";
    
    // Europe
    $serviceUrl = "https://mws-eu.amazonservices.com/Products/2011-10-01";
    
    // Japan
    $serviceUrl = "https://mws.amazonservices.jp/Products/2011-10-01";
    
    // China
    $serviceUrl = "https://mws.amazonservices.com.cn/Products/2011-10-01";
    

    【讨论】:

      猜你喜欢
      • 2016-11-26
      • 2012-12-08
      • 2022-12-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-12-24
      • 2011-12-06
      相关资源
      最近更新 更多