WCF to trigger a event in Windows Service
-
Dear All, I have a windows service, to which the user can communicate and the communication is logged in a datatable in windows service. For the communication I have used WCF and the implementation of the service contact interface is done in the Windows Service class itself. While testing I have found the below: 1. The service host is started and the communication is well established. 2. When the communication function is called I have observed that all the instance variables in the Windows Service class is null or with default value. Can any one tell me whether I can notify the Windows service when a data is received by the Service Contract hosted in the Windows Service? Or, can we have the value persistance in the Service contract as using the data in the data table only I need to check whether the data given is unique or duplicated.
Best Regards, M. J. Jaya Chitra
-
Dear All, I have a windows service, to which the user can communicate and the communication is logged in a datatable in windows service. For the communication I have used WCF and the implementation of the service contact interface is done in the Windows Service class itself. While testing I have found the below: 1. The service host is started and the communication is well established. 2. When the communication function is called I have observed that all the instance variables in the Windows Service class is null or with default value. Can any one tell me whether I can notify the Windows service when a data is received by the Service Contract hosted in the Windows Service? Or, can we have the value persistance in the Service contract as using the data in the data table only I need to check whether the data given is unique or duplicated.
Best Regards, M. J. Jaya Chitra
Dear All, I got the answer from the reply of "Brian Griggs" for the post "Events from ServiceHost instance ?". Thanks a lot.
Best Regards, M. J. Jaya Chitra
-
Dear All, I have a windows service, to which the user can communicate and the communication is logged in a datatable in windows service. For the communication I have used WCF and the implementation of the service contact interface is done in the Windows Service class itself. While testing I have found the below: 1. The service host is started and the communication is well established. 2. When the communication function is called I have observed that all the instance variables in the Windows Service class is null or with default value. Can any one tell me whether I can notify the Windows service when a data is received by the Service Contract hosted in the Windows Service? Or, can we have the value persistance in the Service contract as using the data in the data table only I need to check whether the data given is unique or duplicated.
Best Regards, M. J. Jaya Chitra
You can do it by using Events. Place the dll or class on which you have your Contract is implemented in same application domain. Class / Dll should have public event with args which need to transfer to your service to process. Bind the event in the service which shall let your service know about the request. We have used same method to communicate with window service. let me know if you need further help, you can mail me at ashwin.shetty@eclerx.com.
ashwin shetty