Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Magento API - Can login no problem, but then get Access Denied on method calls
 
JonathanDavies
Jr. Member
 
Total Posts:  1
Joined:  2012-10-07
 

Hi

Magento ver. 1.4.0.1

I can login to the web-service no problem with the following code:

//This is the WSDL file of the magento install you are importing products too
define('MAGENTO_WSDL''http://#######');
define('MAGENTO_USER''########');
define('MAGENTO_API_KEY''my-api-key');

try 
{
  
//Try to get and log into the Magento soap client
  
$magentoClient = new SoapClient(MAGENTO_WSDL);
  
$magentoSession $magentoClient->login(MAGENTO_USERMAGENTO_API_KEY);
  echo(
'magento client');
  
catch(Exception $e{
  
echo ("Error connecting to Magento service: ".$e->getMessage()); exit;
}

However when I then try to call a method I get ‘Access Denied’:

try {
  
// Get the attribute set
  
$attributeSets $magentoClient->call($magentoSession'product_attribute_set.list');
  
$set current($attributeSets);
catch (Exception $e{
  
echo "Issues with Magento web service: " $e->getMessage();
  exit;
}

This always returns: “Issues with Magento web service: Access denied”

Any help would be much appreciated.

Jonathan

 
Magento Community Magento Community
Magento Community
Magento Community
 
bfritton
Jr. Member
 
Avatar
Total Posts:  8
Joined:  2011-10-12
Chicago
 

Getting this problem as well. Logs in just fine, the api session is created in the DB table. Tried recreating the API user and whatnot. Nothing works.

Any help? v1.5.0.2

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top