I'm writing a web service at the moment, with a custom behaviour for validating input messages against an XML schema. However, I don't understand how I can report any of those errors back to the client as SOAP faults.
I've extended the IClientMessageInspector and IDispatchMessageInspector 开发者_StackOverflowto intercept and validate the messages, and am catching validation errors in a validation event handler. The problem comes here: when I throw a new FaultException at this point, it goes unhandled and crashes; using both a code client and the WCF Test Client.
Any advice?
Thanks
You can use IErrorHandler to customize the response which is returned when an exception occurs.
精彩评论