WCF クライアントから「メッセージを処理できませんでした...」というエラーが表示されます。助けてください、それは私を殺しています。
forループを通過してx回の非同期呼び出しを開始するテスト勝利アプリがあります。各非同期呼び出しは、WCF プロキシの独自のインスタンスをインスタンス化し、そのプロキシを使用して WCF サービスを呼び出します。xが約 35 以下であれば問題ありません。x > 40 程度の場合、多くの呼び出しは問題なく完了しますが、少数の呼び出しは次のように返します。
System.ServiceModel.Security.MessageSecurityException:
An unsecured or incorrectly secured fault was received from the other party.
See the inner FaultException for the fault code and detail. --->
System.ServiceModel.FaultException: The message could not be processed.
This is most likely because the action 'http://tempuri.org/IMyService/MakeRequest'
is incorrect or because the message contains an invalid or expired
security context token or because there is a mismatch between bindings.
The security context token would be invalid if the service aborted
the channel due to inactivity. To prevent the service from aborting
idle sessions prematurely increase the Receive timeout on the
service endpoint's binding.
--- End of inner exception stack trace ---
Server stack trace:
at System.ServiceModel.Security.SecuritySessionClientSettings`1.SecurityRequestSessionChannel.ProcessReply(Message reply, TimeSpan timeout, SecurityProtocolCorrelationState correlationState)
at System.ServiceModel.Security.SecuritySessionClientSettings`1.SecurityRequestSessionChannel.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at ...
メッセージセキュリティを備えたクライアント側とサーバー側の証明書を使用しています。なぜそれが特定の回数だけ正常に動作し、その後吐くのかわかりません。また、反復の終わりに近づいた呼び出しでエラーがスローされるようです。また、このエラーは、クライアント側とサーバー側で同じように設定されているタイムアウトに達するずっと前に発生します。
<binding name="WSHttpBinding_IMyService"
closeTimeout="00:10:00" openTimeout="00:10:00"
receiveTimeout="00:10:00" sendTimeout="00:10:00"... />
さらに、サービスのスロットリングを使用しています。
<serviceThrottling
maxConcurrentCalls="100"
maxConcurrentSessions="100" />
何か案は?
ありがとう、マーク。