06-07-2007 12:50 PM - edited 03-13-2019 04:12 PM
Whenever, it get to the getDeviceList, it always said that these two line below are wrong.
xmlhttp.Send();
xmlDoc.loadXML(xmlhttp.responseText);
what wrong with them???
Here is the code of the function getDeviceList()
function getDeviceList(callManager, userID, password, protocol) {
var authstring = text2base64(userID + ":" + password);
var xmlhttp = new ActiveXObject("Msxml2.XMLHTTP.3.0");
var xmlDoc = new ActiveXObject("Msxml2.FreeThreadedDOMDocument.3.0");
xmlDoc.async = false;
Response.write("About to get Devices List");
xmlhttp.Open("GET", protocol + "://" + callManager + "/CCMAdmin/reports/DeviceListX.asp", false);
xmlhttp.setRequestHeader("Authorization", "Basic " + authstring);
xmlhttp.setRequestHeader("Connection", "close");
xmlhttp.Send();
xmlDoc.loadXML(xmlhttp.responseText);
Application("deviceList") = xmlDoc;
}
06-08-2007 03:49 AM
Have you tried a regular GET from your webbrowser to the URL you're calling? It could be as simple as using HTTP instead of HTTPs. And I'm pretty sure even JavaScript will give you a halfway usable error with the appropriate try/catch ;) Knowing the exact error will permit to further track down what might be going wrong.
06-11-2007 02:11 PM
but the devicelistx is an https, how can I get xmlhttp to perform an https request.I read just around every thread about this topic in this forum but somehow cant get it to work either. A lot of the tutorial link that u and aaronw.ca post are expired. So please help me. I really need to get this things to work
06-22-2007 08:28 AM
I too am extremely new at this I have been working on this for a couple of days and finally put it all together based on a couple of other posts here and elsewhere.
https is not a problem for xmlhttp. This works fine for me:
Set xmlhttp = CreateObject("MSXML2.serverXMLHttp")
dlurl = "https://ccmpub/CCMAdmin/reports/devicelistx.asp"
Set xmldoc = CreateObject("MSXML2.serverXMLHttp")
xmldoc.setOption 2, 13056 'Ignore certificate errors
xmldoc.Open "GET", dlurl, False, CCM_UID, CCM_PWD
The part that threw me for a few days was the certificate error. My CCM, like most everyone?s (right?), has a self-signed certificate. This causes xmlhttp to throw an error. You can get xmlhttp to ignore this error using the setOption method.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide