1

アプリケーションサーバーでtcpバインディングを使用してWindowsサービスとしてホストされているWCFサービスがあります。接続を試みている別の Web サーバーでホストされている ASP.NET Web アプリケーションがあります。どちらのサーバーも Windows 2008 R2 マシンです。

ASP.NET Web アプリケーションのアプリケーション プールは、ApplicationPoolIdentity をユーザーとして使用するように設定されています。Windows マシンから WCF サービスに接続しようとすると、次のエラーが発生します。

Source Exception: System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.ServiceModel.CommunicationException: The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '00:00:09.9980000'. ---> System.IO.IOException: The read operation failed, see inner exception. ---> System.ServiceModel.CommunicationException: The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '00:00:09.9980000'. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
   at System.ServiceModel.Channels.SocketConnection.ReadCore(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout, Boolean closing)

ただし、アプリケーション プールのユーザーを Network Service に変更すると、エラーなしで接続されます。

私の質問は 2 つあります。ApplicationPoolIdentity の使用が機能しない理由を誰かが知っていますか?それは何らかの構成の問題ですか? また、アプリケーション プールをネットワーク サービス アカウントで実行することの欠点は何でしょうか? ApplicationPoolIdentity の権限が少なく、安全性が高く、ベスト プラクティスと見なされていることはわかっています。

4

1 に答える 1

0

これに対する答えは、ネットワーク、サーバー、およびサービスのさまざまな構成によって異なります。

過去に、ApplicationPoolIdentity がマシンの外部のリソースと「対話」する権利がないという同様の状況に遭遇しました。

もう 1 つの問題は、Web アプリケーションとサーバー間の接続をどのように処理するかということです。毎回同じ接続を再利用していますか、それともチャンネルを閉じたり再開したりしていますか? この msdn スレッドには、これに関する情報があります。

于 2012-12-20T22:16:13.013 に答える