0

我正在尝试从 eBay APICategoryFeatures使用。Typhoeus::Request我在 Ubuntu Server 11.04 上使用 Ruby 版本 1.9.3 和 Rails 3.2.3。

我的代码如下:

xml = <GetCategoryFeaturesRequest xmlns="urn:ebay:apis:eBLBaseComponents"> 
<RequesterCredentials>
<eBayAuthToken> MY_eBayAuthToken </eBayAuthToken>
</RequesterCredentials>
<WarningLevel>High</WarningLevel>
</GetCategoryFeaturesRequest>


header = {
"X-EBAY-API-DEV-NAME" => my_devID,
  "X-EBAY-API-APP-NAME" => my_appID,
  "X-EBAY-API-CERT-NAME" => my_certID,
  "X-EBAY-API-CALL-NAME" => "GetCategoryFeatures",
  "X-EBAY-API-COMPATIBILITY-LEVEL" => "1.3.0",
  "X-EBAY-API-SITEID" => 1,
  "Content-Type" => "text/xml",
}
url = "https://api.sandbox.ebay.com/ws/api.dll "
res = Typhoeus::Request.post(url, :body => xml, :headers => header )

我收到了这个错误:

<?xml version=\"1.0\" encoding=\"UTF-8\" ?>
<GeteBayOfficialTimeResponse xmlns=\"urn:ebay:apis:eBLBaseComponents\">
<Timestamp>2012-07-05 06:41:28</Timestamp>
<Ack>Failure</Ack><Errors>
<ShortMessage>Unsupported API call.</ShortMessage>
<LongMessage>The API call \"GeteBayOfficialTime\" is invalid or not supported in this release.</LongMessage>
<ErrorCode>2</ErrorCode>
<SeverityCode>Error</SeverityCode>
<ErrorClassification>RequestError</ErrorClassification>
</Errors>
<Build>14991382</Build>
</GeteBayOfficialTimeResponse>

有谁知道如何修理它?

4

1 回答 1

2

尝试在测试工具中测试您的 XMl: https ://developer.ebay.com/DevZone/build-test/test-tool/default.aspx

我运行这个 XML 并且它可以工作:

<?xml version="1.0" encoding="utf-8"?>
<GetCategoryFeaturesRequest xmlns="urn:ebay:apis:eBLBaseComponents">
<RequesterCredentials>
<eBayAuthToken> my_Token </eBayAuthToken>
</RequesterCredentials>
</GetCategoryFeaturesRequest>
于 2012-08-29T11:57:56.360 回答