private void getdevbyuserid() { //string version = Properties.Settings.Default.CUCMVersion; string version = "7.1"; string strDevicePhone; string soap = "\n"; soap += "\n"; soap += "\n"; soap += "\n"; soap += "select d.name, eu.userid from extensionmobilitydynamic emd, device d, device p, enduser eu where emd.fkdevice=d.pkid and emd.fkdevice_currentloginprofile=p.pkid and emd.fkenduser=eu.pkid and userid like '" + UserID + "'\n"; soap += "\n"; soap += "\n"; soap += "\n"; Logging.Text += "---------|AXL Request|---------\n\n"; Logging.Text += soap + "\n\n"; #region AXL SOAP try { byte[] soapBytes = Encoding.UTF8.GetBytes(soap); ServicePointManager.ServerCertificateValidationCallback += delegate { return true; }; HttpWebRequest httpRQ = (HttpWebRequest)HttpWebRequest.Create(string.Format(@"https://xxx.xxx.xxx.xxx:8443/axl/")); httpRQ.ProtocolVersion = System.Net.HttpVersion.Version10; httpRQ.Credentials = new NetworkCredential("AXLAdmin", "password");//Callmanager gebruikersnaam / password httpRQ.Method = "POST"; httpRQ.ContentType = "text/xml; charset=utf-8"; httpRQ.Accept = "text/xml"; httpRQ.Headers.Add("SOAPAction: 'CUCM:DB ver=" + version + "'"); httpRQ.ContentLength = soapBytes.Length; //Send the xml soap to cucm Stream stm = httpRQ.GetRequestStream(); stm.Write(soapBytes, 0, soapBytes.Length); stm.Close(); //Build the xml response XDocument responcedoc = new XDocument(); HttpWebResponse responce = httpRQ.GetResponse() as HttpWebResponse; Stream responcedata = responce.GetResponseStream(); StreamReader responsereader = new StreamReader(responcedata); Logging.Text += "\n---------|AXL Response|---------\n\n"; XDocument respdoc = XDocument.Load(responsereader); Logging.Text += respdoc + "\n"; soap = null; //fill in the combo //DevicePhone.Items.Clear(); //foreach (XElement item in respdoc.Descendants("name")) foreach (XElement item in respdoc.Descendants("name")) { //cucmgrouplist.Items.Add((string)item); //DevicePhone.Items.Add((string)item); strDevicePhone = ((string)item); //txtDevMac.Text = strDN1; label3.Text = strDevicePhone; } } catch (Exception ex) { Logging.Text += "\n"; Logging.Text += "\n---------|AXL Error|---------\n\n"; Logging.Text += string.Format("\n" + DateTime.Now + ":: ERROR :: Message: {0}\n", ex.Message); } #endregion