1

I am a newbie developer to WCF and Windows services. I do know c#. The scenario requires various custom applications running on Windows 7 to call methods in another application. It is a client/server relationship, all running on the same computer. The server must be able to notify each client (one at a time) when a specified condition occurs.

I need to develop the server code only.

Would the following be an acceptable solution:

Make the server a windows service that uses WCF. The server could notify the clients by using a different named pipe for each client ?

Thank you...any suggestions would be appreciated.

user2843693
  • 109
  • 1
  • 3

3 Answers3

1

Just use duplex communication over tcp/named pipes/msmq/http (WSDualHttpBinding) channel. AFAIK you need two ports (in/out) for duplex over http

SalientBrain
  • 2,431
  • 16
  • 18
  • If it's all running on the same machine why would he use http? – tom redfern Oct 04 '13 at 07:29
  • And AFAIK WCF tcp/named pipes is now a recommended way to interprocess instead of remoting. Socket programming and using mamory-mapped files are still available, but complex – SalientBrain Oct 04 '13 at 12:53
  • My point was why do you need to go out of process in this scenario? "soa" does not really answer this question. – tom redfern Oct 04 '13 at 13:20
  • "The scenario requires various custom applications running on Windows 7 to call methods in another application" -> out of process – SalientBrain Oct 04 '13 at 14:36
  • Hmm. Didn't read the question properly. Agree then that named pipes would be appropriate in this scenario. Have upvoted your answer – tom redfern Oct 04 '13 at 14:54
0

I would ditch wcf altogether. Although as Brian says, you can use the duplex bindings, these are complicated at best.

If it's all going to run on the same computer, why do you even need client/server? Just build a single client which does everything you need.

tom redfern
  • 30,562
  • 14
  • 91
  • 126
  • Other organizations will be providing applications that call my application. In addition, my application must be able to call a callback method in their applications to notify them of certain events. You are right that all applications (those provided by other organizations, as well as my application) will be installed and running on the same computer. I'm not sure how to make this into one client. – user2843693 Oct 07 '13 at 13:10
0

That is a acceptable solution and should work fine.

Other option for consideration (in the spirit of learning) is creating a Routing Service as an intermediary service which spawns the calls to multiple services. So in your scenario, your client would call the routing service and the routing service will in turn call each of your service

The following link should provide more information on routing service...

[Routing Service][1]

http://msdn.microsoft.com/en-us/library/ee517423.aspx

gpmurthy
  • 2,397
  • 19
  • 21