Hi Bruce,
I tried as you suggest. Fire and Forget. But after 2 hours looks like it is timing out. I am accessing SSRS report using URL. It comes back saying, SSRS server not found.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi,
I have API end point that gets called from another service(bl1).
[HttpGet]
[Route("createfile")]
public void createsfile(string param1, string param2)
{
//asynchronous call to bl1 method
var files = new bl1();
files.generateFiles(param1, param2);
//send message to the caller that file creation process started immediately.
}
New Service (bl1)
public void generatefiles (string param1, string param2)
{
//loop through accounts that were retrieved from database
foreach (int act in actlist)
{
//generate stream by calling SSRS web request.
try
{
HttpClient client = new HttpClient(new HttpClientHandler()
{ UseDefaultCredentials = true,/* PreAuthenticate = false */});
Stream theStream = await client.GetStreamAsync(new Uri(reportUrl));
using (var memoryStream = new MemoryStream())
{
theStream.CopyTo(memoryStream);
System.IO.File.WriteAllBytes(pFileName, memoryStream.ToArray());
}
}
catch (Exception ex)
{
string he = "routine";
}
}
}
From this end point, we need to call another service say bl1 (business logic) that actually generates 2000 files. What I want is when request is made to the end point, it should start bl1 process asynchronously and immediately go back to caller with message that 'process started'
That bl1 process should be asynchronous loop through accounts and generate pdf for all accounts ( may be 1000 times)
How can I do without using await or async. Only main end point needs to be async because it needs to be started on new thread and main thread not to worry about it.
Hi Bruce,
I tried as you suggest. Fire and Forget. But after 2 hours looks like it is timing out. I am accessing SSRS report using URL. It comes back saying, SSRS server not found.
Hi @Spunny,I think you can check the SSRS trace log to see details about this error. The path of the trace log is generally \Microsoft SQL Server\MSRS12.<instancename >\Reporting Services\LogFiles.For more information, see Reporting Services Log Files and Sources.
If it is a timeout, it may be the reason for the timeout configuration, you can check the following configuration: