Hi.
I want to create another database in openerp using php through xmlrpc.
Firstly, i located the database creation method on openerp: create_db in addons/base_quality_interrogation.py line 167.
And after that, i create my php code :
<?php
// import of xmlrpc library for php
include('xmlrpc.inc');/* identifiants of the new database */
$user = 'admin';
$password = 'my_db';
$dbname = 'my_db';
$lang="en_US";$server_url = 'http://localhost:8069'; //server url with security verification
$client = new xmlrpc_client($server_url . "/xmlrpc/db");
$client->setSSLVerifyPeer(0);$msg = new xmlrpcmsg('create_db'); // method create_db allow us to create a new database on openerp
$msg->addParam(new xmlrpcval($dbname, "string"));
$msg->addParam(new xmlrpcval($user,'string'));
$msg->addParam(new xmlrpcval($password,'string'));
$msg->addParam(new xmlrpcval($lang,'string'));
$response = $client->send($msg);
echo "<pre>";
print_r($response);
echo "</pre>";
?>
The running of the above php code produce the errors below :
xmlrpcresp Object (
[val] => 0
[valtyp] =>
[errno] => -1
[errstr] => Traceback (most recent call last):
File "C:\openerp\Server\server\.\openerp\service\wsgi_server.py", line 82, in xmlrpc_return
File "C:\openerp\Server\server\.\openerp\netsvc.py", line 296, in dispatch_rpc
File "C:\openerp\Server\server\.\openerp\service\web_services.py", line 120, in dispatch
KeyError: 'Method not found: create_db'
[payload] =>
[hdrs] => Array
(
[content-type] => text/xml
[content-length] => 628
[server] => Werkzeug/0.8.2 Python/2.6.5
[date] => Wed, 20 Aug 2014 07:02:08 GMT
)
[_cookies] => Array ( )
[content_type] => text/xml
[raw_data] => HTTP/1.0 200 OK
Content-Type: text/xml
Content-Length: 628
Server: Werkzeug/0.8.2 Python/2.6.5
Date: Wed, 20 Aug 2014 07:02:08 GMT
faultCode
Method not found: create_db
faultString
Traceback (most recent call last):
File "C:\openerp\Server\server\.\openerp\service\wsgi_server.py", line 82, in xmlrpc_return
File "C:\openerp\Server\server\.\openerp\netsvc.py", line 296, in dispatch_rpc
File "C:\openerp\Server\server\.\openerp\service\web_services.py", line 120, in dispatch
KeyError: 'Method not found: create_db'
)
?>
I nedd a help. Thank you.