using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;

namespace CallbackDemoService
{
    public class SampleContract : ISampleContract
    {
        public string GetData(int value)
        {
            Console.WriteLine("Message received {0}", value);

            ISampleContractCallback callbacks = 
                OperationContext.Current.GetCallbackChannel<ISampleContractCallback>();
            callbacks.NotifyClient("First client notification");
            callbacks.NotifyClient("Second client notification");
            
            return String.Format("You entered: {0}", value);
        }
    }
}
