You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 18, 2020. It is now read-only.
I tried your codesample, but the API is ready message never comes:
inwx({api: "production", user: "myusername", password: "mypassword"}, function(api){
console.log("API is ready");
Trying with testing api produces the error (but OK, I don't even have an testing API account and don't known how to make one, so..):
4|inwx | Error
4|inwx | at ClientRequest.<anonymous>
(/home/myusername/nodejs_apps/node_modules/inwx/lib/inwx.js:62:15)
4|inwx | at emitOne (events.js:77:13)
4|inwx | at ClientRequest.emit (events.js:169:7)
4|inwx | at Socket.socketErrorListener (_http_client.js:258:9)
4|inwx | at emitOne (events.js:77:13)
4|inwx | at Socket.emit (events.js:169:7)
4|inwx | at emitErrorNT (net.js:1256:8)
4|inwx | at nextTickCallbackWith2Args (node.js:441:9)
4|inwx | at process._tickDomainCallback (node.js:396:17)
PM2 | App [inwx] with id [4] and pid [12695], exited with code [1] via signal [SIGINT]
Trying with production API, I looked into the node_modules/inwx/lib/inwx.js file and tried out some console.log messages to get an idea of where the problem is.
function inwx(opts, readyCallback) {
...
this.client = xmlrpc.createClient({ host: opts.host, isSecure: true, path: "/xmlrpc/", cookies: true });
console.log("inwx.js: so far 1"); // is called successfully
this.call("account", "login", {user: opts.user, pass: opts.password}, function(response) {
console.log("inwx.js: connected!"); // never called!!!
this.connected = true;
readyCallback.call(this, that);
});
return that;
}
inwx.prototype.call = function call(object, method, params, successCallback, errorCallback) {
if(!object) throw new Error("missing object for xmlrpc call");
if(!method) throw new Error("missing method for xmlrpc call");
console.log("inwx.js: so far 2"); // is called successfully
this.client.methodCall(object + "." + method, [ params ], function(error, response){
console.log("inwx.js: so far 3"); // never called!!!
if(error) {
So apparently the callback function of this.client.methodCall is never called.
Tested on fresh Ubuntu 16.04 LTS server (nodejs v4.2.6) and fresh Ubuntu 17.10 desktop (nodejs v6.11.4). freshly installed NodeJS via:
cd ~ && mkdir nodejs_apps && cd nodejs_apps
sudo apt-get install nodejs npm build-essential
sudo ln -s "$(which nodejs)" /usr/bin/node
sudo npm install express
sudo npm install body-parser
sudo npm install request
sudo npm install pm2 -g
sudo npm install inwx
working with pm2 to run the app
I tried your codesample, but the API is ready message never comes:
Trying with testing api produces the error (but OK, I don't even have an testing API account and don't known how to make one, so..):
Trying with production API, I looked into the
node_modules/inwx/lib/inwx.js
file and tried out some console.log messages to get an idea of where the problem is.So apparently the callback function of
this.client.methodCall
is never called.Tested on fresh Ubuntu 16.04 LTS server (nodejs v4.2.6) and fresh Ubuntu 17.10 desktop (nodejs v6.11.4). freshly installed NodeJS via:
Full example app is here: https://pastebin.com/bhdREpNf
The text was updated successfully, but these errors were encountered: