No matter how I configure the Credentials property I get a 401 exception when I try to Render the report. Here is my (latest) code:
var rs = new ReportExecutionService();
rs.Url = "https://myserver/reportserver/reportexecution2005.asmx";
var myCache = new System.Net.CredentialCache();
myCache.Add(new Uri(rs.Url), "kerberos" , new System.Net.NetworkCredential("username", "password", "Domain"));
rs.Credentials = myCache;
The URL and credentials are all correct. But still getting a 401 when I cal rs.Render(...). The Reporting Services ins开发者_高级运维tall is sitting on a Windows Server 2008 box and requires integrated authentication.
Thanks
ANSWER: Modify my rsreportserver.config file so as to ONLY allow BASIC authentication. I had both BASIC and KERBEROS allowed and it wasn't until I commented out all other allowable types but basic that things started to work.
<AuthenticationTypes>
<RSWindowsBasic/>
</AuthenticationTypes>
Not sure why this is (at least not totally). But these links on msdn were helpful:
http://msdn.microsoft.com/en-us/library/cc281309.aspx
http://msdn.microsoft.com/en-us/library/cc281253.aspx
精彩评论