Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

getdeviceip??? cant get it to work

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

Re: getdeviceip??? cant get it to work

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.

New Member

Re: getdeviceip??? cant get it to work

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

New Member

Re: getdeviceip??? cant get it 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.

99
Views
0
Helpful
3
Replies