Exemple #1
0
 public static void GetAppFileList(string url, ref List<string> fileList)
 {
     List<string> list = fileList;
     try
     {
         i2InfoWS.i2API = new Https();
         string xml = i2InfoWS.i2API.Get(url);
         XmlDocument xmlDocument = new XmlDocument();
         xmlDocument.LoadXml(xml);
         for (int i = 0; i < xmlDocument.GetElementsByTagName("dependentAssembly").Count; i++)
         {
             if (xmlDocument.GetElementsByTagName("dependentAssembly").Item(i).Attributes["codebase"] != null)
             {
                 list.Add(xmlDocument.GetElementsByTagName("dependentAssembly").Item(i).Attributes["codebase"].Value);
             }
         }
         for (int i = 0; i < xmlDocument.GetElementsByTagName("file").Count; i++)
         {
             if (xmlDocument.GetElementsByTagName("file").Item(i).Attributes["name"] != null)
             {
                 list.Add(xmlDocument.GetElementsByTagName("file").Item(i).Attributes["name"].Value);
             }
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 public KimengWSResult GetCustomerGrade(string userID, string session, string productName)
 {
     KimengWSResult kimengWSResult = default(KimengWSResult);
     KimengWSResult result;
     try
     {
         this.kimengAPI = new Https();
         string kE_Server = ApplicationInfo.KE_Server;
         string xml = this.kimengAPI.Get(string.Concat(new string[]
         {
             kE_Server,
             "/keapi/get_cust_grade.asp?Userid=",
             userID,
             "&Sid=",
             session,
             "&Product=",
             productName
         }));
         XmlDocument xmlDocument = new XmlDocument();
         xmlDocument.LoadXml(xml);
         kimengWSResult.Code = xmlDocument.GetElementsByTagName("res_code").Item(0).InnerText.ToString();
         if (kimengWSResult.Code == "0")
         {
             kimengWSResult.AccountNO = xmlDocument.GetElementsByTagName("Inv_no").Item(0).InnerText;
             kimengWSResult.CustomerGrade = xmlDocument.GetElementsByTagName("user_grade").Item(0).InnerText;
             kimengWSResult.Description = "Successed";
         }
         else
         {
             kimengWSResult.Description = xmlDocument.GetElementsByTagName("res_msg").Item(0).InnerText;
         }
         result = kimengWSResult;
     }
     catch (Exception ex)
     {
         throw ex;
     }
     return result;
 }
 internal void Start()
 {
     try
     {
         if (this.https != null)
         {
             this.https = null;
         }
         this.https = new Https();
         this.https.OnError -= new Https.OnErrorHandler(this.https_OnError);
         this.https.OnError += new Https.OnErrorHandler(this.https_OnError);
         this.https.OnTransfer -= new Https.OnTransferHandler(this.https_OnTransfer);
         this.https.OnTransfer += new Https.OnTransferHandler(this.https_OnTransfer);
         this.https.OnSSLServerAuthentication -= new Https.OnSSLServerAuthenticationHandler(this.https_OnSSLServerAuthentication);
         this.https.OnSSLServerAuthentication += new Https.OnSSLServerAuthenticationHandler(this.https_OnSSLServerAuthentication);
         this.https.OnEndTransfer -= new Https.OnEndTransferHandler(this.https_OnEndTransfer);
         this.https.OnEndTransfer += new Https.OnEndTransferHandler(this.https_OnEndTransfer);
         this.https.OnStartTransfer -= new Https.OnStartTransferHandler(this.https_OnStartTransfer);
         this.https.OnStartTransfer += new Https.OnStartTransferHandler(this.https_OnStartTransfer);
         this.canConnectServer = false;
         this.isRecv = false;
         if (this._dataInQueue != null)
         {
             lock (((ICollection)this._dataInQueue).SyncRoot)
             {
                 this._dataInQueue.Clear();
             }
         }
         else
         {
             this._dataInQueue = new Queue<string>();
         }
         this.isAreadySendOnStarted = false;
         this.isServiceStarted = true;
         Thread thread = new Thread(new ThreadStart(this.SplitMessage));
         thread.Start();
         this._lastSeqRecv = -1;
         if (this.timerForRefresh == null)
         {
             this.timerForRefresh = new System.Timers.Timer();
             this.timerForRefresh.Elapsed += new ElapsedEventHandler(this.timerForRefresh_Elapsed);
         }
         this.timerForRefresh.Stop();
         this.timerForRefresh.Interval = (double)ApplicationInfo.PullInterval;
         this.timerForRefresh.Start();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemple #4
0
 public static string GetAppManifestURL(string url)
 {
     string result;
     try
     {
         i2InfoWS.i2API = new Https();
         string uRL = url + "/i2TradePlus.Start.application";
         string xml = i2InfoWS.i2API.Get(uRL);
         XmlDocument xmlDocument = new XmlDocument();
         xmlDocument.LoadXml(xml);
         string value = xmlDocument.GetElementsByTagName("dependentAssembly").Item(0).Attributes["codebase"].Value;
         result = value;
     }
     catch (Exception ex)
     {
         throw ex;
     }
     return result;
 }
Exemple #5
0
 public static string GetServerVersion(string url)
 {
     string result;
     try
     {
         i2InfoWS.i2API = new Https();
         string uRL = url + "/i2TradePlus.Start.application";
         string xml = i2InfoWS.i2API.Get(uRL);
         XmlDocument xmlDocument = new XmlDocument();
         xmlDocument.LoadXml(xml);
         string value = xmlDocument.GetElementsByTagName("assemblyIdentity").Item(0).Attributes["version"].Value;
         result = value;
     }
     catch (Exception ex)
     {
         throw ex;
     }
     return result;
 }
Exemple #6
0
 public static i2WSResult GetServerGrade(string host, string device)
 {
     i2WSResult i2WSResult = default(i2WSResult);
     i2WSResult result;
     try
     {
         i2InfoWS.i2API = new Https();
         string uRL = host + "?device=" + device + "?get_keserver=Y";
         string xml = i2InfoWS.i2API.Get(uRL);
         XmlDocument xmlDocument = new XmlDocument();
         xmlDocument.LoadXml(xml);
         i2WSResult.Code = xmlDocument.GetElementsByTagName("code").Item(0).Attributes["value"].Value;
         if (i2WSResult.Code == "0")
         {
             i2WSResult.Version = xmlDocument.GetElementsByTagName("version").Item(0).Attributes["value"].Value;
             i2WSResult.Installerurl = xmlDocument.GetElementsByTagName("installerurl").Item(0).Attributes["value"].Value;
             i2WSResult.UpdateURL = xmlDocument.GetElementsByTagName("updateurl").Item(0).Attributes["value"].Value;
             i2WSResult.WsURL = xmlDocument.GetElementsByTagName("servername").Item(0).Attributes["value"].Value;
             if (xmlDocument.SelectSingleNode("//servernameorder") != null)
             {
                 i2WSResult.WsOrderURL = xmlDocument.GetElementsByTagName("servernameorder").Item(0).Attributes["value"].Value;
             }
             if (xmlDocument.SelectSingleNode("//servernameuser") != null)
             {
                 i2WSResult.WsUserURL = xmlDocument.GetElementsByTagName("servernameuser").Item(0).Attributes["value"].Value;
             }
             if (xmlDocument.SelectSingleNode("//servernamealert") != null)
             {
                 i2WSResult.WsAlertURL = xmlDocument.GetElementsByTagName("servernamealert").Item(0).Attributes["value"].Value;
             }
             if (xmlDocument.SelectSingleNode("//cefurl") != null)
             {
                 i2WSResult.CefUrl = xmlDocument.GetElementsByTagName("cefurl").Item(0).Attributes["value"].Value;
             }
             i2WSResult.WsDURL = xmlDocument.GetElementsByTagName("servernamed").Item(0).Attributes["value"].Value;
             i2WSResult.SessionID = xmlDocument.GetElementsByTagName("session").Item(0).Attributes["value"].Value;
             i2WSResult.Description = "Successed";
         }
         result = i2WSResult;
     }
     catch (Exception ex)
     {
         throw ex;
     }
     return result;
 }
Exemple #7
0
 public static i2WSResult GetConnectionInfoWithGrade(string host, string device, string custGrade)
 {
     i2WSResult i2WSResult = default(i2WSResult);
     i2WSResult result;
     try
     {
         i2InfoWS.i2API = new Https();
         string uRL = string.Concat(new string[]
         {
             host,
             "?device=",
             device,
             "&cust_grade=",
             custGrade
         });
         string xml = i2InfoWS.i2API.Get(uRL);
         XmlDocument xmlDocument = new XmlDocument();
         xmlDocument.LoadXml(xml);
         i2WSResult.Code = xmlDocument.GetElementsByTagName("code").Item(0).Attributes["value"].Value;
         if (i2WSResult.Code == "0")
         {
             i2WSResult.Version = xmlDocument.GetElementsByTagName("version").Item(0).Attributes["value"].Value;
             if (xmlDocument.SelectSingleNode("//servername") != null)
             {
                 i2WSResult.WsURL = xmlDocument.GetElementsByTagName("servername").Item(0).Attributes["value"].Value;
             }
             if (xmlDocument.SelectSingleNode("//servernameorder") != null)
             {
                 i2WSResult.WsOrderURL = xmlDocument.GetElementsByTagName("servernameorder").Item(0).Attributes["value"].Value;
             }
             if (xmlDocument.SelectSingleNode("//servernameuser") != null)
             {
                 i2WSResult.WsUserURL = xmlDocument.GetElementsByTagName("servernameuser").Item(0).Attributes["value"].Value;
             }
             if (xmlDocument.SelectSingleNode("//servernamealert") != null)
             {
                 i2WSResult.WsAlertURL = xmlDocument.GetElementsByTagName("servernamealert").Item(0).Attributes["value"].Value;
             }
             if (xmlDocument.SelectSingleNode("//cefurl") != null)
             {
                 i2WSResult.CefUrl = xmlDocument.GetElementsByTagName("cefurl").Item(0).Attributes["value"].Value;
             }
             if (xmlDocument.SelectSingleNode("//servergrade") != null)
             {
                 ApplicationInfo.KE_Server = xmlDocument.GetElementsByTagName("servergrade").Item(0).Attributes["value"].Value;
             }
             if (xmlDocument.SelectSingleNode("//servernamed") != null)
             {
                 i2WSResult.WsDURL = xmlDocument.GetElementsByTagName("servernamed").Item(0).Attributes["value"].Value;
             }
             i2WSResult.SessionID = xmlDocument.GetElementsByTagName("session").Item(0).Attributes["value"].Value;
             i2WSResult.Description = "Successed";
         }
         result = i2WSResult;
     }
     catch (Exception ex)
     {
         throw ex;
     }
     return result;
 }