问题
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