こんにちは私はOpenERPを初めて使用し、PHPのCreateMethodを使用してOpenERPにレコードを挿入しようとすると、Accessdeniedというエラーが返されます。 以下は私の挿入コードです:
<?php
include('xmlrpc.inc');
$arrayVal = array(
'name'=>new xmlrpcval('Fabien Pinckaers', "string") ,
'vat'=>new xmlrpcval('BE477472701' , "string")
);
$client = new xmlrpc_client("http://107.23.27.60:8069/xmlrpc/object");
$msg = new xmlrpcmsg('execute');
$msg->addParam(new xmlrpcval("test_sys", "string"));
$msg->addParam(new xmlrpcval("1", "int"));
$msg->addParam(new xmlrpcval("demo", "string"));
$msg->addParam(new xmlrpcval("res.partner", "string"));
$msg->addParam(new xmlrpcval("create", "string"));
$msg->addParam(new xmlrpcval($arrayVal, "struct"));
$resp = $client->send($msg);
if ($resp->faultCode())
echo 'Error: '.$resp->faultString();
else
echo 'Partner '.$resp->value()->scalarval().' created !';
?>
上記のコードでは、test_sysはデータベース名であり、1は私のユーザーIDです。 出力は次のとおりです。
xmlrpcresp Object
(
[val] => 0
[valtyp] =>
[errno] => -1
[errstr] => Access denied.
[payload] =>
[hdrs] => Array
(
[content-type] => text/xml
[content-length] => 286
[server] => Werkzeug/0.8.3 Python/2.7.3
[date] => Thu, 10 Jan 2013 04:29:55 GMT
)
[_cookies] => Array
(
)
[content_type] => text/xml
[raw_data] => HTTP/1.0 200 OK
Content-Type: text/xml
Content-Length: 286
Server: Werkzeug/0.8.3 Python/2.7.3
Date: Thu, 10 Jan 2013 04:29:55 GMT
faultCode
AccessDenied
faultString
Access denied.
)