Make request to SOAP endpoint using axios
let xmls='<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"\
xmlns:web="http://www.webserviceX.NET/">\
<soapenv:Header/>\
<soapenv:Body>\
<web:ConversionRate>\
<web:FromCurrency>INR</web:FromCurrency>\
<web:ToCurrency>USD</web:ToCurrency>\
</web:ConversionRate>\
</soapenv:Body>\
</soapenv:Envelope>';
axios.post('http://www.webservicex.com/CurrencyConvertor.asmx?wsdl',
xmls,
{headers:
{'Content-Type': 'text/xml'}
}).then(res=>{
console.log(res);
}).catch(err=>{console.log(err)});
This code help to make soap request
I used the answer of @Anuragh KP but with a SOAPAction header
axios.post('https://wscredhomosocinalparceria.facilinformatica.com.br/WCF/Soap/Emprestimo.svc?wsdl',
xmls,
{headers:
{
'Content-Type': 'text/xml',
SOAPAction: 'http://schemas.facilinformatica.com.br/Facil.Credito.WsCred/IEmprestimo/CalcularPrevisaoDeParcelas'}
}).then(res => {
console.log(res)
}).catch(err => {
console.log(err.response.data)
})