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 8084553
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T17:50:08+00:00 2026-06-05T17:50:08+00:00

I have written a WCF REST API for third-party use. One of the things

  • 0

I have written a WCF REST API for third-party use. One of the things I want to do is to return custom error responses to clients if anything goes wrong. I don’t want the WCF default error page showing that internal server error has occurred or method name not found.

To do so I throw WebFaultException<Error> where necessary. This return the following type of response to the client:

<Error>
  <type>MissingTag</type>
  <Desc>Tag 349 is missing</Desc>
</Error>

But how can I handle if any other type of error occurs like a serialization error or the “Method not found” error or place where I want to check that POST, PUT and PATCH have http header content-type present. I want to throw WebFaultException<> there too. I tried looking into IErrorHandler but could not get it working.

Any one got ideas on how to implement this type of thing. Also can I have a simple code demonstrating the IErrorHandler usage?

  • 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-06-05T17:50:10+00:00Added an answer on June 5, 2026 at 5:50 pm

    You can look into Message Inspectors BeforeSendReply for customizing the reply that needs to be sent to the client

    If the content-type is not set when the request is made you can look into the AfterReceiveRequest where in you can customise the request received and then action as needed.

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

Sidebar

Related Questions

I have written a simple REST API in WCF, and the authentication mechanism uses
Here is my situation. I have written a WCF service which calls into one
I have written a WCF service (I am a newb) that I want to
I have written a WCF service with the REST template that has the defaultOutgoingResponseFormat
I want to call a rest service written in WCF (which can support both
i have written a stand alone WCF REST service in 4.0 under Studio 2010
I have written a REST Service in WCF in which I have created a
hi friends I have been working WCF since past one week. I have written
I have a WCF service method which I have written for return type as
I have written a REST service with windows azure using the WCF Rest Service

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.