Wednesday, May 15, 2013

Day 15: WCF Duplex Connectivity & Contracts

Yesterday, i was left with a question on how to trigger notifications to a desktop application from a WCF service. Since the requirement was, if a user notifies the common server that he has arrived at some branch, the notification should be delegated to the correct branch. This could be achieved via WCF Duplex. Utilizing the free time at office tried the example application described at:
http://www.codeproject.com/Articles/491844/A-Beginners-Guide-to-Duplex-WCF

This was a complete new thing to me. While the WCF service defines the client method definitions, the client methods are implemented in the client application and through a special service contract the WCF service is able to call/trigger the client application methods.


Now this example was nicely illustrated between a WCF service and a single desktop application. Have to decide how this could suit my needs where a WCF application, a mobile application and a desktop application are involved.

While trying out the example faced a couple of issues:
  • The Visual Studio WCF Test Client was throwing errors every time I tried to run the web service. Later found from MSDN that Duplex Contracts were not supported in the WCF Test Client. Disabled this through the project properties and continued working.
  • When trying to run the client application "port 80 being used by another application" error was thrown. As I have experienced the similar error before when dealing with HTTP connectivity, my experience played in to rectify it. The default Skype settings is configured to use port 80. Unless we disable this, no other application would be able to use it.
Have to look forward the service contract implementations in the project.

No comments:

Post a Comment