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

  • Home
  • SEARCH
  • 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 403965
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T17:15:54+00:00 2026-05-12T17:15:54+00:00

I’m converting code from ASMX to WCF. In my ASMX web services I throw

  • 0

I’m converting code from ASMX to WCF. In my ASMX web services I throw back SOAP exceptions like:

if (ex.InnerException != null)
                {
                    SoapException se = new SoapException(ex.Message, SoapException.ServerFaultCode, Context.Request.Url.AbsoluteUri, ex.InnerException);
                    throw se;
                }

What kind of exceptions should I throw back to WCF clients calling my service? I am guessing the SOAP exceptin is the wrong kind, because the test client doesn’t see it as a valid error, and just says – internal error occurred in the web service.

  • 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-12T17:15:54+00:00Added an answer on May 12, 2026 at 5:15 pm

    Basically, in a WCF service, you’re best off when you only throw FaultException (or FaultException<T>).

    This is because of two things: since WCF is designed to be interoperable (your client could easily be a non-.NET app), you should not use .NET exceptions – those are too platform-specific. And two: if you use FaultExceptions (which are translated into SOAP faults), your channel (the connection between client and server) will not be torn down, or “faulted”. The WCF runtime on the server side treats all non-handled .NET exceptions as “severe” exceptions and thus puts the channel in a faulted state, assuming something really bad has happened.

    If your channel is faulted, you cannot use it anymore – you’ll have to close your client proxy and re-create it from scratch.

    If you want to (or have to) be very interoperable, you would define your SOAP faults are fault contracts (analogous to data contracts) in a separate file, and then you’d throw FaultException<T> where T would be one of your fault contracts. If you’re strictly .NET on either side, you can also stick .NET exceptions into FaultException as generic type T, if you want to – the channel won’t be faulted (e.g. you could throw a FaultException<InvalidOperationException> and thus signal back what went wrong).

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

Sidebar

Ask A Question

Stats

  • Questions 296k
  • Answers 296k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer If the whole reason for this objective is reading properties… May 13, 2026 at 7:01 pm
  • Editorial Team
    Editorial Team added an answer List<string> newStr = str.Split(new[] { Environment.NewLine }, StringSplitOptions.None).ToList(); This will… May 13, 2026 at 7:01 pm
  • Editorial Team
    Editorial Team added an answer I would give the "manager" person a real login in… May 13, 2026 at 7:01 pm

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I want use html5's new tag to play a wav file (currently only supported
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I've got a string that has curly quotes in it. I'd like to replace
In order to apply a triggered animation to all ToolTip s in my app,

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.