none
wcf call back channel abort exception , please help me :( RRS feed

  • Question

  • I implemented publisher-subscriber mechanism with WCF.

    this is how I subscribe for callbacks :

    public delegate void AsyncResponseEventHandler(AsyncResponse asyncResponse); 

    public static event AsyncResponseEventHandler AsyncResponseEvent;       

    public static IMyEvents Subscriber;       

    public  void SubscribeEvent()       

    {           

    Subscriber = OperationContext.Current.GetCallbackChannel<IMyEvents>();           

    AsyncResponseEvent += new AsyncResponseEventHandler (Subscriber.AsyncResponseCallBack);       

    }         

    public static void RaiseAsyncResponse(AsyncResponse asyncResponse)         {         

      try 

              {               

    AsyncResponseEvent.Invoke(asyncResponse);

                }           

    catch (Exception ex)  {throw;}   

    }                   

    I use RaiseAsyncResponse method to raise callback to client ,

    when service host is windows service and I start the service and I start debugging , everything works fine for the first time , but when I stop the client application and restart debugging with out restarting the windows service , I face the exception: The communication object, System.ServiceModel.Channels.ServiceChannel, cannot be used for communication because it has been Abort ...

    why the callback channel is aborted?

    please help me out ... :(

    Friday, May 10, 2013 2:34 PM

Answers