Make request to SOAP endpoint using axios

前端 未结 2 1731
梦毁少年i
梦毁少年i 2020-12-05 05:28

I need to make request to SOAP endpoint using axios in my React application. Hence I need to pass xml data in request and receive xml data in respo

2条回答
  •  天涯浪人
    2020-12-05 06:17

    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)
      })
    

提交回复
热议问题