cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
315
Views
0
Helpful
3
Replies

getdeviceip??? cant get it to work

KingdomHeart
Level 1
Level 1

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;

}

3 Replies 3

stephan.steiner
Spotlight
Spotlight

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.

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

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.