我刚刚在Magento 1.9中创建了自定义SOAP api模块。我只是尝试从magento外部访问产品列表。它抛出:
“致命错误:未捕获的SoapFault异常:[2]拒绝访问。在/opt/lampp/htdocs/products.php:4堆栈跟踪:#0 /opt/lampp/htdocs/products.php(4):SoapClient - > __ call('customapiProduc ...',Array)在第4行的/opt/lampp/htdocs/products.php中抛出#1 {main}“
我的products.php代码是:
$client = new SoapClient('http://127.0.0.1/mage1/index.php/api/v2_soap?wsdl=1');
$sessionid = $client->login('admin', 'productdata');
$result= $client->customapiProductList($sessionid);
var_dump($result);