i follow this documentation https://www.odoo.com/documentation/8.0/api_integration.html to connect java to odoo 8 web services.
I tried both online and localhost, but none are working.
http://localhost:8069/start nor https://demo.odoo.com/start
http://localhost:8069/xmlrpc nor https://demo.odoo.com/xmlrp
http://localhost:8069/xmlrpc/2/common nor https://demo.odoo.com/xmlrpc/2/common
the error said no url found/exist.
org.apache.xmlrpc.client.XmlRpcHttpTransportException: HTTP server returned unexpected status: NOT FOUND
Sincerely
IGAM Muliarsa
Here is my source code:
import java.net.MalformedURLException; import java.net.URL; import org.apache.xmlrpc.XmlRpcException; import org.apache.xmlrpc.client.XmlRpcClient; import org.apache.xmlrpc.client.XmlRpcClientConfigImpl; public class TestOdoo {
public static void main(String[] args) {
//String url = "http://localhost:8069/xmlrpc/common";
String url = "https://demo.odoo.com";
//String url = "https://demo.odoo.com/start";
XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
try {
config.setServerURL(new URL(url+"/xmlrpc/2/common"));
} catch (MalformedURLException e) {
e.printStackTrace();
}
XmlRpcClient client = new XmlRpcClient();
client.setConfig(config);
Object[] params = new Object[]{"test", "admin", "admin"}; Object res;
try {
res = client.execute("login", params);
System.out.print(res);
} catch (XmlRpcException e) {
e.printStackTrace();
}
} }
Yeah, not much happens here ;)