I made a simple WCF web-service inside an ASP.net website.
The web-service is hosted by IIS and works fine on localhost, ie when accessing for exemple to http://localhost/myservice.svc/HelloWorld I get the correct "Hello World" response as expected.
But accessing to it by my computer hostname ( http://mycomputer/myservice.svc/HelloWorld ) gets me an error 404 response. This is particularly confusing as the remaining of the site (mainly aspx pages) is accessible without any problem from both ways.
I suspect a configuration issue in IIS, but I have no real clue. Any help would be really appreciated.
My service endpoint is the following:
<endpoint address="" binding="webHttpBinding" contract="MyService.Service" />
The error stacktrace from the server is the following:
[EndpointNotFoundException]: There was no channel actively listening at 'http://mycomputer.ad-ent.lan.net/myservice.svc/HelloWorld'. This is often caused by an incorrect address URI. Ensure that the address to which the message is sent matches an address on which a service is listening.
à System.ServiceModel.Activation.HostedHttpTransportManager.HttpContextReceived(HostedHttpRequestAsyncResult result)
à System.ServiceModel.Activation.HostedHttpRequestAsyncResult.HandleRequest()
à System.ServiceModel.Activation.HostedHttpRequestAsyncResult.BeginRequest()
[HttpException]: There was no channel actively listening at 'http://mycomputer.ad-ent.lan.net/myservice.svc/HelloWorld'. This is often caused by an incorrect address URI. Ensure that the address to which the message is sent matches an address on which a service is listening.
à System.ServiceModel.AsyncResult.End[TAsyncResult](IAsyncResult result)
à System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result)
à System.ServiceModel.Activation.HostedHttpRequestAsyncResult.ExecuteSynchronous(HttpApplication context, Boolean flowContext)
à System.ServiceModel.Activation.HttpHandler.ProcessRequest(HttpContext context)
à System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
à System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)