Click here to Skip to main content
15,891,316 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi All,

I am using one external WCF service API in application. One of the method from WCF Service need to call for every 5 min.
I saw different mechanism
1) windows service
2) Console application with service method call

What will be the best mechanism to implement in application itself.

public void CallEach5Min(){
while (true)
            {
                ServiceCall callClient = new ServiceCall();
                callClient.method1();
                System.Threading.Thread.Sleep(TimeSpan.FromMinutes(5));
            }
}


I am using MVC 4 application. Is there any way in MVC application, to call this method only once, Even after publishing app to web server.

Thank you in advance for your response.

-Avinash
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900