I had created a PHP class to connect to it.
The class works fine when I execute it through the localhost. But when I upload the files on a live server, it gives an error:
"Unable to login Connect error: Connection timed out (110)"
Here is the class I have created.
include_once("xmlrpc.inc");
class OdooXmlrpc {
private $user, $password, $database, $services, $client, $res, $msg, $id;
function __construct($usr, $pass, $db, $server) {
$this->user = $usr;
$this->password = $pass;
$this->database = $db;
$this->services = $server;
$this->client = new xmlrpc_client($this->services.'common');
$this->msg = new xmlrpcmsg('login');
$this->msg->addParam(new xmlrpcval($this->database, "string"));
$this->msg->addParam(new xmlrpcval($this->user, "string"));
$this->msg->addParam(new xmlrpcval($this->password, "string"));
$this->res = &$this->client->send($this->msg);
if(!$this->res->faultCode()){
$this->id = $this->res->value()->scalarval();
}
else {
echo "Unable to login ".$this->res->faultString();
exit;
}
}