Hi all,
I've written a simple web service which I'm calling asynchronously from a WP7 app.
I had it all working OK with the web service running through VS2010, no problems. I then repeated the test without the web site running. What I get is an EndPointNotFoundException raised inside reference.cs.
Not entirely unexpected.
My question is, how to I elegantly trap and handle this when calling the web service asynchronously? Obviously putting the async call inside a try..catch block as little effect. The callback delegate never gets called, because the web site is not reached. I really don't want to manually edit the reference.cs file.
Any ideas on this? I can't be the first, and am hoping that I've missed something simple.
Thanks in advance.
Loading
Alec TuckerPosted Dec 22, 2011, 1:08 AM
Although execution breaks when in Visual Studio, you can just continue. Execution will then fall into the completed delegate, and once in there you can query the Error property of the CompletedEventArgs, which will contain the exception.
See the following post:
http://stackoverflow.com/questions/94610/best-way-to-catch-a-wcf-exception-in-silverlight