Answer the question
In order to leave comments, you need to log in
Node soap, how to call methods synchronously?
I'm trying to do a newsletter using the turboSms service, I did it in php, it is easily solved there, then I download the soap package, after which I try to connect and authorize following the instructions, then I try to send sms, and then an error occurs, turboSms does not allow me to send a message and writes that I am not authorized, although before that authorization was successful, it turns out that the methods work asynchronously
var url='http://turbosms.in.ua/api/wsdl.html',
soap = require('soap'),
report = require('./errorReporting').report,
clientPhoneAlex="+30090999990",
clientPhoneVictoria="+30090999991"
authData={login:"11111",password:"22222"},
sender="BigLapa.com",
soapClient;
soap.createClient(url,function(error,client){
report(error);
client.Auth(authData,function(error,result){
report(error);
console.log(result);
console.log(1);
});
setTimeout(function(){
client.SendSMS({sender:"BigLapa.com",destination:clientPhoneAlex,text:"Пять минут полет нормальный"},function(error,result){
console.log(2);
report(error);
console.log(result);
});
},4000);
console.log(client.getHttpHeaders());
});
Answer the question
In order to leave comments, you need to log in
maybe because you need to send a message in the authorization callback, and not in parallel with it, albeit with a timeout. You write asynchronous code, if you understand what I mean.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question