Note that there are some explanatory texts on larger screens.

plurals
  1. POError connection to XML-RPC using PHP
    primarykey
    data
    text
    <p>I'm having trouble trying to connect to a XML-RPC server in PHP.</p> <p>The address of the server is constructed like this: <a href="https://username:password@example.com/xmlrpc/" rel="nofollow">https://username:password@example.com/xmlrpc/</a></p> <p>I have tried different XML-RPC libraries with no luck, as far as I can see, they fail because of the use of username and password. The examples with no username/password authentication encounters no errors and returns the correct results.</p> <p>How could I retrieve the necessary information from the server?</p> <p>Best regards</p> <p>EDIT: I realised that the Zend framework have builtin support for XMLRPC:</p> <pre><code>&lt;?php set_include_path($_SERVER['DOCUMENT_ROOT'].'/lib/ZendFramework-1.11.5-minimal/library/'); require_once('Zend/Loader/Autoloader.php'); Zend_Loader_Autoloader::getInstance(); define('USERNAME', '*******'); define('PASSWORD', '*******'); define('LIST_ID', 42); define('HOSTNAME', 'https://'.USERNAME.'.clients.ubivox.com/xmlrpc/'); $http = new Zend_Http_Client(HOSTNAME, array('keepalive'=&gt;true)); $http-&gt;setAuth(USERNAME, PASSWORD, Zend_Http_Client::AUTH_BASIC); $client = new Zend_XmlRpc_Client(HOSTNAME, $http); try { $response = $client-&gt;call('ubivox.get_subscriber', array('email@user.com')); var_dump($response); } catch (Zend_XmlRpc_Client_FaultException $e) { var_dump($e); } ?&gt; </code></pre> <p>However unfortunately I'm getting some exceptions, that I'm unable to interpret:</p> <p>Fatal error: Uncaught exception 'Zend_XmlRpc_Client_HttpException' with message 'UNAUTHORIZED' in /var/www/website/data/www/websitetest.dk/lib/ZendFramework-1.11.5-minimal/library/Zend/XmlRpc/Client.php:288 Stack trace: #0 /var/www/website/data/www/websitetest.dk/lib/ZendFramework-1.11.5-minimal/library/Zend/XmlRpc/Client.php(372): Zend_XmlRpc_Client->doRequest(Object(Zend_XmlRpc_Request)) #1 /var/www/website/data/www/websitetest.dk/test.php(20): Zend_XmlRpc_Client->call('ubivox.get_subs...', Array) #2 {main} thrown in /var/www/website/data/www/websitetest.dk/lib/ZendFramework-1.11.5-minimal/library/Zend/XmlRpc/Client.php on line 288 </p> <p>Does anyone have any clue what I'm doing wrong?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload