Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Introduction:

I have a WCF service library and a self-host Winform.

Service features is File explorer including (copy, move, delete, new folder, delete... etc) and Task Manager (run, kill, update list).

Then now I want to add other features like chatting between self-host and client, send an image from client to self-host so when it received, it is shown in a pictureBox in a new form.

Till now I have two endpoints for (Task Manager, File Manager) that runs under one service "MainService".

And I set up all the connections using DotNet 4.0 WCF Configuration and Wizards, and I'm using netTcpBinding.

Problem:
I need to know how to communicate with between WCF service lib and self-host, so I can append a received chat from client on self-host form's textbox TextBoxChat.

And also call a client callback from self-host when Send button clicked, to send the message from self-host textbox TextBoxMessage. Let's say this's self-host ChatForm

http://i.stack.imgur.com/CWL8H.jpg

So is it possible to do that in WCF? I would prefer to run ChatEndpoint under MainService, so all Endpoints use one port.

share|improve this question
3  
should this question be better asked on stackoverflow.com ? –  k3b May 7 '12 at 7:07
add comment

1 Answer

It's straight forward enough.

Few examples here:

Winforms example

More complete wpf and wcf example chat

share|improve this answer
    
I've already check both of them, too advanced, too complicated .. i just need to know how would i receive message from client to self-host –  Murhaf Sousli May 8 '12 at 20:30
2  
They explain precisely that, what you want is called WCF duplex (wsDualHttpBinding). It doesn't get any simpler. –  Baboon Jun 6 '12 at 12:04
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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