Two sided WCF services communication

I'm using WCF.

I have two applications: "Main" and "Worker".

Sometimes application "Main" is giving task for "Worker". "Worker" is doing work and when work is done it gives result to "Main".

How should this communication be done?

I need to call Worker.AddTask(Task) from Main and Main.AddResult(Result) from Worker. Is there better way than setting up two Services?

Answers


This sounds classic for WCF's callbacks- it allows for two-way async communication between server and client (in your case, the server would be the 'worker', and the 'main' application would invoke its methods in order to start processing. When worker is done, it will invoke a callback on main.) LMGTFY :)


Does every call to "Worker" eventually end with a result for "Main" to work with? If so, you might want to just have "Main" call "Worker" asynchronously, the "Main" can just wait for the results as then come back. See: http://msdn.microsoft.com/en-us/library/ms730059.aspx


Need Your Help

Rails update model without leaving page

javascript jquery ruby-on-rails ruby ajax

What would be the best way to update a record and display a flash success notice without leaving the page?

How to fetch the file placed in azure storage container to local machine using SSIS

asp.net ssis azure sql-azure

I want to write a SSIS package to fetch the file placed in my azure storage container to my local machine , can i know any good article which explains it.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.