We have a asp.net webform application (3.5) & a wcf service hosted via windows service (a service library which is activated when service is started). Both are deployed in same server.
WCF service is used for few long running task.
Now a client want some customized report which is gonna take significant time.
My idea is to show a progress of the task in the UI, but I am struggling with the correct way to do it.
Is it possible in the following way,
-
On request from page , service starts the processing asynchronously and report the status to some variable. (I don’t want to write to database)
-
A asynchronous polling from client page, which intern communicate with another operation of wcf service to retrieve the the variable value.
Ajax client can communicate with the wcf service but it looks like the service need to be hosted as web application (don’t understand much here)
Any Other thoughts? any option on using wcf callback (duplex communication)? too much confused.
We achieved something similar a year back.
1) We created a WCF Server with Singleton InstanceMode which processes the request and at the same time keep status as well. Another method e.g. GetStatus returns status to client. It also provides error details, in case of any error. However we also persisted the processing details.
2) On web page we async hit getstatus once request is initialized and showed a progress bar on web page.
This worked great for us.