views:

6077

answers:

10

Hi,

I'm trying to create a soap connection to Magento's web services, however I'm getting an error when I try and create an instance of the soap client class. I can view the wsdl file in firefox without problems and I can watch php make the request for the wsdl in apaches logs but it still fails. Nusoap can connect.

$proxy = new SoapClient('someaddress?wsdl');

The error is

<b>Fatal error</b>:  Uncaught SoapFault exception: [HTTP] Error Fetching http headers in /home/sites/xxx/xxx_main/system/application/views/contentpage_templates/gift_service.php:29
Stack trace:
[internal function]: SoapClient-&gt;__doRequest('&lt;?xml version=&quot;...',    'http://cornishw...', 'urn:Mage_Api_Mo...', 1, 0)
[internal function]: SoapClient-&gt;__call('call', Array)
/home/sites/xxx/xxx_main/system/application/views/contentpage_templates/gift_service.php(29): SoapClient-&gt;call(NULL, 'catalog_categor...', 5, 'giftshop')
/home/sites/xxx/xxx_main/system/application/libraries/MY_Loader.php(586): include('/home/sites/cor...')
/home/sites/xxx/xxx_main/system/application/libraries/MY_Loader.php(228): MY_Loader-&gt;_ci_load(Array, '')
/home/sites/xxx/xxx_main/system/application/modules/contentpage/controllers/contentpage.php(44): MY_Loader-&gt;view('contentpage_tem...', false, true)
[internal function]: Contentpage-&gt;index()
/home/sites/xxx in <b>/home/sites/xxx/xxx_main/system/application/views/contentpage_templates/gift_service.php</b> on line <b>29</b>

Thanks

A: 

I am not about your PHP configuration but until PHP 5.2.6 , PHP does have some problem with SOAP client.

bugs.php.net/bug.php?id=41983

openidsujoy
A: 

Did you try adding

'trace'=>1,

to SoapClient creation parameters and then:

var_dump($client->__getLastRequest());
var_dump($client->__getLastResponse());

to see what is going on?

hegemon
+1  A: 

Try to set :

default_socket_timeout = 120

in your php.ini

This helped for me in case completely unrelated with Magento.
mindeh
A: 

Added :

default_socket_timeout = 480

just like you said.... worked fine on the soap client

thanks.

A: 

Eso era lo que me pasaba.... yo tambien tenia ese problema... solo me queda agredecerte mucho por esto... Gracias totales

alejandro cid
A: 

http://www.google.com/

Mike
A: 

In my apache error log, I saw:

[Tue Feb 16 14:55:02 2010] [notice] child pid 9985 exit signal File size limit exceeded (25)

So I, removed all the contents of my largest log file 2.1GB /var/log/system.log. Now everything works.

saintsjd
A: 

Hi, I am using Soapclient in my magento project to import database from other database. I have used the following code to call webservices.. $proxy = new SoapClient('http://navsoft.co.in:8088/ironore/index.php/api/?wsdl1');

$sessionId = $proxy->login('apiusername', 'apikey'); When i run this code in my local machine it works fine and i can insert data to the database without any error. while running the same code in my testing server, it gives me an error like Uncaught SoapFault exception: [HTTP] ..... i have made change to my server and make default_socket_timeout = 480 but no result...

My testing server default port is 8088. Can any one suggest me why it throws this error. Any suggestion is highly appreciated.. Please help me..

Thanks Narayan

Narayan Kumar
A: 

Narayan, did you add the 8088 to your URL? As in http://testserver:8088/ ?

Rick
A: 

There is an issue in php version less than 5.2.6. You may need to upgrade the version of php.

obiyoda