Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trying XML RPC client with an https request #142

Open
natoine opened this issue Aug 22, 2017 · 2 comments
Open

trying XML RPC client with an https request #142

natoine opened this issue Aug 22, 2017 · 2 comments

Comments

@natoine
Copy link

natoine commented Aug 22, 2017

Hi,
I'd like to use your node xmlrpc module to make requests to a Odoo server
http://www.odoo.com/documentation/10.0/api_integration.html

I've tried :
const client = xmlrpc.createClient("https://[myOdooServer]/xmlrpc/2/common")
client.methodCall('version ', [], function (error, value) {
console.log('Method response for 'version': ' + value)
})

And I've got the following error :
http_client.js:55
throw new Error('Protocol "' + protocol + '" not supported. ' +
^
Error: Protocol "https:" not supported. Expected "http:"

Do I miss something or is this module not adapted for https requests ?

@grahamrhay
Copy link

you need to use:

const client = xmlrpc.createSecureClient("https://[myOdooServer]/xmlrpc/2/common")

(I also found that confusing)

@bitsnaps
Copy link

bitsnaps commented Jan 3, 2022

This one works for me (v15) enterprise:

username='admin'
password = 'admin'
db = 'demo_150_1641216360'
url = 'https://demo3.odoo.com'

const client = xmlrpc.createSecureClient(url+"/xmlrpc/2/common");
client.methodCall('version', [], function (error, value) {
  if (error){
    console.log('Error when calling a method: '+ error);
    return;
  }
  console.log('Method response for version: ', value);
});

client.methodCall('authenticate', [db, username, password, {}], function (error, uid) {
  if (error){
    console.log('Error when calling a method: '+ error);
    return;
  }
  console.log('uid:', uid);
});

matchu added a commit to openneo/impress-2020 that referenced this issue Aug 3, 2022
This was a bit trickier to figure out how to upgrade, it's not in the `xmlrpc` package's README, but I found the answer here: baalexander/node-xmlrpc#142
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants