Example #1
0
        //total elapsed time will be different to the time between the start log message and end log message
        //this is because the time elapsed does not include the processing time for displaying the data in the UI.
        public void asyncCall_OnRerieveComplete(object sender, drexProcess.WebSvcAsync.EventParams.AsyncArgsCompleteRetrieve e)
        {
            lock (_retrievelocker) {

                if (exceptionOccurred)
                    return;

                //after the first node has been added include a sleep to make the building of the tree smoother
                if (State.Instance.ContainerWebSvc.Count() > 1) {
                    Thread.Sleep(250);
                }

                Invoke((MethodInvoker)(() => {

                    State.Instance.ContainerWebSvc.Populate(e.Result);

                    uc_treeView1.AddClickedComplete(e.Result);

                    string message = "finish adding wsdl - " + e.Name + ", time elapsed " + e.TotalTime + "ms";

                    uc_log1.LogInfoMessage(message);

                }));
            }
        }
Example #2
0
        public void AddClickedComplete(process.WebSvcAsync.Result.RetrieveAsyncResult item)
        {
            this.Invoke(new MethodInvoker(delegate() {
                tv_webServices.BeginUpdate();

                var wsNode = new TreeNode(item.WebSvcResult.SourceURI);
                wsNode.ImageKey = "wsdl.png";
                wsNode.SelectedImageKey = "wsdl.png";
                wsNode.Name = item.WebSvcResult.SourceURI;
                wsNode.Tag = WSNodeType.WebServiceNode;
                wsNode.ContextMenuStrip = cms_AddRemoveStartup;

                foreach (var webMethod in item.WebSvcResult.WebSvcMethods) {
                    TreeNode wmNode = new TreeNode(webMethod.Name);
                    wmNode.ImageKey = "bullet_purple.png";
                    wmNode.SelectedImageKey = "bullet_green.png";
                    wmNode.Name = webMethod.Name;
                    wmNode.Tag = WSNodeType.WebMethodNode;
                    wsNode.Nodes.Add(wmNode);
                }

                var root = tv_webServices.Nodes[0];
                root.Nodes.Add(wsNode);

                tv_webServices.ExpandAll();

                tv_webServices.EndUpdate();

            }));
        }
Example #3
0
        //the time between the start log message and end log message may be different to the time elapsed
        //this is because the time elapsed is the time for the web service call to complete and does not include the pocessing displaying of the web service call.
        void call_OnComplete(object sender, drexProcess.WebSvcAsync.EventParams.AsyncArgsCompleteCall e)
        {
            Invoke((MethodInvoker)(() => {

                uc_wm_response1.PopulateForm(e.Result);

            }));

            string message = "request end, time elapsed " + e.TotalTime + "ms";

            SetReady(message);
        }
Example #4
0
        public void Populate(drexProcess.WebSvcAsync.Result.RetrieveAsyncResult item)
        {
            UserControls.uc_SourceBrowser ucWebService = new UserControls.uc_SourceBrowser();
            ucWebService.PopulateForm(item.WebSvcResult.WSDL);

            Dictionary<string, UserControls.uc_Wm> ucWebMethods = new Dictionary<string, UserControls.uc_Wm>();
            foreach (var v in item.WebSvcResult.WebSvcMethods) {
                UserControls.uc_Wm ucWebMethod = new UserControls.uc_Wm();
                ucWebMethod.PopulateForm(item.WebSvcResult.SourceURI, v);
                ucWebMethods[v.Name] = ucWebMethod;
            }

            ContainerItemWebSvc wsItem = new ContainerItemWebSvc(item.WebSvcResult.SourceURI, ucWebService, ucWebMethods);

            _webServiceItems.Add(wsItem);
        }
Example #5
0
        void call_OnException(object sender, drexProcess.WebSvcAsync.EventParams.ExceptionAsyncArgs e)
        {
            Invoke((MethodInvoker)(() => {

                uc_log1.LogErrorMessage(e.Message);

            }));

            SetReady("request end");
        }
 public AsyncArgsCompleteRetrieve(string name, DateTime startTime, DateTime endTime, process.WebSvcAsync.Result.RetrieveAsyncResult result)
     : base(name, startTime, endTime)
 {
     Result = result;
 }
Example #7
0
        void asyncCall_OnRetrieveTimeout(object sender, drexProcess.WebSvcAsync.EventParams.TimeoutAsyncArgs e)
        {
            //the program could keep a list of thread calls and on exception cleanly cancel all of the calls, this would cancel the timeouts
            //as in the event of an exception the only action that can be performed is to close the application we will simply not display the timeout message
            if (exceptionOccurred)
                return;

            _addedWsdls.Remove(e.Name);

            Invoke((MethodInvoker)(() => {

                uc_log1.LogErrorMessage("timeout adding wsdl - " + e.Name);
                uc_log1.LogInfoMessage("finish adding wsdl - " + e.Name);

            }));
        }
Example #8
0
        void asyncCall_OnRerieveWebException(object sender, drexProcess.WebSvcAsync.EventParams.ExceptionAsyncArgs e)
        {
            utils.Logger.Instance.Log.Info("Start " + e.Name);

            _addedWsdls.Remove(e.Name);

            Invoke((MethodInvoker)(() => {

                uc_log1.LogErrorMessage("error adding wsdl - " + e.Message + " - " + e.Name);
                uc_log1.LogInfoMessage("finish adding wsdl - " + e.Name);

            }));
        }
Example #9
0
        public void asyncCall_OnRerieveExceptionStartup(object sender, drexProcess.WebSvcAsync.EventParams.ExceptionAsyncArgs e)
        {
            exceptionOccurred = true;

            //if a wsdl being loaded from the startup file results in an exception the program closes. This means that we will not be able to start the program to remove the faulty wsdl.
            //as a workaround set the starup wsdls file to disabled and save.
            try {

                State.Instance.ConfigStartupWsdls.Enabled = false;
                State.Instance.Save();
            }
            catch (Exception) {
            }

            if (OnException != null) {
                OnException(sender, e);
            }
        }
Example #10
0
        public void asyncCall_OnRerieveException(object sender, drexProcess.WebSvcAsync.EventParams.ExceptionAsyncArgs e)
        {
            utils.Logger.Instance.Log.Info("Start " + e.Name);

            exceptionOccurred = true;

            if (OnException != null) {
                OnException(sender, e);
            }
        }
Example #11
0
 public void PopulateForm(drexProcess.WebSvcAsync.Result.CallAsyncResult result)
 {
     uc_responseMessage.PopulateForm(result.Response.Body);
     pg_responseHeaders.SelectedObject = new ResponsePropertyGrid(result.Response.Status, result.Response.Headers);
 }
Example #12
0
 static void mainForm_OnException(object sender, drexProcess.WebSvcAsync.EventParams.ExceptionAsyncArgs e)
 {
     System.Console.WriteLine(e.Ex.ToString());
 }