I am consuming a 'third party' WCF service. I am making to call to their method in Async mode from C# console application.

The order I am making call is
1. WCF.MethodA (Async)
2. WCF.MethodB (Async)
3. WCF.MethodC (Async)

I wanted to raise an event (which makes call to 'MethodB') after call to 'MethodA' is successfully complete. Can anyone tell me how to do that? Is that something the service needs to support (raising events)?

Thanks for the response. Can you please point to me a sample on how to raise the event? This is the first time I am working on Async..
–
CoolArchTekNov 30 '11 at 19:58

@CoolArchTek You don't raise the event. Just call the MethodAAsync method on the client, and the event will raise when it's done. WCF takes care of making the method asynchronous for you...
–
Reed CopseyNov 30 '11 at 20:02

I just tried Async event.. but after WCF.MethodAAsync program exited. Do I need enable anything on the WCF Service side?
–
CoolArchTekNov 30 '11 at 20:54

@CoolArchTek If you're doing this in a console application, you need to keep the console app from closing. Try adding a Console.ReadKey() at the end of Main. If you want something more elaborate, you could use a wait handle (ie: ManualResetEvent), and call WaitOne at the end of main. Your handler can then call Set on the wait handle to allow it to continue (and shut down).
–
Reed CopseyNov 30 '11 at 21:02

I was using Console.ReadKey() but don't know how to exit from application.. Can please suggest?
–
CoolArchTekDec 1 '11 at 0:28