Catch Exceptions for Asyncronous Invoke

G

Guogang

How can I catch exceptions of web service, when I am using Asyncronouse
Invoke (like: myService.BeginGetCustomers()) I want to catch exceptions
like: connection timeout.

In my case, if the web service is disconnected, then the call to
EndGetCustomers() will hang forever.

Thanks,
Guogang
 
G

Guogang

Looks like there is an exception thrown for EndGetCustomer(), but because it
is in the callback function and called by another thread, the exception just
flying away without being caught anywhere.

Now, I add a try, catch block around the EndGetCustomer() to catch the
exception. It works.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,263
Messages
2,571,064
Members
48,769
Latest member
Clifft

Latest Threads

Top