Ich möchte OkHttp3
Bibliothek verwenden, um mit Odoo v9 server
für meine Android
Anwendung zu verbinden. Es ist odoo-rpc-v3 bereits verfügbar, die intern verwendet android Volly library
und manchmal throws NullPointerException
ohne error messages
, die außerhalb meiner Kontrolle ist & stürzt die Anwendung ab. Die Odoo v9 Webdienste API Docs, die unter Verwendung Apache XML-RPC-Bibliothek in Java ist. Ich möchte denselben Aufruf unter Verwendung von OkHttp3 Bibliothek ausführen.Apache XML RPC Client Bibliothek äquivalent Anruf mit OKHttp3 für Odoo v9 Web Service API
Die Anrufe sind:
1. Anmelden in
final XmlRpcClient client = new XmlRpcClient();
final XmlRpcClientConfigImpl common_config = new XmlRpcClientConfigImpl();
common_config.setServerURL(
new URL(String.format("%s/xmlrpc/2/common", url)));
client.execute(common_config, "version", emptyList());
int uid = (int)client.execute(
common_config, "authenticate", asList(
db, username, password, emptyMap()
)
);
2. Aufruf von Methoden
final XmlRpcClient models = new XmlRpcClient() {{
setConfig(new XmlRpcClientConfigImpl() {{
setServerURL(new URL(String.format("%s/xmlrpc/2/object", url)));
}});
}};
models.execute("execute_kw", asList(
db, uid, password,
"res.partner", "check_access_rights",
asList("read"),
new HashMap() {{ put("raise_exception", false); }}
));
Letztlich XML-RPC mit OkHttp3 verwenden, die ich will. Alle Vorschläge, Richtlinien oder Hilfe sind willkommen. Danke im Voraus.
Hey Kannst du mir dabei helfen? Https: //stackoverflow.com/questions/46067346/is-there-anyone-integrated-odoo-with-android – Noufal
Ja, benutze jsonRPC, es gibt schon viele jsonRPC-Bibliotheken in JS geschrieben. Schreib es in Java auf. Sieh dir das https://github.com/akretion/odoo-json-rpc an –
Schau auch auf https://github.com/Odoo-mobile/framework –