【发布时间】:2009-10-28 19:18:00
【问题描述】:
我需要帮助,我最近刚从 SOAP Webservices 过渡到 WCF 世界。
当我从 VS2008 ASP.NET 开发服务器(即调试模式)运行时,WCF 服务运行良好。当我尝试通过 IIS 访问服务时,问题就出现了。
我在我的本地 IIS Web 服务器上设置了一个网站,该服务器托管在端口 8082 (http://localhost:8082) 上,并创建了一个指向包含我的 WCF 服务代码的物理目录的 VirtualDirectory (1.0)。该网站设置为执行 ASP.NET 2.0.50727。我可以访问登录页面以及各种 .aspx 页面,但是当我尝试访问 Service.svc 时,浏览器永远不会到达那里,只是处于空闲状态。
http://localhost:8082/1.0/Service.svc
我的问题是我缺少什么设置才能让服务在 IIS 内部工作,因为我已经知道它在开发服务器下工作。
如果有帮助,我将附上我的 web.config 的一部分。
<system.serviceModel>
<services>
<service name="Service1" behaviorConfiguration="Service1Behavior">
<!-- Service Endpoints -->
<endpoint address="" binding="wsHttpBinding" contract="IService1">
<!--
Upon deployment, the following identity element should be removed or replaced to reflect the
identity under which the deployed service runs. If removed, WCF will infer an appropriate identity
automatically.
-->
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="Service1Behavior">
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="true"/>
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
【问题讨论】:
标签: iis deployment wcf