In the help that it will be useful:

If you get the error:

Fatal error: Uncaught exception 'Zend_Http_Client_Adapter_Exception'
 with message 'Unable to Connect to sslv2://<servername>
when trying to connect to a server over SSL with the Zend_XmlRpc_Client, then the problem might well be that you need to tell the client that it should use sslv3 rather than the default sslv2. Fortunately, the Zend Framework makes this really quite simple:

$socket = new Zend_Http_Client_Adapter_Socket();
$socket->setConfig(array('ssltransport'=>'sslv3'));

$http_client = new Zend_Http_Client();
$http_client->setAdapter($socket);

$client = new Zend_XmlRpc_Client($endpoint_url);
$client->setHttpClient($http_client);

Basically, Zend_XmlRpc_Client allows you to specify a Zend_Http_Client instance to use instead of creating a new one. Zend_Http_Client in turn lets you specify an Adapter instance to use in place of the default, and the Socket_Adapter lets you set its ‘ssltransport’ config option, so chaining these together makes things work.

2 Responses to “Having fun with Zend_XmlRpc_Client”

  1. Paul Bain Says:
    Ahh, the genius of the Zend Framework! Have you guys at Senokian been using it much?
  2. Greg Says:
    We've used bits of it for a few things. The Http stuff is nice, Mail is so much cleaner than the horrible mail() function and the Search_Lucene functionality is pretty powerful.

Leave a Reply