I'm trying to self-host some WCF RESTful services from my computer for consumption by machines on my local network. I have no experience with WCF and am largely a newb when it comes to this. I created a very basic, stripped down console app to see if I could get it working.
static void Main(string[] args)
{
Uri httpUrl = new Uri("http://localhost:8090/");
var host = new WebServiceHost(typeof(TestClass), httpUrl);
var binding = new WebHttpBinding(); // NetTcpBinding();
host.AddServiceEndpoint(typeof(ITestClass), binding, "testing");
ServiceDebugBehavior stp = host.Description.Behaviors.Find<ServiceDebugBehavior>();
stp.HttpHelpPageEnabled = false;
host.Open();
Console.WriteLine("Commence with the testing!");
Console.ReadLine();
host.Close();
}
Here's the service code:
[ServiceContract]
public interface ITestClass
{
[WebGet]
[OperationContract]
string TestMethod();
}
public class TestClass : ITestClass
{
public string TestMethod()
{
return "SUCCESS";
}
}
From a browser on my localmachine, I'm able to issue a simple get request and get
<string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">SUCCESS</string>
However, I don't seem to be able to ping this service from any browsers on my home network when I type in http://<service machine's IP>:8090/testing/testmethod
.
Can anyone tell me what configuration I'm missing to enable the service to be visible to other machines on my local network without needing a DNS server?