我通过XMLRPC调用OpenERP的create方法:
Object[] valuesAllOL = new Object[]{ record };
Object[] all = new Object[]{TINY_DB, uid, PASSWORD, tableName, CREATE_OP, valuesAllOL};
Integer id = (Integer) xmlrpcClient.execute(COMMON_METHOD, all);
record
是hashmap
。
和
COMMON_METHOD = "execute_kw";
CREATE_OP = "create";
我遇到以下错误:
org.apache.xmlrpc.XmlRpcException: Traceback (most recent call last):
File "/opt/odoo/openerp/service/wsgi_server.py", line 75, in xmlrpc_return
result = openerp.http.dispatch_rpc(service, method, params)
File "/opt/odoo/openerp/http.py", line 114, in dispatch_rpc
result = dispatch(method, params)
File "/opt/odoo/openerp/service/common.py", line 23, in dispatch
raise Exception("Method not found: %s" % method)
Exception: Method not found: execute_kw
任何帮助将不胜感激
答案 0 :(得分:3)
检查xmlrpc端点的URL。您使用的是http://servername:port/xmlrpc/2/object
检查服务器日志,可能会有一些重要信息
检查您是否可以从运行java代码的服务器向运行odoo的服务器发送http查询,使用http://servername:port/xmlrpc/2/object
上的curl或wget来确保没有代理/防火墙问题