eBay NVP api 返回失败
谁能告诉我为什么这个请求总是失败返回。当我添加 itemFilter(1).name=Seller&itemFilter(1).value(0)=sellerName 时,它才开始发生
。当我将其取出时,它工作正常。我知道当我取回数据时我可以解析出该信息,但这只是一种解决方法。
http://svcs.ebay.com/services/search/FindingService/v1
?OPERATION-NAME=findCompletedItems
&SERVICE-VERSION=1.0.0
&SECURITY-APPNAME=MY TOKEN HERE
&GLOBAL-ID=EBAY-US
&keywords=iphone+3gs+8gb
&categoryId=9355
&outputSelector=SellerInfo
&itemFilter(0).name=Condition
&itemFilter(0).value(0)=3000
&itemFilter(1).name=Seller
&itemFiler(1).value(0)=sellerName
这是我提出该请求时得到的结果:
<?xml version='1.0' encoding='UTF-8'?>
<findCompletedItemsResponse xmlns="http://www.ebay.com/marketplace/search/v1/services">
<ack>Failure</ack>
<errorMessage>
<error>
<errorId>46</errorId>
<domain>Marketplace</domain>
<severity>Error</severity>
<category>Request</category>
<message>Value is required for item filter, SELLER.</message>
<subdomain>Search</subdomain>
<parameter>SELLER</parameter>
</error>
</errorMessage>
<version>1.11.0</version>
<timestamp>2011-07-23T00:13:50.689Z</timestamp>
</findCompletedItemsResponse>
它不断告诉我没有为 itemFilter.name=Seller 设置值。我也尝试了相同的请求,但添加了另一个 itemFilter.value(1)=sellerName2
这是当我尝试该请求时它给我的:
<?xml version='1.0' encoding='UTF-8'?>
<errorMessage xmlns="http://www.ebay.com/marketplace/search/v1/services">
<error>
<errorId>5006</errorId>
<domain>CoreRuntime</domain>
<severity>Error</severity>
<category>System</category>
<message>Unable to create xml stream reader for NV: payload format incorrect or payload is empty</message>
<subdomain>Comm_Recv</subdomain>
<parameter name="Param1">NV</parameter>
</error>
</errorMessage>
Can anyone please tell me why this request keeps returning with failure. It only started happening when I added itemFilter(1).name=Seller&itemFilter(1).value(0)=sellerName
When I take that out, it works fine. I know I can just parse out that information when I get the data back, but that's just a hack-workaround.
http://svcs.ebay.com/services/search/FindingService/v1
?OPERATION-NAME=findCompletedItems
&SERVICE-VERSION=1.0.0
&SECURITY-APPNAME=MY TOKEN HERE
&GLOBAL-ID=EBAY-US
&keywords=iphone+3gs+8gb
&categoryId=9355
&outputSelector=SellerInfo
&itemFilter(0).name=Condition
&itemFilter(0).value(0)=3000
&itemFilter(1).name=Seller
&itemFiler(1).value(0)=sellerName
Here's what I get when I make that request:
<?xml version='1.0' encoding='UTF-8'?>
<findCompletedItemsResponse xmlns="http://www.ebay.com/marketplace/search/v1/services">
<ack>Failure</ack>
<errorMessage>
<error>
<errorId>46</errorId>
<domain>Marketplace</domain>
<severity>Error</severity>
<category>Request</category>
<message>Value is required for item filter, SELLER.</message>
<subdomain>Search</subdomain>
<parameter>SELLER</parameter>
</error>
</errorMessage>
<version>1.11.0</version>
<timestamp>2011-07-23T00:13:50.689Z</timestamp>
</findCompletedItemsResponse>
It keeps telling me that I don't have a value set for itemFilter.name=Seller. I also tried the same request but added another itemFilter.value(1)=sellerName2
This is what it gives me when I tried that request:
<?xml version='1.0' encoding='UTF-8'?>
<errorMessage xmlns="http://www.ebay.com/marketplace/search/v1/services">
<error>
<errorId>5006</errorId>
<domain>CoreRuntime</domain>
<severity>Error</severity>
<category>System</category>
<message>Unable to create xml stream reader for NV: payload format incorrect or payload is empty</message>
<subdomain>Comm_Recv</subdomain>
<parameter name="Param1">NV</parameter>
</error>
</errorMessage>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
由于您没有为每个项目使用多个值,因此它会失败。您当前的方式仅在每个项目存在多个值时进行评估,因此请尝试以下操作:
大多数程序员在其代码中使用诸如 (this) 之类的内容:
Since you are not using multiple values per item it fails. Your current way only will evaluate when multiple values per item are present therefore try this:
Most Programmers use something such as (this) in their code:
尝试
$params = http_build_query($your_array)
您还可以在 PHP 中
You can also try
$params = http_build_query($your_array)
in PHP