Silverlight chat application using WCF full duplex

Last week I have been started to read about full duplex wcf and his implementation in silverlight applications.I have read tons of articles on MSDN and tons of blog and forum posts.

Recently I have found solution for chat application on this blog http://silverbling.blogspot.com/2009/01/using-pollingduplexhttpbinding-for.html

so I have little modified that application but it is basically same application.This application is based on this blog post of Dan Wahlin :

http://weblogs.asp.net/dwahlin/archive/2008/06/16/pushing-data-to-a-silverlight-client-with-wcf-duplex-service-part-i.aspx

Everything that you need to know about building wcf full duplex application for silverlight you can find on msdn :

http://msdn.microsoft.com/en-us/library/cc645027(VS.95).aspx

and for accessing wcf duplex from silverlight client:

http://msdn.microsoft.com/en-us/library/cc645028(VS.95).aspx

This application is also based on same articles above.This is simple chat application that has no chat rooms.Same concept you can use for developing multiplayer online silverlight games.

If you want to modify this application to add rooms you can look some useful pattern for that  List-Based Publish-Subscribe  :

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

What I have get when I have finished project looks like this :

Ielook1

Only thing that you need to do to make this project work for you is to change url of your wcf web service in page.xaml.cs .

this.pusher = new PushDataReceiver(

                this.processor,

                http://localhost.:5433/SilverlightChatDuplexService.svc”,

                “Silverlight/ISilverlightChatDuplexService/InitiateDuplex”,    // The Wcf function or action.

                “”);

 

Demo project : SilverlightChat

 

 

  • http://www.deepelement.com/blog Todd morrison

    Yeah, this is pretty much how we are doing collaboration.
    Now, wouldn’t it be cool if someone setup a peer-to-peer resource framework using duplex?!

  • http://blog.developers.ba/ Radenko Zec

    Todd.That is only matter of time :-)

  • Patrick

    I’m using VS 2008, and I’m having a problem with the svc file. I’m currently receiving the following error: “Metadata publishing for this service is currently disabled.” I tried editing the web.config file following the instructions on this page…

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

    …but had no luck.

    Any ideas would be most appreciated.

  • http://blog.developers.ba/ Radenko Zec

    Patrick. You are on the right way. You need to modify web config to enable metadata publishing for WCF service.
    You have all information on that site. Read it again.

  • http://mannpandey.blogspot.com/ Anil Pandey

    hi,

    i check this application that is very nice, but while running the application i m getting the Soap error that Soap 11 and soap 12 mismatch.

    once i resolve that i m getting the error that the Remote server returned an error NOT FOUND.

    can you please help me out in solving this error.

    Thanks
    Anil Pandey

  • http://blog.developers.ba/ Radenko Zec

    Hi Anil.You have maybe changed web config file on server and put some error code in it. For example incorrect binding name…
    First check your WCF server config file and check your service is up and running.

  • http://amigodev.blogspot.com/ Zain Shaikh

    really good effort, thanks for providing the source code.