tags:

views:

180

answers:

2

Hi

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

+3  A: 

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

marc_s
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.
Riko
+1  A: 

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.

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).
Riko
I recall reading somewhere that COM+ didn't support "message-based activation" unlike IIS/WAS. Can't find the link now.
Riko
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
What about using WF for the service-that-spawns-services - will that help, or does it just add extra overhead?
Riko
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.
If you are serious about using WCF you should migrate this project to Server 2008. The life cycle management issues you allude to will be an ongoing problem on Server 2003 unless you are using HTTP activation in IIS.
Yeah this is what I'm worried about
Riko