I'm trying the following code to access product list
$client = new SoapClient('http://magentohost/api/soap/?wsdl');
$session = $client->login('apiUser', 'apiKey');
$result = $client->call($session, 'product.list');
$client->endSession($session);
But this is throwing the following error –
Fatal error: Uncaught SoapFault exception: [2] Access denied.
Can anyone help me to resolve this error ?.
Best Answer
Check if the apiUser and apiKey are correct or maybe try to set a new key/password via System > Web-Services > SOAP/XML-RPC - Users.
Disable WSDL Cache: Under System > Configuration > Magento Core API set Enable WSDL Cache to "No".
Updated/debug your script:
Try to run your script with the WSDL cache disabled settings: