1

I need to remotely spawn WCF services on a remote machine from a client. I cannot use IIS (no HTTP) or WAS (no Windows Server 2008).

Was wondering if there's a way to do it apart from these hosting environments without having to create a service on the remote machine responsible for the spawning of other WCF services.

If a Windows Service host is the only way, can someone point me to a good article or book for an efficient architecture for doing this (including lifecycle management of spawned WCF services).

Thanks Riko

5
  • What's wrong with a Windows Service?
    – RichardOD
    Sep 22, 2009 at 12:29
  • Nothing, have to do extra work to spawn other services and manage them, plus deploy this additional service.
    – rikoe
    Sep 22, 2009 at 12:34
  • OK- why do you need to spawn these other services? What's wrong with ones always running?
    – RichardOD
    Sep 22, 2009 at 12:47
  • need one service per processor, two service types, X and Y, sometimes need a service X, sometimes a service Y. Service should do it's job, then make processor available again for new X or Y services
    – rikoe
    Sep 22, 2009 at 12:53
  • sounds like WAS would do this but Windows Server 2008 not available to use, nor IIS 6.0 for plain old HTTP
    – rikoe
    Sep 22, 2009 at 12:54

2 Answers 2

3

If you cannot use IIS/WAS, then you're only option left is self-hosting.

You can host your WCF service in either a Windows (NT) Service, or a console app, or any other app you like to have.

The point though is: other than IIS/WAS which will load your service class as needed, when a request comes in and needs to be processed, in a self-hosting environment, you have to have your host app up and running - that's why a NT Service seems like the best choice at least for production environments, a service that can be run even if no one is logged on to the machine. Console or other apps require a user being logged on, and the app must be running.

Hope this helps a bit.

Marc

1
  • Yes, this is the conclusion I came to as well - self-hosting a Windows Service is the only other way. That service will then need to spawn the other services I need locally on the server.
    – rikoe
    Sep 22, 2009 at 14:35
1

There is one additional option you can use on Server 2003 - hosting WCF services in COM+: http://msdn.microsoft.com/en-us/library/bb735856.aspx

This is not as easy as hosting non-HTTP services in WAS on Server 2008, but provides a better supported monitoring and deployment model than hosting as an NT Service. Generally in my experience, though, most people I know have used NT services since is fairly straightforward to generate one in .NET, and then they perf counters or something similar to monitor them in production.

7
  • Ah, thanks, I was wondering about this. My knowledge of COM+ is limited, but from what I know this options seems likely to open a can of worms (or two).
    – rikoe
    Sep 22, 2009 at 14:49
  • I recall reading somewhere that COM+ didn't support "message-based activation" unlike IIS/WAS. Can't find the link now.
    – rikoe
    Sep 22, 2009 at 14:51
  • I don't think the hassle needed to get this all up and running is less than writing your own NT service :-( This might only be viable if you happen to have a ton of COM+ services already.... not recommended, IMHO
    – marc_s
    Sep 22, 2009 at 14:58
  • What about using WF for the service-that-spawns-services - will that help, or does it just add extra overhead?
    – rikoe
    Sep 22, 2009 at 15:05
  • In my experience WF just adds overhead. The fastest and most direct way to get this working is an NT Service. The COM+ answer was just provided since you seemed to want to know all the options.
    – jnoss
    Sep 22, 2009 at 15:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.