WCF Async Project

Posted on 2011-10-09
Medium Priority
Last Modified: 2012-05-12

I have been asked to develop an application that will allow communication between an existing Winform client application and a asp.net web application (CLR 4.0). I am exploring the idea of developing the following WCF based solution but would like to understand if this is feasible. The scope of this question is strictly focused on high-level guidance.

1. Winform

The existing winform app will be re-worked to run inside the taskbar tray (bottom right Win7).

2. Initial WCF Call

Winform app would call WCF service asyncronously and request to be notified if a xml file is copied server side

3. Trigger Winform App

Web app would need to communicate with winform app so web app calls application server side that creates xml file in watched directory.

4. WCF Async Response

WCF service would notify winform with asyncronous response when xml file is finally detected.

5. Winform app responds to web request

Winform app reads and performs tasked defined within the xml file.
Basic questions are is this feasible given that the winform app will load when the Win7 desktop starts and web app requests (in xml file) could be hours apart. I am using .Net CLR 4.0. So can WCF winform client and WCF service work effectively in this scenario? Should an intermediate WCF service layer be required between the IIS WCF service and Backend server app? Note there will be several hundred win/web clients communicating back and forth to. The win/web clients would be running on the same pc and the WCF service will be located across the internet. Each WCF service would simply be setup as a file watch and respond. I am again simply looking for some high-level guidance on this solution and will open other new questions to ask more detailed questions.

As an alternative please advise if this WCF event pattern could also work to establish duplex communication between the web client and the winform client. http://msdn.microsoft.com/en-us/library/ms752254.aspx 

Thank you
Question by:jherington
  • 3
  • 2
LVL 28

Expert Comment

ID: 36943678
Everything you have would work fine except for one small consideration: request interruption from the winform to wcf during the asynch call.

This can be caused by any number of problems.
 - Script timeout on the server
 - Server app pool recycle
 - Client script timeout
 - etc.

I would recommend one small change. Set the WCF service to reply immediately to a request with whether the file is there or not and then perform a looping call to this service until a file is detected. You can sleep between calls for any length of time for efficiency.

Author Comment

ID: 36944180
Thank you, so then I would continue to use Async WCF calls at both the winform and web clients to check status...correct. The concern I have is the potential delay when the web client makes an initial request; my requirement would be for the winform client to always respond within no more then 5 seconds on an initial request. Is there a way to have the winform client subscribe to an event on the server side or if I setup a looping test for the winform every 5 seconds would that create an inappropriate amount of network traffic (in your opinion)?

Thank you.
LVL 28

Accepted Solution

strickdd earned 2000 total points
ID: 36944291
If you are looping every 5 seconds and simply receiving a True/False and the XML data if a true is returned, this is minimal network traffic. You'd be looking at less than 1kB for that request when no file exists, essentially a little bit more than a ping.

Author Closing Comment

ID: 36944852
Closing question; is there any solution that would include the winform client subscribing to a server site event which would thereby allow the server to push an async event response back to the client over the web?

Thank you, your advice has been very helpful!
LVL 28

Expert Comment

ID: 36948190
Unfortunately there isn't anyway to subscribe to a server event. On the web it is all request/response based and there are limitations there.

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
High user turnover can cause old/redundant user data to consume valuable space. UserResourceCleanup was developed to address this by automatically deleting user folders when the user account is deleted.
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses
Course of the Month16 days, 18 hours left to enroll

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question