lautr.com

Hannes Blog for Development and Stuff besides

zf

XML-RPC “read timeout” after 10 Seconds with Zend_XmlRpc_Client

| 3 Kommentare

Recently i had a small Problem with the Service of a Partner we use for a new Project, it worked all together just fine, but just was a little bit slow at times, so i often got a Red Timeout after 10 Seconds.
All you’ve to do here is, of course, increase the timeout by configuring the Zend_Http_Client that is used here, unfortunately you ether have to set it in every method you use like:

$this->_httpClient->setConfig(array('timeout' => '60'));

(if you like me has an own class that extends from Zend_XmlRpc_Client to do your bidding). O

r must supply a full new, configured HTTP Client like:

$httpClient = new Zend_Http_Client;
$httpClient->setConfig(array('timeout' => '60'));
$xmlrpcClient = new Zend_XmlRpc_Client('http://www.foobar.com/service',$httpClient);

(or something along those lines)

Autor: Hannes

Hi! I’m Johannes Lauter a 26 year old Web Application Developer based in Berlin ... more

3 Kommentare

  1. Save two lines of code:

    $xmlrpcClient = new Zend_XmlRpc_Client(‘http://www.foobar.com/service',$httpClient);
    $xmlrpcClient->getHttpClient()->setConfig(array(‘timeout’ => ’60′));

  2. Gna, of course use the following in the first line:
    $xmlrpcClient = new Zend_XmlRpc_Client(‘http://www.foobar.com/service’);

  3. Thx Andy :D i guess there a lot of ways to handle that one

Hinterlasse eine Antwort

Pflichtfelder sind mit * markiert.

*