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")); }
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")); }