Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Healthec
Frequent Visitor

The request failed with HTTP status 401: Unauthorized ReportingService2010.GetPolicies

Dear Support Team,

 

I am facing one Unauthorized issue when i am going to add specific user to Power bi report server dynamically.

I have used below code to get policies and assign the specific role to the the user to access the Power bi report.

 

  ReportingService2010 rs = new ReportingService2010();
                       
                            rs.Url = domain + "/ReportServer/ReportService2010.asmx";
                            rs.Credentials = System.Net.CredentialCache.DefaultCredentials;
                            
                            var policies = !string.IsNullOrEmpty(directory) ? rs.GetPolicies("/" + directory, out isPolicies) : rs.GetPolicies("/", out isPolicies);//"/<your folder name>"

 

This code i used in my application, And it is working fine when i have the Power bi report server and application in same domain.

But when i have application in other domain and report server in other domain then getting below issue:

 

"The request failed with HTTP status 401: Unauthorized.
and Stacktrace : 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 DevExpress_3D.ReportServerReference.ReportingService2010.GetPolicies(String ItemPath, Boolean& InheritParent)"

 

I have verified the Reporting server web services in other domain and it is accessible.

Need your help to fix this issue.

 

Thanks,

Vikash

1 ACCEPTED SOLUTION
Healthec
Frequent Visitor

Hi All,

 

I have found the solution for above issue asked.

 

When report server and application was in same domain then in that case DefaultCredentials was working perfectly.

 

Once we call the reporting service from other domain then found this issue and got the solution like for credentials we have to set the userid , password and domain to get the policies.

 

Thank you, Everyone.

 

View solution in original post

1 REPLY 1
Healthec
Frequent Visitor

Hi All,

 

I have found the solution for above issue asked.

 

When report server and application was in same domain then in that case DefaultCredentials was working perfectly.

 

Once we call the reporting service from other domain then found this issue and got the solution like for credentials we have to set the userid , password and domain to get the policies.

 

Thank you, Everyone.

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.