I am referring below code for calling SOAP API using node js Below is my code
var soapWSDL = "http://test.com?wsdl";
var params = {
Username:’test’,
Password:'test',
};
var callback = function (res, error, retval) {
if (error) {
console.log(error);
return;
}
console.log(retval);
res.send(retval);
}
soap.createClient(soapWSDL, params,function (err, client) {
if (err) {
return callback(res, err, null);
}
client.setSecurity(new soap.BasicAuthSecurity('test','test’));
var args = {Fields: 'test };
client.WorksheetFetch(args, function(err, result) {
callback(err, result);
});
But I am getting “Request was unauthorized “error although I have given right credentials.
Aucun commentaire:
Enregistrer un commentaire