メッセージに有効期限が切れた無効なセキュリティ コンテキスト トークンが含まれているか、バインディング間に不一致があるため
問題は、クライアントとサーバーの時間が数秒ずれていることです。クライアント/サーバーがオフになっている数秒の間に呼び出しが行われない限り、Web サービスはすべて正常に動作します。したがって、呼び出しが行われ、クライアントの時刻が 6:00:58 で、サーバーの時刻が 6:01:01 である場合、上記のエラーが発生します。
例外をキャッチするコードを追加し、呼び出しを再試行しましたが、このメッセージが引き続き表示されます。
クライアント/サーバーで時間を同期しましたが、最終的には数秒で同期が取れなくなります。
誰にもアイデアはありますか?
重要な Web 構成の一部を次に示します (クライアント/サーバー間のすべては同じです)。
<service behaviorConfiguration="WebServiceBehavior" name="WebService.TestService">
<endpoint
address=""
binding="wsHttpBinding"
bindingConfiguration="WSHttpBinding_Service"
contract="WebService.ITestService">
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="./WebService/TestService/" />
</baseAddresses>
</host>
</service>
</services>
<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding_Service" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="1000000" maxReceivedMessageSize="1000000" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="false" allowCookies="false">
<readerQuotas maxDepth="900000" maxStringContentLength="900000" maxArrayLength="900000" maxBytesPerRead="900000" maxNameTableCharCount="900000" />
<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>
<behaviors>
<serviceBehaviors>
<behavior name="WebServiceBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
<system.web>
<customErrors mode="On" />
<identity impersonate="false" />
<authentication mode="Forms" />
</system.web>