ASP.NET
How make web service not automatically restart
Gravatar is a globally recognized avatar based on your email address. How make web service not automatically restart
  VFPJCOOK
  All
  Oct 20, 2020 @ 12:14pm

Hi Rick, Not sure where I should post this but since my web service is ASP I am guessing this is the correct forum.

As a reminder, when I want to stop my service I open command prompt as Administrator. Go to my root folder for my service and type iisreset /stop. When I want to restart it I do the same except iisreset /start. My service seems to restart automatically when I restart the windows server and maybe if a vendor hits the service. Is there a setting that will keep it from doing so? I would rather I restart it when I am ready for it to be restarted.

Thanks, John

Gravatar is a globally recognized avatar based on your email address. re: How make web service not automatically restart
  Rick Strahl
  VFPJCOOK
  Oct 20, 2020 @ 01:22pm

There's no way to do this. Once an application is set up and configured under the Web server, it's reachable and works.

Not sure what your use case is, but it surely is a rare/odd one. The idea of a Web Service is that it's supposed to be accessible.

That said it's possible to build some custom logic into the server so that you can set a switch that effectively disables the service or returns a 'not ready' type of response.

But again, I think that's doing it wrong.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: How make web service not automatically restart
  Craig Tucker
  Rick Strahl
  Nov 9, 2020 @ 06:31am

Rick, This is what I like about the QMM service. You can stop and start the "services" nicely, as it waits for the process to idle before stopping so it doesn't stop in the middle of a process. Would you suggest VFPJCOOK look at moving the web services to QMM or something similar?

Gravatar is a globally recognized avatar based on your email address. re: How make web service not automatically restart
  Rick Strahl
  Craig Tucker
  Nov 10, 2020 @ 04:28pm

Not quite the same thing, Craig 😃

Running a queue service takes a lot more effort to setup and manage than it does to run a simple REST or SOAP service. And... shutting down the queue doesn't shut down the entire Web site either.

Anyway, there should be little reason to have a Web site that shouldn't always be running. That just seems silly 😃 If there is a need to not process requests it's easy enough to add logic to the service to check for active status and return something like a 404 Not Found HTTP response or similar.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: How make web service not automatically restart
  Craig Tucker
  Rick Strahl
  Nov 12, 2020 @ 06:17am

LOL... My suggestion would be to have the REST/SOAP request go into the queue. It stays running all the time, but you can stop and start the process that processes the request as needed. So the website never stops accepting the payload request as it gets queued, however you easily manage stopping and starting of the queue processes.

© 1996-2024