Window service calling web service.

mike55

Contributor
Joined
Mar 26, 2004
Messages
727
Location
Ireland
We have a server in a web farm, on the server we have a particular web service running that has two methods. One of those methods (StartProcessing()) is responsible for connecting to a database and clearing all the data out of a particular table when it is called.

On the same server we have a windows service that is build around a timer, it should run every 5 minutes and call the method StartProcessing() and go to sleep for another 5 minutes before repeating the task.

The problem that we are having is that every couple of days the entire system goes down i.e. the windows service fails to call the web service. When we check the server, both the windows and web service appear to be working correctly. I most cases to fix the problem all we have to do is to restart the windows service. In the worst case scenario, we would also restart IIS and the server as a last resort.

We have been unable to find out why the windows service stops calling the web service. My money would have been on the windows service loosing the connection to the web service, but I'm not too confident on that been the cause. We have gone through the code and have shown an independent developer the code but no luck there either.

Suggestions?

Mike55.
 
Event logging

When we check the server, both the windows and web service appear to be working correctly.

Clearly something isn't working correctly. Your first task is to identify what is exactly is failing. I would suggest adding code which writes to the Windows event log (or indeed any log file) at critical points in the code, such as when the timer fires, when the service is invoked, when the web service receives the invocation, and so forth. It goes without saying that any exceptions should also be logged.

Once you have identified where the problem lies, you can then set about identifying what causes it. It is somewhat inconvenient that the problem only occurs every few days, but without further investigation any proposed fix is likely to be purely speculation.

Good luck :)
 
Re: Event logging

Yea, that's how I am proceeding at the moment. Once I have completed adding in the extra code, its just sit back and wait for the system to fail.

Mike55.
 
Back
Top