示例#1
0
文件: ebay.php 项目: heshuai64/ebo
 public function getShippingLocationDetails()
 {
     global $argv;
     if (!empty($argv[2])) {
         $this->setAccount(1);
         $this->configEbay($argv[2]);
     }
     try {
         $client = new eBaySOAP($this->session);
         $Version = $this->version;
         $DetailName = "ShippingLocationDetails";
         $params = array('Version' => $Version, 'DetailName' => $DetailName);
         $results = $client->GeteBayDetails($params);
         print_r($results);
         foreach ($results->ShippingLocationDetails as $shippingLocationDetails) {
             $sql = "insert into ship_to_location (SiteID,ShippingLocation,Description) \n\t\tvalues ('" . $this->site_id . "','" . $shippingLocationDetails->ShippingLocation . "','" . mysql_escape_string($shippingLocationDetails->Description) . "')";
             echo $sql;
             echo "<br>";
             $result = mysql_query($sql, eBayListing::$database_connect);
         }
         echo "<h2>Fetch " . $this->site_id . " End.</h2>";
         echo "<br>";
         echo "<br>";
         echo "<br>";
         //----------   debug --------------------------------
         //print "Request: \n".$client->__getLastRequest() ."\n";
         //print "Response: \n".$client->__getLastResponse()."\n";
         //$this->("ShippingLocationDetails-Request-".date("Y-m-d H:i:s").".xml", $client->__getLastRequest());
         //$this->saveFetchData("ShippingLocationDetails-Response-".date("Y-m-d H:i:s").".xml", $client->__getLastResponse());
     } catch (SOAPFault $f) {
         print $f;
         // error handling
     }
 }