.NET APIs for window service

I tried run the example project "DataApiUsageExampleRealtimeData", everything is fine, but I rewrite it into window service, nothing was trigger in the "DataReceived" action.

singleRequest = realtime.Request("GBP=", "BID", DataReceived); 
singleSubscription = realtime.Subscribe("EUR=", "BID", DataReceived);

is this API can use in window service.??

Thanks for the answer.

Best Answer

  • Alex Putkov.1
    Alex Putkov.1 ✭✭✭✭✭
    Answer ✓

    Eikon .NET API was not designed for and has never been tested in Windows service applications. By design it has runtime dependency on Eikon application, which can only be used in interactive Windows station. You can try using this API in a Windows service, but there's no guarantee it will work. At the very least the service must be run in the context of the user's account who previously interactively launched Eikon, signed in and checked "Sign me in automatically" checkbox. There's absolutely no chance you can successfully use Eikon .NET API in a service run with LocalService, NetworkService or LocalSystem accounts. And even then I can foresee a bunch of issues that might prevent the service from being able to retrieve data from Eikon. Long story short you're better off not using Eikon .NET or COM APIs in Windows service applications.

Answers