全部,WCF间歇性超时
我有一个WCF服务,间歇地超时,通常在约10或12个来自asp.net客户端的请求之后。该服务使用反射来查找其程序集(WAP dll)中具有自定义属性集的类。这个过程本身非常快,通常只需要几毫秒,当它工作时,效果很好。
在调用代码和服务本身中设置断点告诉我,WCF客户端代理类的调用和实际执行该方法的时间之间发生超时。
想法?
更新:结合等从web.config中:
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="Sdd.Services.ControlPanelBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="Sdd.Services.ControlPanelBehavior"
name="Sdd.Services.ControlPanel">
<endpoint address="" binding="wsHttpBinding" contract="Sdd.Services.IControlPanel">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
</system.serviceModel>
更新:下面是从客户端的web.config中的相关部分:
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding_IControlPanel" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text"
textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="Message">
<transport clientCredentialType="Windows" proxyCredentialType="None"
realm="" />
<message clientCredentialType="Windows" negotiateServiceCredential="true"
algorithmSuite="Default" establishSecurityContext="true" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:81/services/ControlPanel.svc"
binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IControlPanel"
contract="PublicSite.IControlPanel" name="WSHttpBinding_IControlPanel">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
</client>
</system.serviceModel>
你有更多的信息吗?您使用的是什么类型的配置(绑定,客户端和服务器位于何处,设置的不同超时值是多少)。当你增加超时会发生什么? – olle 2009-09-08 23:24:52
客户端和服务器都在我的开发箱上,在UltiDev Cassini下运行。当它工作时,响应时间低于50ms。这是一致的,直到它突然*不*工作,当它在几分钟后超时。 我不确定绑定是什么 - 我采取了天真的方法右键单击,添加... VS2008中的WCF服务。如果您能指出我在哪里可以找到这些信息,我很乐意回报。谢谢! – 2009-09-09 00:01:09
我知道它正在攻击症状,但请检查一下您的绑定超时设置。有关解释,请参见http://msdn.microsoft.com/en-us/library/ms731291.aspx。 – 2009-09-09 00:01:50