Starting self hosted WCF services on demand

Posted by Pieter on Stack Overflow See other posts from Stack Overflow or by Pieter
Published on 2011-02-25T19:25:51Z Indexed on 2011/02/26 7:25 UTC
Read the original article Hit count: 255

Filed under:
|
|
|
|

Is it possible to start self hosted WCF services on demand?

I see two options to accomplish this:

  • Insert a listener in the self hosted WCF's web server and spin up a service host when a request for a specific service comes in, before WCF starts looking for the existence of that endpoint; or

  • Integrate a web service in process, start a service host for a request if it isn't running yet and redirect the request to that service host (like I suspect IIS does).

I cannot use IIS or WAS because the web services need to run in process with the UI business logic.

Which is feasible and how can I accomplish this?

EDIT:
I cannot just start the service hosts because there are hundreds, most (about 95%) of which are (almost) never used but need to be available. This is for exposing a business logic layer of 900 entities.

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET