In WCF, operation Contract has a method like string message(string name).How to run the method based on timer control and display the output in text file.
I am hosting this wcf service in windows Service.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Hemant SrivastavaPosted Jan 27, 2015, 5:06 PM
Your problem looks confusing to me. Suppose you create a local Timer within a method and set interval (say 5 seconds) but when the call exits, WCF service won't have access to that timer since it was locally declared.
Lets assume the another scenario, suppose your Timer is a static timer and declared at service level not at method level and your client calls the method and it starts the timer which will print caller string after ceratin interval but now question is who will stop the timer.
Both of the cases are confusing to me :(
I need actual problem statement to help you out.
panaklareddy chPosted Jan 26, 2015, 11:15 PM
Hemant SrivastavaPosted Jan 26, 2015, 10:12 AM
Could you explain more what you expect when the method "string message(string name)" is called from the client? I have confusion like...Is Timer started on this method invoking or Timer was already running, you just want to print name on a file after certain time interval?