Excepción SoapFault no capturada: [HTTP] Error al obtener encabezados http


Estoy tratando de crear una conexión soap a los servicios web de Magento, sin embargo, estoy recibiendo un error cuando intento crear una instancia de la clase cliente soap. Puedo ver el archivo wsdl en firefox sin problemas y puedo ver php hacer la solicitud para el wsdl en los registros de apaches, pero todavía falla. Nusoap puede conectarse.

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

El error es

<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>

Gracias

Author: Bill the Lizard, 2009-05-28

10 answers

Intenta establecer:

default_socket_timeout = 120

En su archivo php.ini.

 34
Author: Michael Sivolobov,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-08-28 07:23:50

¿Intentaste agregar

'trace'=>1,

A los parámetros de creación de SoapClient y luego:

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

Para ver lo que está pasando?

 11
Author: hegemon,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2009-05-29 05:55:47

Este error puede aparecer en el cliente si hay un problema en el lado del servidor. Por ejemplo, si el servidor SOAP es un script PHP con un error de análisis, el cliente fallará con este mensaje.

Si tiene el control del servidor, siga su Apache error_log en la máquina que aloja el servidor SOAP. En CentOS encontrará esto en / var/log/httpd / error_log, así que el comando es:

Tail-f/var/log/httpd / error_log

Ahora actualice el cliente y observe el mensaje de error. Se mostrará cualquier error de PHP con el script del servidor.

Espero que eso ayude a alguien.

 6
Author: David Hurst,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2010-11-19 17:21:34

Me enfrenté al mismo problema.
Lo dirigía como CLI. Así que PHP siempre se estaba ejecutando y tenía que hacer llamadas soap una y otra vez después de algún intervalo.
El error que hice fue usar patrón de Singleton para esto. Pensé que el uso de singleton causará aumento de rendimiento, pero inturn tengo

Error Fetching http headers in ...

Lo arreglé creando un nuevo objeto saop para cada llamada.

 4
Author: Rahul Prasad,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2013-05-30 13:20:07

No me interesa su configuración de PHP , pero hasta PHP 5.2.6, PHP tiene algún problema con el cliente SOAP:

Bug #41983-Error al buscar encabezados http

Bug # 41983

 2
Author: Posto,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-05-07 20:11:07

Si este es un problema relacionado con Magento, debe desactivar la indexación automática, ya que esto podría estar causando que el socket se agote (o expire). Puede volver a activarlo una vez que el script haya terminado sus tareas. Aumentando el tiempo de espera predeterminado del socket en php.ini también es una buena idea.

 1
Author: Michael Mussulis,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2012-12-02 13:08:10

En mi registro de errores de apache, vi:

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

Así que, eliminé todo el contenido de mi archivo de registro más grande 2.1 GB /var/log/system.registro. Ahora todo funciona.

 0
Author: saintsjd,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2010-02-16 20:44:13

Hay un problema en la versión de php inferior a 5.2.6. Es posible que necesite actualizar la versión de php.

 0
Author: obiyoda,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2010-10-14 18:06:52

Por favor, actualice su php.ini con

default_socket_timeout = 120

Puedes crear tu propio php.ini si php está instalado un CGI en lugar de un módulo Apache

 0
Author: Shahzeb chohan,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2013-12-05 13:46:52

Me enfrenté al mismo problema y probé toda la solución anterior. Lamentablemente nada funciona.

  1. Tiempo de espera del Socket (No trabajado)
  2. Agente de Usuario (No trabajado)
  3. Configuración SoapClient, cache_wsdly Keep-Alive etc..

Todo este juego de encabezados que estamos pasando. Resolví mi problema al agregar la propiedad de encabezado compression. Esto realmente requiere cuando se espera una respuesta en gzip comprimido formato.

//set the Headers of Soap Client. 
$client = new SoapClient($wsdlUrl, array(
    'trace' => true, 
    'keep_alive' => true,
    'connection_timeout' => 5000,
    'cache_wsdl' => WSDL_CACHE_NONE,
    'compression'   => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP | SOAP_COMPRESSION_DEFLATE,
));

Espero que ayude.

Buena suerte.

 0
Author: Sanjay Mohnani,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-05-26 10:21:01