I am looking for a way to expose many (2000+) similar web services through WCF.
I am working on an enterprise application in which the business logic is packaged through classes (CQS). These classes compose all data required to perform a specific piece of business logic. I would like to find a way to expose these classes as web services through self hosting.
All these classes have just one action (execute). They all inherit from a base class and their properties differ per class. Based on an implemented interface and the properties, the correct business logic is executed. The web services should be able to provide the values for the properties and execute the action.
At most 5% of these will be used regularly. I know it’s not feasible to create 2000+ service host instances. It is not a problem if these host instances are created on demand and destroyed after e.g. 10 minutes of inactivity. Ideally I would react on a request from a client and instantiate a host when needed.
EDIT:
From the reactions, I get the idea that what I am mostly looking for is a way to not having to register all endpoints. I believe the most feasible approach is that I listen for incoming requests myself and spin up hosts as required.
Is this possible?
Why not have a master service that has a request/response architecture so you only have one web service but with many methods or request types? You could make it as a plugin architecture using MEF or something else. It could spin up things as needed and close them when not. It also keeps your network footprint small.