function callService() {
var _IE = (new RegExp('internet explorer', 'gi')).test(navigator.appName);
if(_IE) {
xmlReq = new ActiveXObject('Microsoft.XMLHTTP');
xmlObj = new ActiveXObject('MSXML2.FreeThreadedDOMDocument.3.0');
xslObj = new ActiveXObject('MSXML2.FreeThreadedDOMDocument.3.0');
} else {
xmlReq =new XMLHttpRequest();
xslObjProcessor = new XSLTProcessor();
}
var soapReq = '<?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/">' +
' <soap:Body>' +
' <getString xmlns="http://ramabahama.net/webservices">' +
' <name_in>Bubbly Boobbah</name_in>' +
' </getString>' +
' </soap:Body>' +
'</soap:Envelope>';
xmlReq.open('POST', 'http://127.0.0.1/(S(<%=Session.SessionID%>))/webservices/test1/test1.cs.asmx', false);
xmlReq.setRequestHeader('SOAPAction', 'http://ramabahama.net/webservices/getString');
xmlReq.setRequestHeader('Content-Type', 'text/xml');
xmlReq.send(soapReq);
if(xmlReq.status == '200') {
document.getElementById('ServiceDisplay').innerHTML = '';
var xmlResponseXML = xmlReq.responseXML;
var xmlResponseText = xmlReq.responseText;
xmlReq.open('GET', 'http://127.0.0.1/ARIS/products/test1.xslt', false);
xmlReq.send(null);
if(xmlReq.status == '200') {
var xmlHttp;
var xmlReq;
var xslObj;
var xslObjProcessor;
var xmlObj;
if(_IE) {
xmlHttp = new ActiveXObject('Microsoft.XMLHTTP');
xmlObj = new ActiveXObject('MSXML2.FreeThreadedDOMDocument.3.0');
xslObj = new ActiveXObject('MSXML2.FreeThreadedDOMDocument.3.0');
xmlObj.async = false;
xslObj.async = false;
var xslTemplateObj = new ActiveXObject('MSXML2.XSLTemplate.3.0');
xslObj.loadXML(xmlReq.responseText);
xslTemplateObj.stylesheet = xslObj;
xslObjProcessor = xslTemplateObj.createProcessor();
xslObjProcessor.input = xmlResponseXML;
xslObjProcessor.transform();
document.getElementById('ServiceDisplay').innerHTML = xslObjProcessor.output;
} else {
var objParser = new DOMParser();
xslObjProcessor = new XSLTProcessor();
xmlObj = xmlResponseXML;
xslObj = xmlReq.responseXML;
xslObjProcessor.importStylesheet(xslObj);
document.getElementById('ServiceDisplay').appendChild(xslObjProcessor.transformToFragment(xmlObj, document));
}
alert(xmlResponseText);
alert(xmlReq.responseText);
alert(document.getElementById('ServiceDisplay').innerHTML);
} else {
alert('Error: ' + xmlReq.status);
}
} else {
document.getElementById('ServiceDisplay').innerHTML = '<span style="color: red; font-weight: bold;">There wuz an error.</span>';
}
}