I am new to WCF programming. Here's what I need:
The Windows service needs to start once the PC starts. Then it should begin logging some data. The user can run the client application anytime to retrieve logged data.
However, I could not do the automated logging part because the client is the one who invokes the constructor of the WCF Service. This cannot be done inside the windows service's OnStart() method.
Is there a way to invoke a WCF operation from the Onstart() method of Windows service?
As - if you didn't configure it otherwise - a new instance of the WCF service class is created upon every call from the client, you could yourself also create a new instance of the class and just call your method. From your service's point of view, it is just a normal class.
It would help greatly if you could elaborate on what's done in Start
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.