I am using ReportExecutionServiceSoapClient in .Net Core. I got the latest version of .net Core and tried to get a report from reporting services to work. after I used the WCF connection service, I was able to add code with words similar to it
// Instantiate the Soap client ReportExecutionServiceSoap rsExec = new ReportExecutionServiceSoapClient(ReportExecutionServiceSoapClient.EndpointConfiguration.ReportExecutionServiceSoap); // Create a network credential object with the appropriate username and password used // to access the SSRS web service string historyID = null; TrustedUserHeader trustedUserHeader = new TrustedUserHeader(); ExecutionHeader execHeader = new ExecutionHeader(); // Here we call the async LoadReport() method using the "await" keyword, which means any code below this method // will not execute until the result from the LoadReportAsync task is returned var taskLoadReport = rsExec.LoadReportAsync(reportPath, historyID); // By the time the LoadReportAsync task is returned successfully, its "executionInfo" property // would have already been populated. Now the remaining code in this main thread will resume executing string deviceInfo = null; string format = "EXCEL"; // Now, similar to the above task, we will call the RenderAsync() method and await its result var taskRender = await rsExec.RenderAsync(renderReq);
When it works, renderAsync all falls apart because the credentials for the service are not set anywhere. I tried to log in async without success. I also tried to set credentials using SetExecutionCredentialsAsync, but I got an error: βAn HTTP request was not authorized using the Anonymous client authentication scheme. The authentication header received from the server wasβ NTLM. βI donβt know how to change this is for ReportExecutionServiceSoapClient.
I read several posts in which the guys from Microsoft say that authentication with soap is not allowed, but for me it seems so close to be true. I feel something is missing.
Technological stack: VS 2017, .net Core web api, ssrs 2016, sql server 2016 standard
How can I authenticate a user for this call?
source share