This question has been flagged
1 Reply
11210 Views

I'm new to OpenERP and building a webservice in c# to communicate with a windows openerp server. I'm trying to call the following method in c#:

var RpcClient = XmlRpcProxyGen.Create<iopenerp>();

Object[] resSearch = RpcClient.search(DbName, UserId, Pwd, "product.product", "search", conditions.ToArray());

I'm getting the following exception: Server returned a fault exception: [Method not found: execute] Traceback (most recent call last): File "C:\Program Files (x86)\OpenERP 7.0-20130404-232436\Server\server.\openerp\service\wsgi_server.py", line 82, in xmlrpc_return File "C:\Program Files (x86)\OpenERP 7.0-20130404-232436\Server\server.\openerp\netsvc.py", line 293, in dispatch_rpc File "C:\Program Files (x86)\OpenERP 7.0-20130404-232436\Server\server.\openerp\service\web_services.py", line 430, in dispatch Exception: Method not found: execute

The search method in IOpenErp is

[XmlRpcMethod("execute")] Object[] search(string dbName, int userId, string pwd, string model, string method, Object[] filters);

Any suggestions are much appreciated

Avatar
Discard

I am experiencing the same problem using the PHP examples. The sample code for "login" works fine, but everything else fails. And the common denominator is that everything else relies on the "execute" method. I am running the current version of OpenERP 7 on Debian (whatever version that is - installed using apt two days ago). I'm sure the fix is to use a different method name, but I'm stumped if I can work out what it would be.

Author

I've gotten a little further. I looks like it has to do with the xmlrpc url. For Login that's http://localhost:8069/xmlrpc/common and for search and read you should use http://localhost:8069/xmlrpc/object

Best Answer

Hello,

I'm not familiar at all with c# language, but I practice a bit XML RPC on OpenERP. I feel that you "shift" some part of your construction. The error message you display is the answer from the XML RPC server on OpenERP, not a "local execution" error from your "client side". This mean XML RPC search should theoretically looks like :

<  PART ONE  XML RPC call      >  <   PART TWO       OpenERP method call          >
bla bla bla **'execute'** bla bla bla string dbName, int userId, string pwd, ....

I don't know why but it appear that "execute" word (the XML order) fall in "PART TWO" which should be the OpenERP query code itself.

In perl (I'm more familiar with perl) search query should looks like (just as example) :

my $ids = $server->call('execute', $db, $uid, $pw, $model, 'search', $query);

So,... I feel confident your issue is more a c# issue (bad syntax/construction in XMC RPC call) rather than in specific OpenERP XML RPC syntax.

Hope this will help you. Have a nice day @++ Nicolas

Avatar
Discard
Author

It seems now the issue is with the xmlrpc url being used. I was using http://localhost:8069/xmlrpc/common whereas it seems you should use ..../xmlrpc/object for the search function

You're right ! There is 2 URL, one for login and an other one to deal with OpenERP objects. Have a look to the Dev Book, there is some example (even not if in c#) http://doc.openerp.com/v6.0/developer/6_22_XML-RPC_web_services/index.html