Magento Forum

   
Problem with the Core API
 
Bastian_B
Jr. Member
 
Total Posts:  4
Joined:  2009-04-16
 

Hello,

I want to use the Magento Core API but i have some problems :-(. I run a virtual machine (VMware) to test the api. I added a user access and used the following code:

<?php

$proxy          
= new SoapClient('http://127.0.0.1/magento/api/soap/?wsdl');
$sessionId $proxy->login('testuser''ekomi123'); 
 
// View all customers
var_dump($proxy->call($sessionId'customer.list'));

?>

After opening the file i get:

Fatal error: Uncaught SoapFault exception: [2] Access denied. in /opt/lampp/htdocs/magento/api/index.php:5 Stack trace: #0 [internal function]: SoapClient->__call(’login’, Array) #1 /opt/lampp/htdocs/magento/api/index.php(5): SoapClient->login(’testuser’, ‘ekomi123’) #2 {main} thrown in /opt/lampp/htdocs/magento/api/index.php on line 5

Can anybody help me? Thanks a lot.

Best regards,
Bastian

 
Magento Community Magento Community
Magento Community
Magento Community
 
vianetz
Guru
 
Avatar
Total Posts:  537
Joined:  2008-04-13
Munich, Germany
 

Hi,

just some hints:
- Did you assign group privileges?
- Can you call the URL directly in browser?
- Is the Username / Password combination correct?

Best regards

 
Magento Community Magento Community
Magento Community
Magento Community
 
Bastian_B
Jr. Member
 
Total Posts:  4
Joined:  2009-04-16
 

how can i assign group privileges? i have only added a new user. yes i can call URL directly and the combination is correct.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Bastian_B
Jr. Member
 
Total Posts:  4
Joined:  2009-04-16
 

cool now i got it!!! i only must add a group rasberry. thanks a lot!!!

 
Magento Community Magento Community
Magento Community
Magento Community
 
vianetz
Guru
 
Avatar
Total Posts:  537
Joined:  2008-04-13
Munich, Germany
 

System->Web Services->Roles

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