Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Async call to WCF with C#?

In C#, how do I make an async call to a WCF Web Service? I have a Service Reference set up to generate async. I also modified my calls to use { WebServiceObject.Begin* () } but there are two parameters at the end, 'AsyncCallback' and 'object asyncState'. What are these and how do I use them?

Thanks,

like image 388
Phillip Avatar asked Jan 23 '23 16:01

Phillip


2 Answers

You might also want to look at Async without the Pain

like image 179
Marc Gravell Avatar answered Feb 01 '23 13:02

Marc Gravell


See MSDN here; http://msdn.microsoft.com/en-us/library/system.asynccallback.aspx

here; http://msdn.microsoft.com/en-us/library/ms228969.aspx

here; http://msdn.microsoft.com/en-us/library/ms228975.aspx

and here; http://msdn.microsoft.com/en-us/library/86wf6409.aspx

Basicly in Begin* you set an callback, that callback is called when the operation has completed. There you call End* to retrieve the appropriate data.

like image 24
thijs Avatar answered Feb 01 '23 12:02

thijs