Handling async ASMX web service exceptions

Posted by Andy on Stack Overflow See other posts from Stack Overflow or by Andy
Published on 2010-04-16T10:23:29Z Indexed on 2010/04/16 10:33 UTC
Read the original article Hit count: 827

Filed under:
|
|
|
|

Hi,

I've developed silverlight client with makes async web services calls to a asmx web service. The problem is, I want to handle exceptions, so far as to be able to tell in the client application whether there was an exception in the webservice (and therefore will be logged local to the webservice) or whether there was a communication problem (i.e. the endpoint for the webservice was wrong).

In testing both types of exceptions in my project I get the same generic exception:

System.ServiceModel.CommunicationException: The remote server returned an error: NotFound.

This exception is amazingly useless when an exception occured in the webservice as it clearly has been found.

Is the presence of this generic error to do with security (not being allowed to see true errors)? It can't be the fact that I don't have debug strings as I'm running on a dev PC.

Either way, my question is, what's the best way to handle async errors in a commercial silverlight application?

Any links or ideas are most welcome! :)

Thanks a lot!

Andy.

© Stack Overflow or respective owner

Related posts about Silverlight

Related posts about asmx