I came across above exception when accessing SSRS reports using reporting services SOAP web service. Following is the detailed exception I received.
“System.ApplicationException: Failure in ActivateFeature for feature "<Feature>" on site: '<Site>' ---> System.Web.Services.Protocols.SoapException: The permissions granted to user 'NT AUTHORITY\ANONYMOUS LOGON' are insufficient for performing this operation. ---> Microsoft.ReportingServices.Diagnostics.Utilities.AccessDeniedException: The permissions granted to user 'NT AUTHORITY\ANONYMOUS LOGON' are insufficient for performing this operation.
at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
at Microsoft.SqlServer.ReportingServices2010.ReportingService2010.CreateCatalogItem(String ItemType, String Name, String Parent, Boolean Overwrite, Byte[] Definition, Property[] Properties,”
To resolve the issue I had to include following code segment when calling the web service
- ReportingService2010 service = new ReportingService2010();
- service.Credentials = CredentialCache.DefaultCredentials;
- service.Url = "http://sp13/_vti_bin/ReportServer/ReportService2010.asmx";
- var authCookie = HttpContext.Current.Request.Cookies["FedAuth"];
- if (authCookie != null)
- {
- var fedAuth = new Cookie(authCookie.Name, authCookie.Value, authCookie.Path, string.IsNullOrEmpty(authCookie.Domain) ? HttpContext.Current.Request.Url.Host : authCookie.Domain);
- service.CookieContainer = new CookieContainer();
- service.CookieContainer.Add(fedAuth);
- }
No comments:
Post a Comment