Ejemplo n.º 1
0
        public void TestHttpAsmxWithBadHeader()
        {
            foreach (var s in _serviceManager.AllServers)
            {
                Console.WriteLine(s.Port);
                using (var ws = new BadHeaderTestService())
                //using (var wait = new ManualResetEvent(false))
                {
                    var proto = s.UseHttps ? "https" : "http";
                    ws.Url = proto + "://127.0.0.1:" + s.Port + "/TestService.asmx";

                    var result = ws.SimpleMethod();
                    Assert.IsTrue(result.Contains("Hello World"));

                    //ws.SimpleMethodCompleted += (sender, args) =>
                    //{
                    //    Assert.IsNull(args.Error);
                    //    Assert.IsFalse(args.Cancelled);
                    //    Assert.IsNotNull(args.Result);
                    //    Assert.IsTrue(args.Result.Contains("Hello World"));

                    //    var w = (ManualResetEvent)args.UserState;
                    //    w.Set();
                    //};

                    //ws.SimpleMethodAsync(wait);

                    //if (!wait.WaitOne(Debugger.IsAttached ? -1 : 5000))
                    //{
                    //    Assert.Fail("No response was received after 5 seconds.");
                    //}
                }
            }
        }
Ejemplo n.º 2
0
        public void TestSingleHttpAsmxWithBadHeader()
        {
            var s = _serviceManager.AllServers[0];

            using (var ws = new BadHeaderTestService())
            {
                var proto = s.UseHttps ? "https" : "http";
                ws.Url = proto + "://127.0.0.1:" + s.Port + "/TestService.asmx";
                //ws.UserAgent = "Java1.4.2_10";

                var result = ws.SimpleMethod();
                Assert.IsTrue(result.Contains("Hello World"));
            }
        }
Ejemplo n.º 3
0
        public void TestSingleHttpAsmxWithBadHeader()
        {
            var s = _serviceManager.AllServers[0];

            using (var ws = new BadHeaderTestService())
            {
                var proto = s.UseHttps ? "https" : "http";
                ws.Url = proto + "://127.0.0.1:" + s.Port + "/TestService.asmx";
                //ws.UserAgent = "Java1.4.2_10";

                var result = ws.SimpleMethod();
                Assert.IsTrue(result.Contains("Hello World"));
            }
        }
Ejemplo n.º 4
0
        public void TestHttpAsmxWithBadHeader()
        {
            foreach (var s in _serviceManager.AllServers)
            {
                Console.WriteLine(s.Port);
                using (var ws = new BadHeaderTestService())
                //using (var wait = new ManualResetEvent(false))
                {
                    var proto = s.UseHttps ? "https" : "http";
                    ws.Url = proto + "://127.0.0.1:" + s.Port + "/TestService.asmx";

                    var result = ws.SimpleMethod();
                    Assert.IsTrue(result.Contains("Hello World"));

                    //ws.SimpleMethodCompleted += (sender, args) =>
                    //{
                    //    Assert.IsNull(args.Error);
                    //    Assert.IsFalse(args.Cancelled);
                    //    Assert.IsNotNull(args.Result);
                    //    Assert.IsTrue(args.Result.Contains("Hello World"));

                    //    var w = (ManualResetEvent)args.UserState;
                    //    w.Set();
                    //};

                    //ws.SimpleMethodAsync(wait);

                    //if (!wait.WaitOne(Debugger.IsAttached ? -1 : 5000))
                    //{
                    //    Assert.Fail("No response was received after 5 seconds.");
                    //}
                }
            }
        }