在我的應用程序中幾乎所有的(安全的)WCF服務端點,如果客戶端的系統時鐘在未來或過去設置得太遠,我會從WCFs時鐘偏移機制(這裏描述:http://www.danrigsby.com/blog/index.php/2008/08/26/changing-the-default-clock-skew-in-wcf/)中得到一個例外。爲什麼我的WCF端點沒有引發最大時鐘偏移異常?
但是,實現Login()方法的一個端點即使啓用了傳輸安全性(自然不需要證書),也不會拋出此異常。
爲什麼「時鐘扭曲機制」不適用於該端點?也許這是因爲clientCredentialType設置爲「無」?
作爲一個例子,這是我配置的簡化版本:
<services>
<service name="Foo">
<endpoint address=""
binding="wsHttpBinding"
bindingConfiguration="binding1"
contract="IFoo" />
</service>
</services>
<bindings>
<wsHttpBinding>
<binding name="binding1" maxReceivedMessageSize="100000000">
<readerQuotas maxDepth="1000000000" maxArrayLength="1000000000" maxStringContentLength="1000000000" />
<security mode="Transport">
<transport clientCredentialType ="None"/>
</security>
<reliableSession enabled="false" />
</binding>
</wsHttpBinding>
</bindings>