If my web method throws an exception, what is the best practice for passing that exception to the client?
views:
32answers:
1
+2
A:
- In plain old asmx services by catching this exception and rethrowing a
SoapException
and filling the Detail property. - In WCF by throwing a
FaultException<T>
. As far as the catching is concerned a good place to do this is a custom IErrorHandler that would provide the appropriate fault to the client.
Darin Dimitrov
2010-04-28 16:22:51
So, something like this?catch(Exception){throw new SoapException();}
mcass20
2010-04-28 16:28:52