getdeviceip??? cant get it to work

Unanswered Question
Jun 7th, 2007
User Badges:

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;

}

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
Loading.
stephan.steiner Fri, 06/08/2007 - 03:49
User Badges:
  • Silver, 250 points or more

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.

KingdomHeart Mon, 06/11/2007 - 14:11
User Badges:

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

wschochet Fri, 06/22/2007 - 08:28
User Badges:

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.


Actions

This Discussion