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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T15:50:43+00:00 2026-05-19T15:50:43+00:00

I have a WCF service that throws an exception which I am trying to

  • 0

I have a WCF service that throws an exception which I am trying to catch unsucessfully in my silverlight client code. I am using Undeclared Faults for Debugging purposes and this is my service method :

[OperationContract]
public ServiceResponse MyWCFServiceMethod()
{
  ServiceResponse resp = new ServiceResponse ();
  //code for setting resp...

  //purposely throw error here.
  throw new FaultException(new FaultReason(new FaultReasonText("My fault Reason!")),new FaultCode("my fault code here"));
  return resp;
}

Now in my silverlight client view model, in the service’s callback method, I try to handle it like this:

private void MyServiceCallback(MyWCFServiceMethodCompletedEventArgs e)
{
   if (e.Error == null)
   {
       //proceed normally
   }
   else if (e.Error is FaultException)
   {
      FaultException<ExceptionDetail> fault = e.Error as FaultException<ExceptionDetail>;
      MessageBox.Show(fault.Detail.Message);
      MessageBox.Show(fault.Reason.ToString());
   }
} 

at this line else if (e.Error is FaultException) I still get System.Net.WebException {The remote server returned an error: NotFound.}

These are the config entries

<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />

This is the service class declaration

[ServiceContract(Namespace = "")]
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
public class MySilverlightWCFService
{
 ....

This service is in another project within the same silverlight solution.
Why is my silverlight client not able to get the fault exception I am throwing?

Thanks for your time…

  • 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-19T15:50:44+00:00Added an answer on May 19, 2026 at 3:50 pm

    The server is probably throwing a HTTP 500 response code that Silverlight is ignoring. You must change the service to return a HTTP code that Silverlight will accept.

    From Data Performance and Fault Strategies in Silverlight 3: (This article will show you how to return WCF faults to Silverlight.)

    Infamous NotFound Error:
    When the exception is raised, an HTTP
    status
    code of 500 is returned to
    Silverlight. The browser networking
    stack prevents Silverlight from
    reading responses with a status code
    of 500, so any SOAP fault information
    contained within is unavailable to the
    Silverlight client application. Even
    if the message could be retrieved,
    Silverlight 2 is not capable of
    converting the fault back into a
    managed exception. Both of these
    issues have been addressed in
    Silverlight 3.

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

Sidebar

Related Questions

I have a WCF service that is using a custom ServiceAuthorizationManager . The custom
I'm have a Silverlight 3 UI that access WCF services which in turn access
I have built a WCF Service that is being consumed by a Silverlight app.
I have a wcf service created that's being consumed by a silverlight application. We
I have a Silverlight application that communicates to a Silverlight-enabled WCF service, both of
I have a WCF service that I have to reference from a .net 2.0
I have a WCF Service that should not enter the faulted state. If there's
I have a WCF service that is hosted in a windows application. The service
I have a WCF Service that exposes a method GetCustomers(). The internals of the
I have a WCF service that I call from a windows service. The WCF

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.