XML RPC non-object on scalarval

一个人想着一个人 提交于 2019-12-12 04:13:59

问题


I have the following script to login to openERP:

<?php
include('../xmlrpc/lib/xmlrpc.inc');

$dbname = 'km';
$user = 'admin';
$pwd = 'pass';
$url = 'http://localhost:8069'; // it's demo server url
$sock = new xmlrpc_client("http://localhost:8069");

$sock_msg = new xmlrpcmsg('login');
$sock_msg->addParam(new xmlrpcval($dbname, "string"));
$sock_msg->addParam(new xmlrpcval($user, "string"));
$sock_msg->addParam(new xmlrpcval($pwd, "string"));
$sock_resp = $sock->send($sock_msg);

if ($sock_resp->errno != 0){
echo  'error';
}else{

$sock_val = $sock_resp->value();

$user_id = $sock_val->scalarval();

}
?>

I get the following error:

Fatal error: Call to a member function scalarval() on a non-object in (whatever)

I don't know where i am failing here. Is it something in the configuration? or perhaps i am doing something else wrong.

Since i am new to XMLRPC and OpenERP, please provide as much information as possible.

Thanks !

来源:https://stackoverflow.com/questions/24245149/xml-rpc-non-object-on-scalarval

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!