Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6835615
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:15:13+00:00 2026-05-26T23:15:13+00:00

I’ve got a WCF service that’s using Enterprise Library for its Exception Handling and

  • 0

I’ve got a WCF service that’s using Enterprise Library for its Exception Handling and WCF Validation Integration. They don’t seem to work together.

What I want is:

  1. If my service throws any kind of exception, WCF Exception Shielding will catch this and throw out a FaultException<MyServiceFault>.
  2. If the incoming message fails the validation, the service should continue to throw out a FaultException<ValidationFault>.

However, I don’t know how to tell the Exception Shielding policy to let Validation exceptions through.

I have some Enterprise Library config that turns every exception into a FaultException<MyServiceFault>. If I get EnterpriseLibrary to log the exceptions it catches, it says it gets a

Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.WCF.FaultContractWrapperException

when validation fails. But if add this exception to the config as a new <exceptionType> with a postHandlingAction of None, I still get a FaultException<MyServiceFault> thrown out when validation fails.

Is it possible to use WCF Exception Shielding to catch every exception other than WCF Validation exceptions? If not, I’ll have to add tons more config for all the different exceptions that might be thrown – what is the point of exception shielding in this case?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T23:15:14+00:00Added an answer on May 26, 2026 at 11:15 pm

    Hmm, well although I thought I’d already tried this, the following configuration seems to do the job:

    <add name="WCF Exception Shielding">
        <exceptionTypes>
            <add name="FaultException`1" type="System.ServiceModel.FaultException`1[[Microsoft.Practices.EnterpriseLibrary.Validation.Integration.WCF.ValidationFault, Microsoft.Practices.EnterpriseLibrary.Validation.Integration.WCF, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]], System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
                postHandlingAction="NotifyRethrow" />
            <add name="All Exceptions" type="System.Exception, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
                postHandlingAction="ThrowNewException">
                <exceptionHandlers>
                    <add type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.WCF.FaultContractExceptionHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.WCF, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
                        faultContractType="MyServiceFault, MyServices"
                        name="Fault Contract Exception Handler" />
                </exceptionHandlers>
            </add>
        </exceptionTypes>
    </add>
    

    Any exception gets thrown inside the service code, it’s thrown out as a FaultException<MyServiceFault>, except if the WCF Validation Application Block throws an exception, then everything works as normal and the client receives a FaultException<ValidationFault>.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I've got a string that has curly quotes in it. I'd like to replace
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I am using Paperclip to handle profile photo uploads in my app. They upload
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a French site that I want to parse, but am running into
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
We're building an app, our first using Rails 3, and we're having to build
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
i got an object with contents of html markup in it, for example: string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.