title: Using Web API for a Windows Service to Receive Commands and Perform Tasks via Polling?
body: <p>I have a project where I need to create a windows service that, when instructed via a command, will perform various tasks.  This server would run on multiple servers and would effectively perform the same kind of tasks when requested.</p>
  
  <p>For example, I would like to have a Web API service that listens for requests from the servers.  </p>
  
  <p>The service running on the server would send a query to Web API every 25 secs or so and pass to it its SERVERNAME.  The Web API logic will then look up the SERVERNAME and look for any status updates for various tasks... I.E., if a status for a DELETE command is a 1, the service would delete the folder containing log files...   if a status for a ZIP command is a 1, the service would zip the folder containing log files and FTP them to a centralized location.</p>
  
  <p>This concept seems simple enough, and I think I need a nudge to tell me if this sounds like a good design.   I'm thinking of using .NET 4.5 for the Windows Service, so that I can use the HttpClient object and, of course, .NET 4.5 for the Web API/MVC project.</p>
  
  <p>Can someone please get me started on what a basic Web API woudld look like provide status updates to the Windows services that are running and issue commands to them...</p>
  
  <p>I'm thinking of having a simple MVC website that folks will have a list of servers (maybe based on a simple XML file or something) that they can click various radio buttons to turn on "DELETE", "ZIP" or whatever, to trigger the task on the service.</p>