1

リモーティングサービス(ISSに.NETタイプをホストしています)を開発しました。 IISは「統合Windows認証」を使用するように構成されています。リモートサーバーからエラーが返されました。(401).NET Remotingの権限がありません

"localhost" のサービスをユニットテストすると完全に動作しますが(以下のコードはテスト用のコードです)、サービスをテストサーバーに展開した後(別の別のドメイン)、 "System.Net.WebExceptionをスローし始めました:リモートサーバーがエラーを返しました:(401)Unauthorized"例外。

string url = string.Concat(@"http://", serverName, "/", ServiceName); 

IDictionary props = new Hashtable(); 
props["useDefaultCredentials"] = true; 
props["useAuthenticatedConnectionSharing"] = true; 

BinaryServerFormatterSinkProvider srv = new BinaryServerFormatterSinkProvider(); 
BinaryClientFormatterSinkProvider clnt = new BinaryClientFormatterSinkProvider(); 
this.channel = new HttpChannel(props, clnt, srv); 

ChannelServices.RegisterChannel(this.channel, false); 

IMyService service = Activator.GetObject(typeof(IMyService), url) as IMyService; 

service.GetData();// this error returns "System.Net.WebException: The remote server returned an error: (401) Unauthorized." exception. 

何が問題なのですか?それはドメインに関連していますか?デフォルトのウェブプロキシの設定と関係があるかもしれませんか?

答えて

0

どのような認証情報を使用していますか?システムはWindows認証を使用していますか?その場合、他のドメインはドメインのユーザーを受け入れますか?

ドメイン間で信頼関係を定義するか、サーバーのドメインに対して異なる適切な資格情報でログインする必要があります。

関連する問題