Click to See Complete Forum and Search --> : Bug with xmlhttp and xmldoc??


KingdomHeart
06-11-2007, 02:14 PM
I recently write code to get IP address of my network devices in Call Manager. ANd I got problems with xmlhttp and xmldoc.
what is wrong with these 2 lines below?

xmlhttp.Send();
xmlDoc.loadXML(xmlhttp.responseText);

here is 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\n");
xmlhttp.Open("GET", protocol + "URL of Call Manager DeviceListX", false);
xmlhttp.setRequestHeader("Authorization", "Basic " + authstring);
xmlhttp.setRequestHeader("Connection", "close");
*xmlhttp.Send();
*xmlDoc.loadXML(xmlhttp.responseText);
Application("deviceList") = xmlDoc;
}