protected void Page_Load(object sender, EventArgs e) { Thread.Sleep(1500); ClientSection cs = HttpContext.Current.GetSection("system.serviceModel/client") as ClientSection; if (cs.Endpoints.Count > 0) endpointAddress.InnerText = cs.Endpoints[0].Address.AbsoluteUri; ISimpleService client = new SimpleServiceClient(); client.PrintMessage("Calling from Web Client."); }
protected void Page_Load(object sender, EventArgs e) { // Give time to ServiceHost to initialize. Thread.Sleep(1500); // Read configuation section and print wcf service host url to page. var wcfClientSection = HttpContext.Current.GetSection("system.serviceModel/client") as ClientSection; if (wcfClientSection.Endpoints.Count > 0) endpointAddress.InnerText = wcfClientSection.Endpoints[0].Address.AbsoluteUri; // Send message to wcf service host. ISimpleService client = new SimpleServiceClient(); client.PrintMessage("Calling from Web Client."); }
protected void Page_Load(object sender, EventArgs e) { // Give time to ServiceHost to initialize. Thread.Sleep(1500); // Read configuation section and print wcf service host url to page. var wcfClientSection = HttpContext.Current.GetSection("system.serviceModel/client") as ClientSection; if (wcfClientSection.Endpoints.Count > 0) { endpointAddress.InnerText = wcfClientSection.Endpoints[0].Address.AbsoluteUri; } // Send message to wcf service host. ISimpleService client = new SimpleServiceClient(); client.PrintMessage("Calling from Web Client."); }