0
私はsumtotalのLearning ManagementシステムSOAPベースのWebサービスを消費しようとしており、それを消費するために以下のコードを使用しています。しかし、私はjavascriptからのサービスの応答をキャプチャする方法を知ることができませんでしたので、私はこの分野ではあまり働いていません。助けてください。javascriptを使用してsumtotal認証Webサービスからセキュリティコンテキストトークンを取得
<script language="JavaScript" type="text/javascript">
function getData()
{
var xmlhttp = new XMLHttpRequest();
xmlhttp.open('GET', 'https://Testsoapservice.com/Services/authentication.asmx?op=Login', true);
// build SOAP request
var sr = '<?xml version="1.0" encoding="utf-8"?>' +
'<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" '+
'xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">'+
'<soapenv:Body>' +
' <Login xmlns="http://www.testsoapservice.com/Authentication/">'+
'<credentials>'+
'<Username>xxx</Username>'+
'<Passcode>xxxx</Passcode>'+
'</credentials>'+
'</Login>'+
'</soapenv:Body>' +
'</soapenv:Envelope>';
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4) {
if (xmlhttp.status == 200) {
// How to get the user token here as soap response. I would like to use the token to consume subsequent services
}
}
}
// Send the POST request
xmlhttp.setRequestHeader('Content-Type', 'text/xml');
xmlhttp.send(sr);
}
</script>