Exemple #1
0
        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();
        }
        public void TestHelloWorld()
        {
            var parser = new WebSvc.Wsdl.Parser();

            var retrieve = new process.WebSvcAsync.Operations.RetrieveAsyncOp(TestDataReader.Instance.WsdlUriSingle, RETRIEVE_TIMEOUT, parser, _proxy, _log);
            retrieve.OnComplete +=retrieve_OnComplete;

            var thread = new Thread(() => {
                retrieve.Start();
            });
            thread.Name = "TestHelloWorld Thread";
            thread.Start();
            thread.Join();

            Assert.AreEqual("CallSyncOpService", _testHelloWorldResult.WebSvcResult.ServiceName);

            var webMethod = _testHelloWorldResult.WebSvcResult.WebSvcMethods["HelloWorld"];
            Assert.AreEqual(webMethod.Name, "HelloWorld");
            Assert.AreEqual(TestDataReader.Instance.RequestResponseMessages["HelloWorldRequest"], webMethod.Request.BodyUnformatted);
        }
Exemple #3
0
        public void TestHelloWorld()
        {
            var parser = new WebSvc.Wsdl.Parser();

            var retrieve = new process.WebSvcAsync.Operations.RetrieveAsyncOp(TestDataReader.Instance.WsdlUriSingle, RETRIEVE_TIMEOUT, parser, _proxy, _log);

            retrieve.OnComplete += retrieve_OnComplete;

            var thread = new Thread(() => {
                retrieve.Start();
            });

            thread.Name = "TestHelloWorld Thread";
            thread.Start();
            thread.Join();

            Assert.AreEqual("CallSyncOpService", _testHelloWorldResult.WebSvcResult.ServiceName);

            var webMethod = _testHelloWorldResult.WebSvcResult.WebSvcMethods["HelloWorld"];

            Assert.AreEqual(webMethod.Name, "HelloWorld");
            Assert.AreEqual(TestDataReader.Instance.RequestResponseMessages["HelloWorldRequest"], webMethod.Request.BodyUnformatted);
        }
Exemple #4
0
        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();
        }