I have a non-serializable object that I would like to access from a separate process. I’ve looked around and it seems the only viable option is to use WCF but I’m not sure how to do this as I’m new to WCF. If I create a WCF service, how do I ‘hook’ the WinForm into the various events in the WCF service? For example, the user communicates with the WCF service directly and I would likemy WinForm client to be notified. How would I be able to know when the user has done something with the WCF service and have the WinForm client pick up on that?
Share
A way to achieve what you are looking for is to implement a callback contract on your service. Then your win-forms app would be able to “subscribe” to events fired on the service (such as modifications to your object).
To do this you implement a service contract with a callback contract:
You then implement your service:
In your winforms client you only need to implement the callback method:
Config for service:
Config for client