string baseAddress = "http://" + Environment.MachineName + ":8000/Service";
ServiceHost host = new ServiceHost(typeof(SampleImplementation), new Uri(baseAddress));
ServiceEndpoint endpoint = host.AddServiceEndpoint(typeof(ISampleInterface), new WebHttpBinding(), "");
endpoint.Behaviors.Add(new WebHttpBehavior());
host.Open();
Console.WriteLine("Host opened");
ChannelFactory
factory.Endpoint.Behaviors.Add(new WebHttpBehavior());
ISampleInterface proxy = factory.CreateChannel();
SampleDataContract sample = new SampleDataContract();
sample = proxy.GetSampleDataContract(TextBox1.Text);
Response.Write(sample.BranchName );
((IClientChannel)proxy).Close();
factory.Close();
host.Close();