2 |
- |
1 |
<?php
|
|
|
2 |
/* © 2013 eBay Inc., All Rights Reserved */
|
|
|
3 |
/* Licensed under CDDL 1.0 - http://opensource.org/licenses/cddl1.php */
|
|
|
4 |
?>
|
|
|
5 |
<?php
|
|
|
6 |
// be sure include path contains current directory
|
|
|
7 |
// to make sure samples work
|
|
|
8 |
ini_set('include_path', ini_get('include_path') . ':.:../php');
|
|
|
9 |
|
|
|
10 |
// Load general helper classes for eBay SOAP API
|
|
|
11 |
require_once 'eBaySOAP.php';
|
|
|
12 |
|
|
|
13 |
// Load developer-specific configuration data from ini file
|
|
|
14 |
$config = parse_ini_file('ebay.ini', true);
|
|
|
15 |
$site = $config['settings']['site'];
|
|
|
16 |
$dev = $config[$site]['devId'];
|
|
|
17 |
$app = $config[$site]['appId'];
|
|
|
18 |
$cert = $config[$site]['cert'];
|
|
|
19 |
$token = $config[$site]['authToken'];
|
|
|
20 |
$location = $config[$site]['gatewaySOAP'];
|
|
|
21 |
|
|
|
22 |
// Create and configure session
|
|
|
23 |
$session = new eBaySession($dev, $app, $cert);
|
|
|
24 |
$session->token = $token;
|
|
|
25 |
$session->site = 0; // 0 = US;
|
|
|
26 |
$session->location = $location;
|
|
|
27 |
|
|
|
28 |
// Deliver messages to the following URL
|
|
|
29 |
try {
|
|
|
30 |
$client = new eBaySOAP($session);
|
|
|
31 |
|
|
|
32 |
$params = array('Version' => 1081,);
|
|
|
33 |
$results = $client->GetNotificationPreferences($params);
|
|
|
34 |
|
|
|
35 |
print_r($results);
|
|
|
36 |
|
|
|
37 |
} catch (SOAPFault $f) {
|
|
|
38 |
print $f; // error handling
|
|
|
39 |
}
|
|
|
40 |
/*
|
|
|
41 |
// Uncomment below to view SOAP envelopes
|
|
|
42 |
print "Request: \n".$client->__getLastRequestHeaders() ."\n";
|
|
|
43 |
print "Request: \n".$client->__getLastRequest() ."\n";
|
|
|
44 |
print "Response: \n".$client->__getLastResponseHeaders()."\n";
|
|
|
45 |
print "Response: \n".$client->__getLastResponse()."\n";
|
|
|
46 |
*/
|
|
|
47 |
|
|
|
48 |
?>
|