You are a bit ambitious, expecting the IObservable<T> be automatically transmitted over the cable. I am afraid that the WebAPI will not do this for you.
What you see is the result of the default json serializer outputting the IObservable<T> properties - and they are not there, so you get empty curly braces.
Your unit test works because everything in memory - serialization / deserialization does not occur.
There are ways to use the HttpResponseMessage StreamContent property to stream results that you could translate to / from IObservable<T> , but this is not really an idiomatic WebApi. Async support for WebApi is really aimed at asynchronously processing requests with responses of individual elements on the server, rather than returning continuous streams of events.
In the end, I believe that WebApi (at least at the time of writing) is the wrong technology choice here. You look much better at SignalR , which is designed for such a scenario and is included in the current version of ASP. NETWORK. It supports both javascript and .NET, and you can easily switch to IObservable<T> . Some people have already looked at this, for example in this example code for sports games .
Some middleware for messaging, such as my-Channels Nirvana (Edit: since Terracotta bought it and is packaged in Universal Messaging Some, sample code is available in their documentation.) And CEP solutions like SQL Server StreamInsight also have built-in IObservable support.
source share