I am new to WCF programming. Here's what I need:
- A Windows service that hosts a WCF Service. (Done)
- A client application that can call WCF Service operations such as GetValue() from the running Windows service (Done)
- The Windows service needs to call the operation Start() from the WCF service when the Windows service starts. The application in (2) could not retrieve data without the Windows service calling Start() operation first. (Not done)
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?