Link to home
Start Free TrialLog in
Avatar of Starr Duskk
Starr DuskkFlag for United States of America

asked on

Webservice calling itself. Issues?

I have a webservice that runs a loop through a client's employees.

When it is done, I want it to then call the webservice again to do another client's employees, and then close out the current web services connection.

Reason is: If I call the webservice to run until everything's done, everything does not get done, like there is a timeout.

If I run so many at a time, and then use a schedule to trigger the webservice again, apparently some clients take 4 minutes and some take 30 minutes for the same 500 employees (because some have much more data to process), so we have overlaps with the schedule with too many sessions running at the same time, or not enough running because one quit early and so time is wasted waiting for the schedule to trigger again.

So I was thinking, if I start up the webservice 6x at midnight, and then have each webservice session call the webservice again when it is done, that way there will constantly be 6 active sessions until I stop calling it at 5AM.


So if I do have a webservice call itself, that first webservice will end gracefully because it's done anyway, right? no problems?

thanks!
asp.net
Avatar of ste5an
ste5an
Flag of Germany image

If you have long running tasks, then consider a job model.

Where you place a job via the web service and you can poll the execution state of it or you may consider using SignalR to push the state back to your clients.

Then you can off-load the jobs to a Windows service or database job and you're not required to run it in an IIS/ASP.NET session.
ASKER CERTIFIED SOLUTION
Avatar of Starr Duskk
Starr Duskk
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Just a comment:
 
Just because something runs, doesn't mean it's correct from the perspective of software engineering.. It may be sufficient to fulfill your business requirements, but is in most cases at least a technical debt..

You should strongly consider to add additional logging and monitoring here..