肥皂产品列表输出- Magento


Soap Product List Output - Magento

我尝试过使用Magento API文档通过SOAP时间输出我的产品列表,整个事情看起来像这样:(http://www.magentocommerce.com/api/soap/introduction.html)

<?php
//include the Magento API file - replace with your server path to the file
require_once('/absolut-dirl/app/Mage.php');
/***** Configuration ******/
$myAPILogin = 'login';
$myAPIKey = 'key';

// Begin SOAP Requests
$client = new SoapClient('https://shop-url.com/index.php/api/soap/?wsdl');
$session = $client->login($myAPILogin, $myAPIKey);
//get all my database products into an array
$products = $client->call($session, 'catalog_product.list');
echo "Starting product loop...<br/><br/>";
var_dump($products);
?>

但是,结果总是得到NULL。我做错了什么?关于快速帮助,我会很感激的。

问候Roley

//对不起,我的英语不好。

登录凭证可能有问题。使用try catch block和check。

try
{
    $proxy  = new SoapClient($magento_webserver."api/soap/?wsdl");
    $sessionId  = $proxy->login($magento_webservices_username,  $magento_webservices_passwd);
    echo "Soap login complete! <br/>";
    echo "======================== <br/>";
}
catch (SoapFault $fault)
{
    die("'n'n SOAP Fault: (fault code: {$fault->faultcode},
    fault string: {$fault->faultstring}) <br/>");
}

我添加了try-catch块并得到以下结果:

Soap Login complete!
========================