/ Published in: PHP
Here is an example on how to insert a new partner using PHP. This example makes use the phpxmlrpc library, available on sourceforge.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<? include('xmlrpc.inc'); 'name'=>new xmlrpcval('Fabien Pinckaers', "string") , 'vat'=>new xmlrpcval('BE477472701' , "string") ); $client = new xmlrpc_client("http://localhost:8069/xmlrpc/object"); $msg = new xmlrpcmsg('execute'); $msg->addParam(new xmlrpcval("dbname", "string")); $msg->addParam(new xmlrpcval("3", "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 !'; ?>
URL: http://doc.openerp.com/developer/6_22_XML-RPC_web_services/