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
4
votes
2 answers

FaultException and custom exception WCF

I have a question on how to send a custom exception as FaultException. It works when I use a system Exception like ArgumentException, but if I change it to my custom exception "TestException" it fails. I can’t get the configuration for the service…
faultEx
  • 43
  • 1
  • 5
4
votes
2 answers

WCF FaultException

When building a WCF service, if I don't include my contract for the FaultException in the service, I'm able to create a WCF service reference on the client with all of the members included in the Reference.cs file. If I include my FaultException…
sagesky36
  • 4,542
  • 19
  • 82
  • 130
4
votes
2 answers

C# calls java web service: cannot catch FaultException

I'm developing a WCF application, and one of my services needs to consume a 3rd party web service developed in Java. The 3rd party service is provided by government and it's almost impossible to reach its code / ask for change. I added it as a…
saygley
  • 430
  • 7
  • 12
4
votes
3 answers

Should I just ignore a first chance exception in WCF?

Running a WCF service inside Visual Studio, I see a load of exceptions in the Debug output. A first chance exception of type 'System.ServiceModel.FaultException' occurred in System.ServiceModel.dll A first chance exception of type…
Benjol
  • 63,995
  • 54
  • 186
  • 268
4
votes
2 answers

wcf FaultException Reason

For the following exception no Reason is specified in the exception window (->view details): System.ServiceModel.FaultException The creator of this fault did not specify a Reason. How can I change it to show the reason? (I need 1234 to be shown…
YAKOVM
  • 9,805
  • 31
  • 116
  • 217
4
votes
2 answers

Catching a Specific WCF FaultException

A single tier application can distinguish exceptions by: Exception ex; if (ex is System.DirectoryServices.AccountManagement.PasswordException) ... where ex is just a generic exception. When you move to WCF for multi-tier, you lose all this…
rbrayb
  • 46,440
  • 34
  • 114
  • 174
3
votes
2 answers

FaultException<> Detail returns null

I am having some trouble getting back the Detail from a custom Fault Exception within a C# program. When I execute the same call in Postman, I get the response fine, but when trying to do the same thing in c#, the detail all returns null. My code…
SilentUK
  • 151
  • 3
  • 13
3
votes
3 answers

silverlight client doesnt understand faultexception

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…
user20358
  • 14,182
  • 36
  • 114
  • 186
3
votes
0 answers

How to get a WCF ClientBase in a faulted state?

As I remember correctly, in .NET Framework 3.x, a WCF service client (ClientBase) would get a faulted state when the service returned an exception (FaultException). This could result in problems when the service client was not disposed / closed…
Martin Mulder
  • 12,642
  • 3
  • 25
  • 54
3
votes
1 answer

Rethrowing strongly-typed WCF FaultException in a middle-layer service

I have a very simple 3-tier project. There is a DAL (data access layer) WCF service interacting with a data store; a BLL (business logic layer) WCF service as an intermediary between the DAL service and a client UI, and a Windows Forms client layer.…
Matt Zamec
  • 73
  • 6
3
votes
1 answer

FaultedException on WCF when message size is large

I have a WCF service and an simple aspx page that gets the message from one console application and sends it to the another console application. When the message(xml formatted) length is around 6000000, it works fine, however when the message size…
osberk
  • 31
  • 2
3
votes
1 answer

WCF FaultException fails if an inner exception is specified for the ApplicationException

I have been debugging an issue with my newly minted WCF services Fault contract and finally found out what was breaking it. I defined the service like so: [ServiceContract] public interface IService1 { [OperationContract] …
deltanine
  • 1,166
  • 1
  • 13
  • 25
3
votes
1 answer

.net client parse a soap fault as a protocol exception

Can anyone explain me why the soap response below is not deserialized into a FaultException in my C# client? I get a System.ServiceModel.ProtocolException with message "The remote server returned an unexpected response: (400) Bad Request", with a…
Frode
  • 336
  • 4
  • 15
3
votes
1 answer

FaultException handling in client?

I'm trying to implement exception handling in a WCF service. I want this exception to be thrown to the client so it can be logged and handled. I don't know if the code I've written is right or wrong. This only gets me "faultexception was unhandled…
J.Olsson
  • 815
  • 3
  • 13
  • 29
3
votes
4 answers

WCF Unhandled FaultException was not handled by usercode

i'm trying to use a WCF Plain service with Telerik OpenAccess in VS 2012 with .net 4.5. I tried the telerik developers manual and created the service and a client. In the service interface IEntitiesModel I put…
Offler
  • 1,223
  • 1
  • 12
  • 34
1
2
3
8 9