Skip to Content
Menu
This question has been flagged
2 Replies
7230 Zobrazenia

Hi, I've been playing with XML-RPC with OpenERP. It's finally can read data from OpenERP after fighting with tons of error. It seems to be at last step in use this XML-RPC to pass through OpenERP login page ( from my imagination :) ). Is this possible with XML-RPC, what command to instruct this process ? The document only shows CRUD operation.

Avatar
Zrušiť
Best Answer

Hi GonG.
With php, firstly downloads the xmlrpc library for php PHPXML-RPC. Downloads the 2.2.2 version.
In your php file, type :

<?php
include('xmlrpc.inc'); // inclusion of the phpxml-rpc library

$user = 'admin'; //your openerp user
$password = 'demo'; // the database password
$dbname = 'demo'; // the database

$server_url = 'http://your_ip:8069'; //connexion
$connexion = new xmlrpc_client($server_url . "/xmlrpc/common");
$connexion->setSSLVerifyPeer(0);

$c_msg = new xmlrpcmsg('login');
$c_msg->addParam(new xmlrpcval($dbname, "string"));
$c_msg->addParam(new xmlrpcval($user, "string"));
$c_msg->addParam(new xmlrpcval($password, "string"));
$c_response = $connexion->send($c_msg);


if ($c_response->errno != 0){

// failed connection
    echo  '<p>error : ' . $c_response->faultString() . '</p>';
}
else{
//successful connection

    $uid = $c_response->value()->scalarval();
    echo "  The user ID ( UID)  : ".$uid;

}

?>

NB: If the connexion succeed, you obtain the user id (uid).
This link (http://thierry-godin.developpez.com/openerp/openerp-xmlrpc-php-fr/) can help you.
Best reagrds.

Avatar
Zrušiť
Best Answer

please go through https://doc.openerp.com/6.0/developer/6_22_XML-RPC_web_services/ document, might be helpful for you. 

Avatar
Zrušiť
Related Posts Replies Zobrazenia Aktivita
3
júl 25
3221
1
okt 24
2324
1
apr 24
2388
0
sep 23
1841
1
jún 23
2324