void CallWebSvcRetrieveAsyc(string wsdl, bool onStartup) { //validation of url format etx is done on user input, the file exists check is performed here as it is to slow to perform on user input. if (!CheckFileExists(wsdl)) { uc_log1.LogErrorMessage(wsdl + " file location does not exist"); return; } if (_addedWsdls.Contains(wsdl)) { //if the user tries to add the wsdl again while the preivious add is in process this exception is thrown uc_log1.LogErrorMessage(wsdl + " is currently being added please wait for it to complete"); return; } uc_log1.LogInfoMessage("start adding wsdl - " + wsdl); _addedWsdls.Add(wsdl); Thread thread = new Thread(() => { Drexyia.WebSvc.Wsdl.Parser parser = new Drexyia.WebSvc.Wsdl.Parser(utils.Logger.Instance.Log); var call = new drexProcess.WebSvcAsync.Operations.RetrieveAsyncOp(wsdl, AppConfig.Instance.WebSvcRetrieveTimeout, parser, State.Instance.ConfigProxy, utils.Logger.Instance.Log); call.OnComplete += asyncCall_OnRerieveComplete; call.OnTimeout += asyncCall_OnRetrieveTimeout; call.OnException += asyncCall_OnRerieveException; call.OnWebException += asyncCall_OnRerieveWebException; if (onStartup) { call.OnException += asyncCall_OnRerieveExceptionStartup; } else { call.OnException += asyncCall_OnRerieveException; } call.Start(); }); //the windows forms control must be updated by a thread with single threaded appartment property thread.SetApartmentState(ApartmentState.STA); thread.Start(); }
void CallWebSvcRetrieveAsyc(string wsdl, bool onStartup) { //validation of url format etx is done on user input, the file exists check is performed here as it is to slow to perform on user input. if (!CheckFileExists(wsdl)) { uc_log1.LogErrorMessage(wsdl + " file location does not exist"); return; } if (_addedWsdls.Contains(wsdl)) { //if the user tries to add the wsdl again while the preivious add is in process this exception is thrown uc_log1.LogErrorMessage(wsdl + " is currently being added please wait for it to complete"); return; } uc_log1.LogInfoMessage("start adding wsdl - " + wsdl); _addedWsdls.Add(wsdl); Thread thread = new Thread(() => { Drexyia.WebSvc.Wsdl.Parser parser = new Drexyia.WebSvc.Wsdl.Parser(utils.Logger.Instance.Log); var call = new drexProcess.WebSvcAsync.Operations.RetrieveAsyncOp(wsdl, AppConfig.Instance.WebSvcRetrieveTimeout, parser, State.Instance.ConfigProxy, utils.Logger.Instance.Log); call.OnComplete += asyncCall_OnRerieveComplete; call.OnTimeout += asyncCall_OnRetrieveTimeout; call.OnException += asyncCall_OnRerieveException; call.OnWebException += asyncCall_OnRerieveWebException; if (onStartup) { call.OnException += asyncCall_OnRerieveExceptionStartup; } else { call.OnException += asyncCall_OnRerieveException; } call.Start(); }); //the windows forms control must be updated by a thread with single threaded appartment property thread.SetApartmentState(ApartmentState.STA); thread.Start(); }