I managed to develop a custom WCF service, using the publish / subscribe model, and hosted inside a managed windows service. Everything's working.
I developed an interface as the service contract implementing a method definition marked as a non-one way operation contract (OperationContract(IsOneWay = false)]. This, to make possible returns an instance of a custom class derived from System.Web.Mvc.ActionResult.
In the MVC app, event fires ok. It wraps inside an action method, (just the one defined in the interface), but, and this is my current problem, i believe that something relative to the execution context of the windows service (and the hosted wcf counterpart) blocks the execution of the action method in the MVC app.
This is what i have until now (some pieces ripped off just to be more clear):
/// Method definition for the contract's service. Maps to a MVC ActionMethod.
[OperationContract(IsOneWay = false)]
ActionResult Imagen(string data, CustomActionResult result);
The class to hold an ActionResult derived class instance:
public class ServiceEventArgsMvc : ServiceEventArgs
{
/// <summary>
///
/// </summary>
public CustomActionResult Result { get; set; }
}
And the code in the MVC client app:
/// <summary>
/// Just a simple class to hold an abstract ActionResult derived class instance.
/// </summary>
public ActionResult Image(string data, CustomActionResult result)
{
ViewData["data"] = data;
return View();
}
Ok. ActionMethod sucessfully executes...but when it's done (and usually expected obtain a reditection to a View named Image, like the action method), the WCF service throws a Timeout exception, making clear that he's still waiting for a response from the MVC client. The response never arrives, so the MVC app never finish his work (redirect to the "Image" view as expected).
Any ideas?. Guess i'm missing something very simple, but i don't know what it could be. This is drivin' me nuts.