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
2
votes
1 answer

Losing WCF FaultException details when using binary

I have a WCF service with the following custom binding: (The client has of course configuration…
Vagif Abilov
  • 9,835
  • 8
  • 55
  • 100
2
votes
1 answer

wcf exceptions without showing a stacktrace

I need to throw from wcf exceptions without showing a stacktrace to a client, just message... throw new FaultException("ex1"); I have in average 20 exceptions strings. How do I implement it without throwing each time FaultException with string…
YAKOVM
  • 9,805
  • 31
  • 116
  • 217
2
votes
1 answer

How to handle a FaultException in WCF without aborting the whole transaction?

I have a WCF service being called as part of a transaction. If the service is called twice (often happening during debugging) I want a FaultException to be thrown by the service but the overall transaction must succeed. throw new…
Simon_Weaver
  • 140,023
  • 84
  • 646
  • 689
2
votes
0 answers

WCF service-client fault exception understanding

I have WCF Service-client, On Service side, If unhandled exception is thrown, the channel will get faulted, After channel is faulted i have to recreate the client side. When i create the client i use ChannelFactory, so i need to .Abort the current…
ilansch
  • 4,784
  • 7
  • 47
  • 96
2
votes
3 answers

WSE012: The input was not a valid SOAP message because the following information is missing: action

We're trying to access a webservice (which I believe is also coded using WCF, but I have no control over it whatsoever) and I get an exception: System.ServiceModel.FaultException: WSE012: The input was not a valid SOAP message because the…
Owen Blacker
  • 4,117
  • 2
  • 33
  • 70
2
votes
2 answers

Creating generic WCF Fault Exception within Message Inspector, will not be caught

When creating a generic fault exception FaultException and passing it back to the message inspector pipeline as a MessageFault, the client will not receive the generic fault in its catch…
Microsoft Developer
  • 1,919
  • 1
  • 20
  • 27
2
votes
2 answers

Exception handling with WCF plus Business Logic Layer scenario

My services simply call BusinessLogicLayer methods where entire business logic is put. I want to know what's the best practice for handling exceptions raised by BL?(not only fatal exceptions, also "logic" ApplicationExceptions like…
Lev
  • 3,719
  • 6
  • 41
  • 56
1
vote
1 answer

How to Return DTO Nicely Without Closing Connection in WCF

My WCF Service in C# looks like this. [ServiceContract] public class MySecretService { [OperationContract] [FaultContract(typeof(ErrorMessage))] public MyDTO ReturnMyDTOMethod(int id, out string errorMessage) { try …
joedotnot
  • 4,810
  • 8
  • 59
  • 91
1
vote
2 answers

Handling WCF Faults

I am working on a client that is consuming a WCF service. In various cases, the service simply raises a FaultException with an associated message informing of the reason behind the given fault. Some of these faults are things that can be handled by…
Mr Moose
  • 5,946
  • 7
  • 34
  • 69
1
vote
1 answer

Mass Transit :: IConsumer> not able to consume the fault message and additional new Fault Topic is created

I'm new to Masstransit and I have taken up a small test case to create pub /Sub with AWS SQS and in case of any exception consume the fault and perform the recoverable action . Registration and Receive End point configuration public void…
1
vote
2 answers

Why do WCF Fault Exceptions not retain their details after crossing two boundaries?

When a fault exception is thrown across a boundary, it can take a type parameter, to pass a detail object across the WCF boundary. However, I have noticed that when a fault exception crosses two boundaries (either because it is rethrown, or because…
McKay
  • 12,334
  • 7
  • 53
  • 76
1
vote
1 answer

Custom fault exception causing a wcf timeout on the client

I followed the same example on how to create a custom fault exception (by creating an Exception class and referencing it in the FaultContract), however every time I try to throw the exception from the server, I receive a connection timeout from the…
Elio
  • 463
  • 6
  • 18
1
vote
2 answers

WCF: SOAP Fault or normal Exception(s) in DataContract class

The main parameter to my Service's OperationContract is a class called Preapproval. In the Preapproval class, there are a few public getters/setters for the DataMember attributes. I have code that validates the input to the setters, such that I…
Pittsburgh DBA
  • 6,672
  • 2
  • 39
  • 68
1
vote
1 answer

WCF FaultContract Fails with NamedPipe

I have a simple IPC mechanism that uses WCF and named pipes. My goal is to propagate exception details (including the stacktrace) to the client for logging purposes (the rest of the application logging is located on the client). If I use the…
Travis
  • 2,654
  • 4
  • 26
  • 46
1
vote
1 answer

Not able to get Exception message from SOAP call using service reference .net

I am using service reference in .NET to call a third party carrier API i.e. ESTES. you can find the wsdl here. now whenever I call it from the code and there are some errors it just throws a FaultException and exception message as GeneralErrorMsg or…
1 2 3
8 9