How can I catch exceptio开发者_运维问答ns in WPF when calling a WCF Service?
Basically you'll have three approaches:
- Rethrow
FaultExceptionon your regular try/catch - Mark your
OperationContractwithFaultContractattribute and translate your Exception to your custom Fault object, manually - To implement a
IErrorHandlerbehavior and let it handle WCF exceptions to you
This link can explain these options: Simplifying WCF: Using Exceptions as Faults
I think this has already been covered by this question on stack overflow. WPF Exceptions
Bob.
加载中,请稍侯......
精彩评论