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

Example of documentation is not working
 
waddle
Jr. Member
 
Total Posts:  9
Joined:  2008-10-10
 

Hi everyone,

I tried the example given in the SOAP API documentation, but it seems that it doesn’t work.

I can login (i get a sessionId) but i get this error :

Fatal errorUncaught SoapFault exception[HTTP] Error Fetching http headers in F:\softwares\wamp\www\test.php:
Stack trace

#0 [internal function]: SoapClient->__doRequest('<?xml version="...', 'http://127.0.0....', 'urn:Mage_Api_Mo...', 1, 0) 
#1 [internal function]: SoapClient->__call('call', Array) 
#2 F:\softwares\wamp\www\test.php(7): SoapClient->call('4jhf7onu9ud4rqp...', 'product.list', Array) 
#3 {main} thrown in F:\softwares\wamp\www\test.php on line 7

Here is the code, pretty simple :

<?php
$proxy 
= new SoapClient('http://127.0.0.1/magento/index.php/api/soap/?wsdl');
$sessionId $proxy->login('root''rootroot');
$filters = array(
          
'name' => array('like'=>'phone%')
      );
$products $proxy->call($sessionId'product.list', array($filters));
var_dump($products);
?>

regards

 
Magento Community Magento Community
Magento Community
Magento Community
 
patrick24601
Jr. Member
 
Total Posts:  5
Joined:  2008-10-05
 

Did you ever find out your issue?

 
Magento Community Magento Community
Magento Community
Magento Community
 
waddle
Jr. Member
 
Total Posts:  9
Joined:  2008-10-10
 

No, I let it go.

However, the API is crap as there is only a few methods, and they always return “any-type”, so it’s more like a C API…

I managed to call the Magento soap services with the Flex SOAP client, but it’s horribly slow. And I’m only using the demo DB !

IMHO, don’t ever use this crappy Magento SOAP API.

Regards

 
Magento Community Magento Community
Magento Community
Magento Community
 
MindMagnet
Jr. Member
 
Avatar
Total Posts:  13
Joined:  2009-02-02
Cluj-Napoca
 

Found the problem.

You need to set the “default_socket_timeout” in your php.ini on the machine you’re doing the SOAP call from to a larger value (I set it to 1200).

You can do this by changing the php.ini, through .htaccess or simply by adding a line with ini_set("default_socket_timeout",1200); to your PHP file that’s doing the SOAP call.

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