Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
3864 Widoki

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;
      }
   }
Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
0
mar 18
4704
0
cze 16
3457
0
maj 16
3227
2
mar 15
10995
1
mar 15
8203