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 am consuming a WCF Service from a webpart in Sharepoint 2007. But its
I have a WCF web service using wsHttpBinding that I am consuming from a
I have a simple WCF service serving up notifications to and from an app.
I've created and tested WCF service, everything works fine. When I deployed to TEST
I have found 2 ways of consuming a WCF service without the help from
I'm having hard time consuming a secure WCF Web Service from a PHP site.
Here i am consuming a WCf service in MVC and retrieving values from that
I am consuming a WCF service from another company, and it is returning an
I asked about consuming a WCF service from RPG here and received this response:
Can anyone give me some information on consuming a WCF service from ILERPG? I

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.