Exemplo n.º 1
0
        public ActionResult InvokeTCP()
        {
            System.ServiceModel.ServiceHost host = new System.ServiceModel.ServiceHost(typeof(Assignment1_Section1.SayHello));
            host.Open();
            SayHelloProxy proxy = new SayHelloProxy();

            ViewBag.Message = proxy.DoWork("Hello World");
            host.Close();
            return(RedirectToAction("Home"));
        }
Exemplo n.º 2
0
        public ActionResult InvokeHTTP()
        {
            Uri httpURI = new Uri("http://localhost:55431/");

            System.ServiceModel.ServiceHost host = new System.ServiceModel.ServiceHost(typeof(Assignment1_Section1.SayHello), httpURI);
            host.Open();
            SayHelloProxy proxy = new SayHelloProxy();

            ViewBag.Message = proxy.DoWork("Hello World");
            host.Close();
            return(RedirectToAction("Home"));
        }