I am an avid user of Microsoft SQL Server Reporting Services (SSRS) and have been for a while. In fact I wrote an article a while ago about using the reports through web services. This is a little different article in that I am not writing something new but addressing an issue that I came across several weeks ago after my web host provider upgraded the server to SSRS 2012. As all developers know it is fun to upgrade but can be frustrating at the same time.
After updating the server location and recreating the data source connections in SQL SSRS I was still getting the 401 error. After spending time with Arvixe and their great support staff nothing seemed to work. I knew the problem was with permissions but did not know what could have changed. Did I say that I spent many hours and many attempts to have it work? In the end I found a small change to the code that seemed to work. I am still trying to figure out why this should have made a big difference but maybe this would help someone else. Once I figure out why this needed to be changed I will post the response here. (If you know why then feel free to leave a comment.).
Prior Code: (From original blog)
'This is very important. You need to pass the credentials so that Arvixe will let you login and run the report Dim cache As CredentialCache = New CredentialCache() 'Add a NetworkCredential instance to CredentialCache. 'Negotiate for NTLM or Kerberos authentication. cache.Add(New Uri(rs.Url), "Negotiate", New NetworkCredential("[ARVIXE LOGIN NAME TO REPORT SERVER", "PASSWORD TO THE REPORT SERVER", "SERVER NAME ie. xxx.arvixe.com")) 'Assign CredentialCache to the Web service Client Proxy(myProxy) Credetials property. rs.Credentials = cache
New Change (for SSRS2012)
rs.Credentials = New NetworkCredential("[ARVIXE LOGIN NAME TO REPORT SERVER", "PASSWORD TO THE REPORT SERVER", "SERVER NAME ie. xxx.arvixe.com")
I do not know if my hosting provider did something different in the setup or if SSRS2012 handles credentials a little different by default but if you run into a 401 error you can make sure that this is not the cause.
Looking for quality web hosting? Look no further than Arvixe Web Hosting!