views:

35

answers:

1

I have some WCF services with predefined FaultContract attributes. When the FaultException<TDetail> exceptions are thrown, they're sending StackTrace, Source and other potentially unsave information.

Is it possible to return only:

  • Detail (from the generic TDetail)
  • FaultMessage
  • FaultCode
  • (and possibly) FaultReason
A: 

Have you tried rolling your own fault exception using IErrorHandler? Also make sure in your app config file, the IncludeExceptionDetailInFaults attribute is set to false and, this might be helpful for best pratices.

Terrance
IncludeExceptionDetailInFaults is already false. As I understand it, IncludeExceptionDetailInFaults only applies to unhandled exceptions that are not already of type FaultException<TDetail>.I already implemented an IErrorHandler in order to enforce a policy that all operations have a base FaultContract assigned and that automatically logs and rethrows unhandled exceptions in that base fault type.What I don't know is why WCF is passing more information than is defined in the FaultContract. I'm currently experiencing this behavior with wsHttpBinding and a SOAP client.
reifnir