これを機能させる方法、または機能しない理由についての決定的な答えを本当に知る必要があるため、賞金を再び更新します。
双方向 (IsOneWay = false) の WCF クライアント サーバーを .Net 3/3.5 で動作させるのに非常に苦労しました。
クライアントがサービスに正常に登録された後、サービスの定期的な Announcement() が、登録されたクライアントにコールバックします。2 秒に調整されたサーバーの SendTimeout が経過するまで、クライアントまたはサーバーのいずれかがハングするようになりました。次に、サーバー側には次のようにタイムアウト例外があります。その場合にのみ、クライアント ユーザー コードは直ちにメソッド呼び出しを受け取り、値を返そうとします。それまでに、クライアントのソケットは中止され、WCF は失敗します。
クライアント上の何かが、ソケットがタイムアウトするまで処理からローカル WCF キューをぶら下げているようですが、ローカル メソッド呼び出しをキャンセルするのに十分早くはありません。しかし、以下の例外が信じられる場合、サーバーはhttp://schemas.microsoft.com/2005/12/ServiceModel/Addressing/Anonymousに操作を送信しようとしており(不適切です!)、タイムアウトしています。おそらく、その URI はリモート接続されたクライアントの "名前" に過ぎず、WCF はエラー メッセージの目的でそれを参照することを認識しており、URI の読み込みに失敗していることを意味しているように見えます。サーバーが最初に失敗したのか、クライアントが最初に失敗したのかわかりません。
WCF トレースを追加しようとしましたが、それ以上の情報が得られません。
同様のサンプル コードはこちらにありますが、多すぎて消化しきれませんでした。私はそのコードのバリエーションを試しました。
TimeoutException 'This request operation sent to http://schemas.microsoft.com/2005/12/ServiceModel/Addressing/Anonymous did not receive a reply within the configured timeout (00:00:00). The time allotted to this operation may have been a portion of a longer timeout. This may be because the service is still processing the operation or because the service was unable to send a reply message. Please consider increasing the operation timeout (by casting the channel/proxy to IContextChannel and setting the OperationTimeout property) and ensure that the service is able to connect to the client.'
Server stack trace:
at System.ServiceModel.Dispatcher.DuplexChannelBinder.SyncDuplexRequest.WaitForReply(TimeSpan timeout)
at System.ServiceModel.Dispatcher.DuplexChannelBinder.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)