Wednesday, February 15, 2012

error accessing rs web service

I am having problems accessing reporting services using the report viewer web service from a web application. We are getting the following error.
System.Net.WebException: The request failed with HTTP status 401: Access Denied.
Below is the code. The uncommented code works, but we don't want to hard code a user. The DefaultCredentials are coming up blank. Any suggestions on why this may be or what to do to correct would be appreciated.
<code>

Dim rsAsNew reportserver_dev.ReportingService

Dim itemAs reportserver_dev.CatalogItem

' gets users network creditentials for reporting services

'rs.Credentials = System.Net.CredentialCache.DefaultCredentials

' ***** to do: this is temporary to force authentication

Dim cacheAsNew System.Net.CredentialCache

cache.Add(New Uri(rs.Url), "Negotiate",New System.Net.NetworkCredential("user", "pwd", "domain"))

rs.Credentials = cache

</code>
Hi,
In your web.config is set <identity impersonate="true" /> ?
Regards
|||Hello creagan,
Is the reporting service on the same machine or on a remote machine? If the
report server is a remote machine, then using impersonation and CredentialCache.DefaultCredentials
doesn't work because of a one-hop limitation in NTLM authentication.
Authentication, Role-based Security, and SQL Reporting Services
Roadmap to Delegation

HTH,|||

Please try these links

http://support.microsoft.com/?id=306158
http://www.c-sharpcorner.com/UploadFile/chauhan_sonu57/ProgrammaticImpersonation02022006080545AM/ProgrammaticImpersonation.aspx?ArticleID=3aa21cd6-b867-4306-96ed-de0ba5930fa1
http://blogs.msdn.com/bimusings/archive/2005/11/18/494436.aspx

Regards,
Jimmy

No comments:

Post a Comment