Last active
May 25, 2018 07:32
-
-
Save pmdownie/435ee29d3efc6b8dfa62c3f71e9dd7c7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>IKEA Soap</title> | |
<script src="https://unpkg.com/axios/dist/axios.min.js"></script> | |
<script type="text/javascript"> | |
function soap() { | |
axios.post('/ikea/fetch', {id: CUSTOMER_ID}).then(response => console.log(response)) | |
} | |
</script> | |
</head> | |
<body> | |
<form name="Demo" method="POST"> | |
<input type="text" id="fname" name="fname"> | |
<input type="text" id="lname" name="lname"> | |
<input type="button" value="Soap" onclick="soap()" /> | |
</form> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import axios from 'axios'; | |
const fetch = () => (req, res) => { | |
let sr = | |
'<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="ikea.cusmgmt.remote.ws">' + | |
'<SOAP-ENV:Body>' + | |
'<ns1:AccountRequestRequest>' + | |
'<ns1:ProviderLogin>Repermissioning_Microsite</ns1:ProviderLogin>' + | |
'<ns1:ProviderPassword>PROVIDER_PASSWORD</ns1:ProviderPassword>' + | |
'<ns1:CustomerId>CUSTOMER_ID</ns1:CustomerId>' + | |
'</ns1:AccountRequestRequest>' + | |
'</SOAP-ENV:Body>' + | |
'</SOAP-ENV:Envelope>'; | |
axios | |
.post('https://testing.cs.quantmarketing.com/Ikbe-onlinesoapapi/Service.asmx', sr, { | |
headers: { | |
'Content-Type': 'text/xml', | |
SOAPAction: | |
'http://schemas.facilinformatica.com.br/Facil.Credito.WsCred/IEmprestimo/CalcularPrevisaoDeParcelas' | |
} | |
}) | |
.then(response => res.send(response.data)) | |
.catch(err => console.log(err)); | |
}; | |
export default { | |
fetch | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment