Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

401 Not Authorised error while consuming soap service from nodejs soap client

Former Member
0 Likes
901

Hi,

I am consuming SAP soap service from within nodejs using soap client. I tried the following code but got the 401 not authorized error. Can anyone help what is the mistake I am doing ? From SoapUI it is working fine with Basic Authentication. Here is my code:

const soap = require('soap');
const url = 'http://somedomain.com:8000/sap/bc/srt/rfc/sap/zint_customer_master_1/100/zint_customer_master_1/zint_customer_master_1';

const options = {
wsdl_header: {
'Authorization': 'Basic ' + Buffer.from('myuser:mypass').toString('base64')
}
}
soap.createClient(url, options, function (err, client) {
if (err) {
console.log(err)
} else {
console.log("Client established successfully")
}
});

Hi,

I am consuming SAP soap service from within nodejs using soap client. I tried the following code but got the 401 not authorized error. Can anyone help what is the mistake I am doing ? From SoapUI it is working fine with Basic Authentication. Here is my code:

const soap = require('soap');
const url = 'http://somedomain.com:8000/sap/bc/srt/rfc/sap/zint_customer_master_1/100/zint_customer_master_1/zint_customer_master_1';

const options = {
wsdl_header: {
'Authorization': 'Basic ' + Buffer.from('myuser:mypass').toString('base64')
}
}
soap.createClient(url, options, function (err, client) {
if (err) {
console.log(err)
} else {
console.log("Client established successfully")
}
});

0 REPLIES 0