2017-02-28 7 views
0

私は売り手のためにカスタムラベルが設定された店舗内の商品を見つけるためにリクエストxmlを送る。しかし、eBayは、私の店にない多くのアイテムの返答を返します。 どうすればいいですか?finditemsinebaystoresは私の店舗以外の商品を返す

私のコードです:

$endpoint = 'http://svcs.ebay.com/services/search/FindingService/v1'; 
self::get_cvs_array(); 
$xmlrequest; 
$xml_filters = ""; 
$a = 1; 
while ($a < count($this->cvs_array)) { 
    $xml_filters .="<itemFilter>\n<name>Custom Label</name>\n<value>".$this->cvs_array[$a][0]."</value>\n</itemFilter>\n"; 
    $a += 1; 
} 
// Create the XML request to be POSTed 
$xmlrequest = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"; 
$xmlrequest .= "<findItemsIneBayStoresRequest xmlns=\"http://www.ebay.com/marketplace/search/v1/services\">\n"; 
$xmlrequest .= "<storeName>myStoreName</storeName>\n"; 
$xmlrequest .= $xml_filters; 
$xmlrequest .= "</findItemsIneBayStoresRequest>"; 

// Set up the HTTP headers 
$headers = array(
'X-EBAY-SOA-SERVICE-NAME: FindingService', 
'X-EBAY-SOA-OPERATION-NAME: findItemsIneBayStores', 
'X-EBAY-SOA-SERVICE-VERSION: 1.3.0', 
'X-EBAY-SOA-REQUEST-DATA-FORMAT: XML', 
'X-EBAY-SOA-GLOBAL-ID: EBAY-ES', 
'X-EBAY-SOA-SECURITY-APPNAME: $myAppId', 
'Content-Type: text/xml;charset=utf-8', 
); 

$session = curl_init($endpoint);      // create a curl session 
curl_setopt($session, CURLOPT_POST, true);    // POST request type 
curl_setopt($session, CURLOPT_HTTPHEADER, $headers); // set headers using $headers array 
curl_setopt($session, CURLOPT_POSTFIELDS, $xmlrequest); // set the body of the POST 
curl_setopt($session, CURLOPT_RETURNTRANSFER, true); // return values as a string, not to std out 

$responsexml = curl_exec($session);      // send the request 
curl_close($session); 

答えて

0

findItemsIneBayStoresは店舗を持っている売り手からアイテムを見つけるためのものです。

自分でアイテムを入手するには、代わりにGetMyeBaySellingを使用してください。この呼び出しで

、あなたは(販売、落札されなかった、などは含まれません)だけで、あなたのアクティブなリストを取得するために

<ActiveList> 
    <Include>true</Include> 
</ActiveList> 

を使用することができます。 必要なすべてのドキュメントが見つかりますhere

関連する問題