简体   繁体   中英

Debug WCF callback service

i am implementing a wcf callback service following this tutorial .

The thing is that my callback method on the client side is never called.

 public void NotifyClient(object sender, EventArgs args)
    {
        INotificationCallback callback = OperationContext.Current.GetCallbackChannel<INotificationCallback >();

        callback.OnStepReached(((ModuleEventArgs)args).Step);
    }

The callback is called on the server side but never reaches the client side. I don't know what went wrong, the only I've got is a TimeOutException after a while.

My callback on the server side is a System.Runtime.Remoting.Proxies._TransparentProxy .

I'd like to know if there is an easy way to debug this behavior.

If you have not already, you may want to consider enabling WCF tracing to ensure the server is really calling the client callback method (callbackInstance.OnCallback(); ).

For reference, the following link provides an overview of WCF Tracing:
http://msdn.microsoft.com/en-us/library/ms733025.aspx

The servicecontract and the callback contract should be one-way. The linked tutorial is missing that. So, Update the operation contract to [OperationContract(IsOneWay = true)]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM