Skip to Content
Menu
This question has been flagged
2 Replies
9073 Views

How can I use OpenERP 6.x's XML-RPC implementation via Javascript, I've tried many js libraries i.e.:

mimic-xmlrpc from sourceforge, timheap/jquery-xmlrpc from github

this is my code:

            var user = 'admin';
            var password = 'admin';
            var dbname = 'dbName';
            var authority = 'http://';
            var server = 'localhost';
            var port = '8069';
            var server_url = authority + server + port + '/xmlrpc/';

            var forcedUserValue = $.xmlrpc.force('string', user);
            var forcedPasswordValue = $.xmlrpc.force('string', password);
            var forcedDbNameValue = $.xmlrpc.force('string', dbname);

            $.xmlrpc({
                url: server_url + 'common',
                methodName: 'login',
                dataType: jsonp,
                params: [forcedDbNameValue, forcedUserValue, forcedPasswordValue],
                success: function(response, status, jqXHR) {
                     alert("Success!");
                },
                error: function(jqXHR, status, error) {
                     alert(jqXHR + '-' + status + '-' + error);
                }
            });

but I'm not getting any response?

Avatar
Discard
Best Answer

Utilize right XML-RPC Lib

http://goo.gl/rZP1Y6

 

Avatar
Discard
Best Answer

   var user = 'admin';
            var password = 'admin';
            var dbname = 'openerpdemo';
            var authority = 'http://';
            var server = 'odoo.knysys.com';
            var port = '8069';
            var server_url = authority + server + ':' + port + '/xmlrpc/';

            var forcedUserValue = $.xmlrpc.force('string', user);
            var forcedPasswordValue = $.xmlrpc.force('string', password);
            var forcedDbNameValue = $.xmlrpc.force('string', dbname);

            $.xmlrpc({
                url: server_url + 'common',
                methodName: 'login',
                dataType: 'jsonrpc',
                params: [forcedDbNameValue, forcedUserValue, forcedPasswordValue],
                success: function(response, status, jqXHR) {
                     // debugger;
      alert("response:"+response+"\n"+"status:"+status+"\n"+"jqXHR:"+jqXHR+"\n");
                },
                error: function(jqXHR, status, error) {
                     alert(jqXHR + '-' + status + '-' + error);
                }
            });

 

There was : missing in your code

and also run your program with brwser security here it is

for chrome in run use this

chrome.exe --disable-web-security

 

Avatar
Discard