I googled everywhere, but no one posted the solution, everyone says to set a timeout in the config, but how do you do it?
How to reset / override this parameter from my client or XMLRPC server?
Here is what I am trying:
$server = new Zend_XmlRpc_Client('http://127.0.0.1/xmlrpc');
$client = $server->getProxy();
$client->setConfig(array('timeout'=>30));
Here is the error:
Fatal error: Uncaught exception 'Zend_XmlRpc_Client_FaultException'
with message 'Method "setConfig" does not exist'
in /usr/share/php/libzend-framework-php/Zend/XmlRpc/Client.php:370
Try to pass as arg:
$server = new Zend_XmlRpc_Client('http://127.0.0.1/xmlrpc', array('timeout'=>30));
Here is the error:
Catchable fatal error: Argument 2 passed to
Zend_XmlRpc_Client::__construct() must be an
instance of Zend_Http_Client
Found a solution, and here it is:
$server = new Zend_XmlRpc_Client('http://127.0.0.1/xmlrpc');
$http_client = $server->getHttpClient();
$http_client->setConfig(array('timeout'=>30));
$client = $server->getProxy();
One line works for me too:
$server = new Zend_XmlRpc_Client('http://127.0.0.1/xmlrpc');
$server->getHttpClient()->setConfig(array('timeout'=>30));
$client = $server->getProxy();
source
share