ebaySOAP示例示例给出了错误

时间:2013-09-18 12:13:31

标签: php ebay

为什么我得到了 错误警告:SoapClient :: __ doRequest():无法找到包装器“https” - 您是否忘记在配置PHP时启用它

我的错误是什么?

我的代码是

$config = parse_ini_file('ebay.ini', true);
$site = $config['settings']['site'];
$compatibilityLevel = $config['settings']['compatibilityLevel'];

$dev = $config[$site]['devId'];
$app = $config[$site]['appId'];
$cert = $config[$site]['cert'];
$token = $config[$site]['authToken'];
$location = $config[$site]['gatewaySOAP'];

// Create and configure session
$session = new eBaySession($dev, $app, $cert);
$session->token = $token;
$session->site = 203; // 0 = US;
$session->location = $location;

// Make an AddItem API call and print Listing Fee and ItemID
try {

    $client = new eBaySOAP($session);

    $PrimaryCategory = array('CategoryID' => 357);

    $Item = array('ListingType' => 'Chinese',
                  'Currency' => 'INR',
                  'Country' => 'US',
                  'PaymentMethods' => 'PaymentSeeDescription',
                  'RegionID' => 0,
                  'ListingDuration' => 'Days_3',
                  'Title' => 'The new item',
                  'Description' => "It's a great new item",
                  'Location' => "San Jose, CA",
                  'Quantity' => 1,
                  'StartPrice' => 24.99,
                  'PrimaryCategory' => $PrimaryCategory,
                 );

    $params = array('Version' => $compatibilityLevel, 'Item' => $Item);
    $results = $client->AddItem($params);

    // The $results->Fees['ListingFee'] syntax is a result of SOAP classmapping
    print "Listing fee is: " . $results->Fees['ListingFee'] . " <br> \n";

    print "Listed Item ID: " . $results->ItemID . " <br> \n";

    print "Item was listed for the user associated with the auth token code       herer>\n";`enter code here`

} catch (SOAPFault $f) {
    print $f; // error handling
}

提前致谢 Murali

1 个答案:

答案 0 :(得分:2)

你必须添加(或取消注释)extension = php_openssl.dll;到你的php.ini文件。

相关问题