Questions tagged [faultexception]

A FaultException is the type of exception WCF services and clients use to communicate exceptions and optionally their details.

A FaultException is the type of exception WCF services and clients use to communicate exceptions and optionally their details. Quoting from the relevant MSDN documentation page:

In a service, use the FaultException class to create an untyped fault to return to the client for debugging purposes.

In a client, catch FaultException objects to handle unknown or generic faults, such as those returned by a service with the IncludeExceptionDetailInFaults property set to true. Because FaultException extends CommunicationException, remember to catch any FaultException objects prior to catching CommunicationException objects if you want to catch them separately.

125 questions
1
vote
1 answer

FaultException not thrown, or even any other Exception

WCF client consuming a SOAP service from third party (Java implementation). WSDL generated proxy via add service reference. 4.5 Framework. Message intercepted via AfterReceiveReply, which .ToString() is as follows :-
KevYou
  • 41
  • 5
1
vote
0 answers

An unsecured or incorrectly secured fault was received from the other party. c#

My service was working well, and suddenly It started occurred the following error: An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail. I am getting this error…
R.You
  • 565
  • 3
  • 15
1
vote
1 answer

WCF typed FaultException toString() not being used?

First off, I'm a student and new to WCF and C# in general. I'm trying to demonstrate the response returned to a client when a typed WCF FaultException occurs. I have a typed exception defined like so: [DataContract] public class CustomFault { …
Gary
  • 33
  • 4
1
vote
1 answer

Issue with FaultException`1' - Cannot specify child attributes in the columnset for Retrieve

I'm working on a C# application for merging duplicate Accounts in Dynamics CRM. In it I have checks on each of the fields that are part of the merge. It had been executing correctly, but then I ran into an instance where a lookup on the target…
1
vote
1 answer

Soap Fault Exception "The predefined Type does not exist"

I'm currently working on a task and I need to connect to a soap service and call a methode. But I always get the error: "The predefined type does not exist. Please choose a type manually" This is how the soap xml part looks like:
1
vote
1 answer

WCF FaultException is not caught in client, instead caught as service fault

I have service configured for FaultException but on the client end I am not getting the exception caught in catch (FaultException fe) { } instead it is always caught in catch (FaultException fx) { } I am using selfhost and…
user824910
  • 1,067
  • 6
  • 16
  • 38
1
vote
0 answers

WCF exceptions being ignored in WPF client

I have a WCF service library hosted in a Windows Service. I have spent all day testing numerous scenarios with much success. However, as the application is now, I have a problem with uncaught exceptions, my FaultException, simply…
ProfK
  • 49,207
  • 121
  • 399
  • 775
1
vote
1 answer

Why is my WCF FaultException unhandled?

I have a service based on the following contract (abridged): [ServiceContract] public interface ISchedulerService { [OperationContract] void Process(bool isForced); } The germane (IMHO) part of the implementation…
ProfK
  • 49,207
  • 121
  • 399
  • 775
1
vote
1 answer

wsHttpBinding, catch FaultException from custom UserNamePasswordValidator

I have a WCF service with wsHttpBinding. Everything works just fine, but I have got problem with catching faults on my client, sent from my custom Authenticator. I use custom Authenticator code from…
Tar
  • 11
  • 3
1
vote
3 answers

Handing unauthorized requests in WCF?

We have an WCF service, using webhttp binding. Users get authenticated, and then a method is called. In the method, we check a variety of settings associated with the user and some information specific to the request before knowing if the user is…
bpeikes
  • 3,495
  • 9
  • 42
  • 80
1
vote
1 answer

WCF FaultException IErrorHandler - Not returning to client and causing timeout exception

I am trying to implement IErrorHandler in the WCF services that uses iis and net.tcp. I set a scenario to throw DivideByZeroException in the server. IErrorHandler is firing as expected. The FaultException is not returning to client and I am getting…
teenboy
  • 368
  • 2
  • 12
1
vote
2 answers

Type cannot be ISerializable and have DataContractAttribute attribute

Im getting a Type 'WcfServiceLibrary1.GetDataErrorException' cannot be ISerializable and have DataContractAttribute attribute. When trying to add a custom exception in a WCF service. [ServiceContract] public interface IService1 { …
hub
  • 165
  • 3
  • 13
1
vote
0 answers

WCF Return different fault depending on RequestFormat

I have a WCF method: [WebInvoke(Method = "GET", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, UriTemplate = "exception")] public void GenerateException() I want to return a different fault based on the client (SOAP…
cjburkha
  • 111
  • 3
1
vote
1 answer

How to pass validation error From EntityFramework to WCF?

I've read many articles about it, and all seems to be very complex solutions. But I believe there should be an easy way to solve my problem. I've made the Entity Framework validation for my objects with Attributes which returns an Error Message from…
Misha Zaslavsky
  • 8,414
  • 11
  • 70
  • 116
1
vote
1 answer

serviceDebug includeExceptionDetailInFaults="true" - On live site

I am using a WCF service that sits under an ASP.NET website. I want to keep service debug / exeption details on when I go live as it is convenient for catching errors in the global.asax file without having to throw fault exceptions.
AJM
  • 32,054
  • 48
  • 155
  • 243
1 2 3
8 9