namespace helloserviceSelfHostingDemo
{
[ServiceContract]
interface IhelloService
{
[OperationContract]
string sayhello(string name);
}
public class HelloService : IhelloService
{
public string sayhello(string name)
{
return "hello " + name;
}
}
class Program
{
static void Main(string[] args)
{
ServiceHost host = new ServiceHost(typeof(HelloService));
BasicHttpBinding bind = new BasicHttpBinding();
host.AddServiceEndpoint(typeof(IhelloService), bind, "http://8080/myhelloservice");
host.Open();
Console.WriteLine("hello service is running");
Console.ReadKey();
}
}
}
this code runs well but when i am copies this address in the browser is not getting the service