OpenERP XML-RPC在localhost上运行良好,但在实时服务器上运行不正常

时间:2014-05-07 13:16:40

标签: php openerp

我在VPS上有一个OpenERP系统设置,我创建了一个PHP类来连接它。

当我通过localhost执行它时,该类工作正常。但是当我在实时服务器上传文件时,它会出错:

  

“无法登录连接错误:连接超时(110)”

这是我创建的课程。

include_once("xmlrpc.inc");
class OpenERPXmlrpc {
    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;
      }
   }
// Some Methods... 

0 个答案:

没有答案