Ankesh
Ankesh

Reputation: 4885

Two way communication using netTCPBinding

I am new to WCF (Just a day or 2). I am planning to make an application having Client/Server

WCF Service (On Server hosted as windows service):

  1. Will invoke some commands using (Process.Start())
  2. Will send some information from my database

Questions:

  1. What WCF binding should I use? WsDualhttp or netTCP (Please elaborate if you can)
  2. Does WCF works with SqlServer + EF 4.1

Server UI:

This will primarily will be used to

  1. Start ot stop the above service
  2. Change Address (localhost to [My Ip address]) and Port
  3. Show status of service (Running or dead)

Questions:

  1. How can I Change the address and port of my WCF service from this UI (it will be a different project and hence different config file).

Client App:

  1. Used to issue commands to WCF service.
  2. Get to know if the service is running or dead.
  3. Receive status messages for task completion or faults.

Also, can the windows installer be combined to install ServerUI + WCF Service + Windows service?

Upvotes: 1

Views: 1567

Answers (2)

Matt Davis
Matt Davis

Reputation: 46034

WCF Service

  1. Here are a couple links on choosing the right binding. Based on the scenario you're describing, I'd go with the netTCP.
  2. WCF and SQL Server are independent of each other, so I wouldn't expect any problems using the Windows service to interact with your database.
  3. I'd suggest reading up on how to start a process from a Windows service.

Server UI

  1. I would suggest hosting another WCF service in your Windows service for interacting with your Server UI. You can use the netNamedPipeBinding since this communication channel will always be local, i.e., on the same box. So your Windows service will host two WCF services - one for the external communication with the client and one for the local communication with the configuration UI.

Installer

  1. Yes, the Windows installer can be used, but that might be overkill for what you're describing. Of the Server UI, WCF Service, and Windows service, the only one that absolutely requires installation is the Windows service. The others could theoretically run simply by copying the assemblies to the target system. You might consider having the Windows service install itself via command line. That way you could get away with a self-extracting executable using software like WinZip. This might be less heavyweight than a formal install. If you go this route, have a look at the step-by-step here.

Upvotes: 1

Jocke
Jocke

Reputation: 2284

Ha a look at WCF duplex services: http://msdn.microsoft.com/en-us/library/ms731064.aspx

Why do you want to have a interface to an windows service? And if you have access to IIS7 and WAS, I would recommend to use it instead of self-hosting in windows service.

Here is a good starting point for WCF Configuration Management: http://msdn.microsoft.com/en-us/library/ff650534.aspx

Yes, you can use windows installer.

Cheers --Jocke

Upvotes: 0

Related Questions