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

need help with API
 
webhank
Jr. Member
 
Total Posts:  19
Joined:  2008-07-17
 

i am trying to use xmlrpc with the magento api and i keep getting this error

in /var/www/vhosts/domain.com/httpdocs/lib/Zend/XmlRpc/Client.php:284 Stack trace: #0 /var/www/vhosts/domain.com/httpdocs/lib/Zend/XmlRpc/Client.php(339): Zend_XmlRpc_Client->doRequest(Object(Zend_XmlRpc_Request)) #1 /var/www/vhosts/domain.com/httpdocs/pulls/test.php(13): Zend_XmlRpc_Client->call(’login’, Array) #2 {main} thrown in /var/www/vhosts/domain.com/httpdocs/lib/Zend/XmlRpc/Client.php on line 284

here is the code my script is running

<?php
ini_set
("display_errors"1);
error_reporting(E_ALL);

require_once(
'../app/Mage.php'); 
require_once 
'Zend/XmlRpc/Client.php';
$client = new Zend_XmlRpc_Client('http://domain.com/api/xmlrpc/');

// If somestuff requires api authentification,
// we should get session token
$session $client->call('login', array('user''pass'));

$r $client->call('call', array($session'customer.list'));
var_dump($r);

// If you don't need the session anymore
$client->call('endSession', array($session));
?>

can anyone point me in the right direction?

 
Magento Community Magento Community
Magento Community
Magento Community
 
alex2911
Member
 
Total Posts:  41
Joined:  2007-11-15
 

<?php

$client 
= new SoapClient('http://domain.com/api/soap/?wsdl');
$session $client->login('SOAPUser''Pass');
$r $client->call($session'customer.list');
var_dump($r);
$client->call('endSession', array($session));
this should work - you don’t need to include any magento-files.  but i didn’t tried xmlrpc at all. i use soap
 
Magento Community Magento Community
Magento Community
Magento Community
 
webhank
Jr. Member
 
Total Posts:  19
Joined:  2008-07-17
 

without the magento includes i just get this error.

Fatal error: Class ‘Zend_XmlRpc_Client’ not found in /var/www/vhosts/domain.com/httpdocs/pulls/test.php on line 9

 
Magento Community Magento Community
Magento Community
Magento Community
 
alex2911
Member
 
Total Posts:  41
Joined:  2007-11-15
 

do you need xmlrpc ?
if not, just try soap

 
Magento Community Magento Community
Magento Community
Magento Community
 
webhank
Jr. Member
 
Total Posts:  19
Joined:  2008-07-17
 

yeah i do - soap isn’t on my machine and i don’t want to re-compile php

 
Magento Community Magento Community
Magento Community
Magento Community
 
stereoscope
Jr. Member
 
Total Posts:  3
Joined:  2009-02-05
 

hey there!

i tried to use soap but the login method produces an error

$client = new SoapClient('http://127.0.0.1/magento/api/soap/?wsdl');
    
$sessionId $proxy->login('xxxxx''xxxxx');

does anybody has an idea to get this issue solved

greetings

 
Magento Community Magento Community
Magento Community
Magento Community
 
stereoscope
Jr. Member
 
Total Posts:  3
Joined:  2009-02-05
 
stereoscope - 11 February 2009 01:17 AM

hey there!

i tried to use soap but the login method produces an error

$client = new SoapClient('http://127.0.0.1/magento/api/soap/?wsdl');
    
$sessionId $proxy->login('xxxxx''xxxxx');


does anybody has an idea to get this issue solved

greetings

here is the errormessage

Fatal error: Call to a member function login() on a non-object in ....

 
Magento Community Magento Community
Magento Community
Magento Community
 
webhank
Jr. Member
 
Total Posts:  19
Joined:  2008-07-17
 

what are the file permissions supposed to be set to?  does it matter that i am trying to call from a sub directory?

 
Magento Community Magento Community
Magento Community
Magento Community
 
alex2911
Member
 
Total Posts:  41
Joined:  2007-11-15
 

$client = new SoapClient(’http://127.0.0.1/magento/api/soap/?wsdl’);
$sessionId = $proxy->login(’xxxxx’, ‘xxxxx’);

should be:

$client = new SoapClient(’http://127.0.0.1/magento/api/soap/?wsdl’);
$sessionId = $client->login(’xxxxx’, ‘xxxxx’);

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