Instead, you can try using the JSON API. I tried to get a working sample, but I do not have the application name, so I can not check the result. Here is the code:
<?php $appName = "Your App Name Here"; $post_data = array( 'jsonns.xsi' => 'http://www.w3.org/2001/XMLSchema-instance', 'jsonns.xs' => 'http://www.w3.org/2001/XMLSchema', 'jsonns.tns' => 'http://www.ebay.com/marketplace/search/v1/services', 'tns.findItemsByKeywordsRequest' => array( 'keywords' => 'harry potter pheonix' ) ); $headers = array( "X-EBAY-SOA-REQUEST-DATA-FORMAT: JSON", "X-EBAY-SOA-RESPONSE-DATA-FORMAT: JSON", "X-EBAY-SOA-OPERATION-NAME: findItemsByKeywords", "X-EBAY-SOA-SECURITY-APPNAME: $appName" ); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'http://svcs.ebay.com/services/search/FindingService/v1'); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($post_data)); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $result = curl_exec($ch); if($result) { $response = json_decode($result); } curl_close($ch); ?>
You need to populate $appName any application name. You also need to set X-EBAY-SOA-OPERATION-NAME to the actual call, and change the JSON if the call is different.
onteria_ May 26 '11 at 1:58 2011-05-26 01:58
source share