WCF - Question around exception shielding and VAB

Topics: Exception Handling Application Block, Validation Application Block
Apr 9, 2008 at 3:41 PM
I am using the wcf extensions to the EHAB and VAB.

I would like to use the Exception Shielding feature of EHAB and also use the VAB to validate incoming requests. The behavior I want is for all exceptions to be shielded EXCEPT for validation errors. For validation errors, I would like a ValidationFault returned to the client containing the details as to why validation failed.

I can get ExceptionShielding and Validation to work independent of one another but when I enable both of them the validation faults end up being shielded as well.

Is it possible to use both ExceptionShielding attribute and the Validation behavior together and get the behavior I describe above? If so, could someone point me to an example?

Thanks
Jun 17, 2008 at 4:59 PM
Hi,

The workaround described in http://www.codeplex.com/entlib/Thread/View.aspx?ThreadId=25236 should help you. You can even tailor it to deal only with FaultException<ValidationFault>, although you will not be able to use the type chooser for it.

Fernando


bobschroeder wrote:
I am using the wcf extensions to the EHAB and VAB.

I would like to use the Exception Shielding feature of EHAB and also use the VAB to validate incoming requests. The behavior I want is for all exceptions to be shielded EXCEPT for validation errors. For validation errors, I would like a ValidationFault returned to the client containing the details as to why validation failed.

I can get ExceptionShielding and Validation to work independent of one another but when I enable both of them the validation faults end up being shielded as well.

Is it possible to use both ExceptionShielding attribute and the Validation behavior together and get the behavior I describe above? If so, could someone point me to an example?

Thanks