Using a Callback Contract to Implement Events

One of the principal uses of a callback contract is to provide a service with a means to inform a client application of a significant occurrence. You can use callbacks to implement an eventing mechanism; the service can advertise events and provide operations to enable client applications to subscribe to these events or unsubscribe from them. The service can use the callback contract to send a message to each subscribing client when an event occurs. You will see how to do this later, but first you need to define, implement, and test a callback contract that can act as the basis for an eventing mechanism.

Add a callback contract to the ProductsService service and invoke a callback operation

  1. Using Visual ...

Get Microsoft® Windows® Communication Foundation Step by Step now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.