Exemple #1
0
        public void DoWork()
        {
            try
            {
                // Next line is a placeholder for your "job" - a DTS package or other long-running task
                // Replace the following line with your code.
                WSTranslation ws = HyperCatalog.WebServices.WSInterface.Translation;
                System.Net.CookieContainer cookies = new System.Net.CookieContainer();
                ws.CookieContainer = cookies;
                string      credential = ws.SignOn(SessionState.User.Pseudo, SessionState.User.ClearPassword);
                System.Guid logId      = new Guid();
                string      zipFileName;
                ws.ProcessZipRequest(credential, logId, zipFileName);
                ws.SignOff(credential);
                // Set Success property.
                _lastTaskSuccess = true;
            }

            catch (Exception e)

            {
                // Task Failed.
                _lastTaskSuccess  = false;
                _exceptionOccured = e;
            }

            finally
            {
                _running        = false;
                _lastFinishTime = DateTime.Now;
                if (!_firstRunComplete)
                {
                    _firstRunComplete = true;
                }
            }
        }