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