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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T09:10:13+00:00 2026-05-18T09:10:13+00:00

I am consuming a WCF service from a WP7 app. Both are in a

  • 0

I am consuming a WCF service from a WP7 app. Both are in a single VS solution. Everything worked fine until I tried to pass back a FaultException.

When throwing the FaultException from my WCF service, I receive the message “An unhandled exception of type ‘System.ServiceModel.FaultException`1’ occurred in System.ServiceModel.dll” on the EndInvoke in my proxy. If I hit continue, the exception does not bubble up. My handler code is never hit.

I believe I have everything wired up properly. I’ve seen plenty of examples, as I’ve spent an entire day scouring the web for help with this issue. If I stop throwing the FaultException, my application works fine.

In the VS Debug > Exceptions dialog, I have tried disabling FaultException and FaultException’1 under CLR/System.ServiceModel. I have also tried going to Tools > Options, Debuggung > General and turning off “Enable the exception assistant” and “Enable Just My Code (Managed only). None of these has enabled the exception to bubble up to my calling method in the app.

Interface code —

[OperationContract]
[FaultContract(typeof(NotAuthorizedException))]
List<MyResult> GetValues(DateTime beginDate, DateTime endDate);

Exception type —

[DataContract]
public class NotAuthorizedException
{
    [DataMember]
    public string Message { get; set; }
}

Server code to throw exception —

throw new FaultException<NotAuthorizedException>(
    new NotAuthorizedException(),
    new FaultReason("Not authorized."),
    new FaultCode("Sender"));

Client call to WCF service —

try
{
    MyServiceClient myService = new MyServiceClient();
    myService.GetValuesCompleted += new EventHandler<GetValuesCompletedEventArgs>(myService_GetValuesCompleted);

    myService.GetValuesAsync(DateTime.Now, DateTime.Now.AddMonths(6));
}
catch (FaultException<NotAuthorizedException>)
{
    //handle error here
}

Where it breaks (in Reference.cs) —

System.Collections.ObjectModel.ObservableCollection<Namespace.MyService.MyResult> _result = ((System.Collections.ObjectModel.ObservableCollection<Namespace.MyService.MyResult>)(base.EndInvoke("GetValues", _args, result)));

The proxy code is the unaltered code generated from “Add Service Reference” menu item.

It has to be something simple, but I’m just not seeing it!

  • 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-18T09:10:14+00:00Added an answer on May 18, 2026 at 9:10 am

    I believe you should catch the FaultException<NotAuthorizedException>
    at myService_GetValuesCompleted instead of where you are doing it now

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

Sidebar

Related Questions

I have a Silverlight 2 application that is consuming a WCF service. As such,
I'm consuming a third-party resource (a .dll) in a web service, and my problem
I'm consuming a webservice from my application in C# .net (2.0) that return values
I have developed a WCF Service Application hosted in IIS 7.5 targeting .NET 3.5
I'm using WCF to communicate to a 3rd party REST/JSON service. Since it's WCF,
I´m developing a very memory-consuming app and want to use the largeHeap-Tag, which should
I am consuming the Twitter API and want to convert all URLs to hyperlinks.
Developing websites are time-consuming. To improve productivity, I would code a prototype to show
I'm consuming a third party .NET WebService in my client application. For debugging purposes
Note: I am just consuming webservice I have no control over webservice code. So

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.