因此我編寫了一個簡單的php腳本,用於從eBay獲取物品。我使用PHP和SOAP。我可以通過其他通話獲得項目。但是,我需要使用findItemsAdvanced調用來獲取賣家的物品,但我無法使其工作。eBay使用PHP和SOAP查找API itemFilter無效
這是我到目前爲止有:
function call_ebay_id_api($itemID){
$location = 'http://svcs.ebay.com/services/search/FindingService/v1?SECURITY-APPNAME=****8&OPERATION-NAME=findItemsAdvanced&itemFilter(0).name=Seller&itemFilter(0).value=****';
$clientebay = new SoapClient(
"http://developer.ebay.com/webservices/Finding/latest/FindingService.wsdl",
array(
"exceptions" => 0,
"trace" => 1,
"location"=> $location
)
);
$requestebay = array("itemFilter" => array("name" => "Seller", "value" => "****"));
$xmlresultsebay = $clientebay->__soapCall('findItemsAdvanced', array($requestebay));
echo "REQUEST HEADERS:\n<pre>" . htmlentities($clientebay->__getLastRequestHeaders()) . "</pre>\n";
echo "REQUEST:\n<pre>" . htmlentities($clientebay->__getLastRequest()) . "</pre>\n";
echo "RESPONSE:\n<pre>" . htmlentities($clientebay->__getLastResponse()) . "</pre>\n";
echo 'd';
return $xmlresultsebay;
,並從該XML請求是:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.ebay.com/marketplace/search/v1/services">
<SOAP-ENV:Body>
<ns1:findItemsAdvancedRequest>
<itemFilter>
<name>Seller</name>
<value>*seller name here*</value>
</itemFilter>
</ns1:findItemsAdvancedRequest>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
它看起來像它們對API's page
然而,該示例我回來的迴應是錯誤的。它說我需要指定關鍵字或類別ID。當我這樣做時,我獲得了成功,但itemFilter不適用。
任何人都可以幫助我嗎?