レポート サーバーのレポートにアクセスするために、特定のドメイン資格情報を提供しようとしています。既定の資格情報を使用する (実際のクレジットを提供しない) 場合、レポート サーバーにアクセスできるので問題なく動作します。資格情報をハードコードする (およびデフォルトの資格情報を無効にする) とすぐに、401 例外が発生します (要求は HTTP ステータス 401: Unauthorized で失敗しました)。
コンボボックス1は、各サーバーが利用可能なコンボボックスです(明らかに)
urlText は、Web サービス URL のテキスト フィールドです。
comboBox1.Items.Clear();
var rs = new ReportingService2005
{
Url = urlText.Text,
//any of those three work
//Credentials = System.Net.CredentialCache.DefaultCredentials,
//Credentials = System.Net.CredentialCache.DefaultNetworkCredentials
UseDefaultCredentials = true
//This doesn't work
//Credentials = new NetworkCredential("user", "pass", "domain")
};
// get catalog items from the report server database
var items = rs.ListChildren("/", true); <------exception on this line---------
foreach (var item in items)
{
if (item.Type == ItemTypeEnum.Report)
comboBox1.Items.Add(item.Path);
}
私が知る限り、必要なのはそれだけです。rsreportserver.config と関係がある可能性があります。現在のところ、Web インターフェイスを通過しても資格情報は求められません (それが重要かどうかはわかりませんが、詳細情報だけです)。
認証セクションはこちら
<Authentication>
<AuthenticationTypes>
<RSWindowsNegotiate/>
</AuthenticationTypes>
<RSWindowsExtendedProtectionLevel>Off</RSWindowsExtendedProtectionLevel>
<RSWindowsExtendedProtectionScenario>Proxy</RSWindowsExtendedProtectionScenario>
<EnableAuthPersistence>true</EnableAuthPersistence>
</Authentication>