【发布时间】:2014-01-06 20:09:14
【问题描述】:
我有一个 wcf 应用程序。它有“Service1.svc”文件。在我指定的 web.config 文件中
http://localhost:2005/EmployeeService.svc
作为端点。从 Visual Studio 单击浏览时没有问题。但是,当我将它托管在 IIS 服务器上时,我得到一个空白页。有趣的是,如果我从网上删除地址。 config 这次可以看到这个地址的服务了。
http://localhost:2005/EmployeeService.svc
web.config 文件如下:
<?xml version="1.0"?>
<configuration>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="EmployeeServiceBehaviour">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="EmployeeServiceBehaviour" name="EmployeeConfiguration">
<endpoint address="http://localhost:2005/EmployeeService.svc" binding="basicHttpBinding"
bindingConfiguration="" contract="IEmployeeConfiguration" />
</service>
</services>
</system.serviceModel>
<system.web>
<compilation debug="true"/>
</system.web>
<system.webServer>
<directoryBrowse enabled="true"/>
</system.webServer>
</configuration>
您能否解释一下,为什么我在提供地址时在 IIS 上得到一个空白页面。
【问题讨论】:
-
您需要显示 web.config serviceModel 元素内容以获得有意义的答案。不确定将 URL 设置为“绑定”是什么意思。
-
我认为他的意思是“端点”
-
抱歉,编辑了问题
-
@PatrickHofman,是的,如果我删除我可以浏览的地址,但为什么呢?我不应该提供地址吗?