I have the following situation: My WCF service allows a client to register to wait for some event. The waiting is asynchronous on the service side, that is, the waiter is registered and when the process is finished, the waiter is notified. At the moment, it's simply a ManualResetEvent
.
Now I want to expose this method via WCF. I tried to use AsyncPattern=true
and created two methods, BeginWait
which bundles the event into a IAsyncResult
, and EndWait
which calls AsyncWaitHandle.WaitOne()
. However, if I call BeginWait
, EndWait
from the client, the server side EndWait
is not executed. I'm using a manually implemented wrapper (my proxy class is derived from ChannelBase<IWaitService>, IWaitService
), which basically calls Channel.EndWait()
, and this function is indeed called; but on the server side, the call never arrives.
What am I doing wrong here? Follow-up question: If the asynchronous call is working, is there an easy way to make that synchronous on the client side?