question

Upvotes
Accepted
1 1 1 2

.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.

eikoneikon-com-apieikon-.net-api
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

@theprogrambug Would you tell me please why you would need the API running as a windows service? What is your use case?

the desktop application is easily close by user mistakenly, so it is better not showing the interface.

For this purpose I would suggest a GUIless console application to be run in interactive Windows station rather than a Windows service.

Upvotes
Accepted
39.4k 77 11 27

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.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
1 0 0 1

Hi,

Me also getting same issue. When running this code in windows service datareceived event not firing. I tried by platform target x86, allow desktop interaction to windowsservice, but no luck. please reply asap, struggling from last week.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
1 1 1 2

Thanks Alex, seems I better using desktop application

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.