【发布时间】:2011-02-22 21:26:25
【问题描述】:
我明白了:
接收到http://localhost:8732/Design_Time_Addresses/PersistencyService/Service1/ 的 HTTP 响应时出错。这可能是由于服务端点绑定未使用 HTTP 协议。这也可能是由于服务器中止了 HTTP 请求上下文(可能是由于服务关闭)。有关详细信息,请参阅服务器日志。
为什么我会得到这个?我认为这是因为该方法大约需要 1 分钟才能完成。如何禁用任何时间限制?
在 VS 中运行在同一解决方案中使用 WCF 服务的 Windows 窗体项目时,我得到了这个
我的 WCF 配置: 编辑:
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="LongRunning" sendTimeout="00:10:00" />
</wsHttpBinding>
</bindings>
<client>
<endpoint name="Default"
address="http://localhost:8732/Design_Time_Addresses/PersistencyService/Service1/"
binding="wsHttpBinding"
bindingConfiguration="LongRunning"
contract="PersistencyService.IService1" />
</client>
<services>
<service name="PersistencyService.Service1">
<endpoint
address=""
binding="wsHttpBinding" bindingConfiguration=""
contract="PersistencyService.IService1" >
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:8732/Design_Time_Addresses/PersistencyService/Service1/" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="True"/>
<serviceDebug includeExceptionDetailInFaults="False"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
异常消息是远程主机强制关闭了现有连接。 我还必须补充一点,我从服务中获得了大约 70MB 的数据
【问题讨论】:
-
嗨,Ryan,只要你调用“超时”时间限制,你在谷歌上搜索这个就不会有太多运气了 ;-) :D