我在ASP.net网站内做了一个简单的WCF网络服务。WCF休息Web服务工作本地主机,但不是在主机
的网络服务是由托管IIS和访问用于为例来 http://localhost/myservice.svc/HelloWorld我得到正确的“Hello World”的响应按预期在本地主机上正常工作,即。
但通过我的电脑主机名(http://mycomputer/myservice.svc/HelloWorld)访问它给我一个错误的404响应。这尤其令人困惑,因为网站的其余部分(主要是aspx页面)可以从两个方面访问而不会有任何问题。
我怀疑在IIS中的配置问题,但我没有真正的线索。任何帮助将非常感激。
我的服务端点如下:
<endpoint address="" binding="webHttpBinding" contract="MyService.Service" />
来自服务器的错误堆栈跟踪如下:
[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)
什么在你的web.config -和元素?我看不到MSDN中那些仅限于本地主机的人,但我不是这里的专家,我想这就是问题所在。 –
Rup
2011-03-29 13:23:56
您运行的是哪个版本的IIS? – 2011-03-29 13:25:33
右键单击iis admin中的svc文件并选择“浏览”会发生什么? – 2011-03-29 13:40:45