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

Can't catch a FaultException from the client application correctly

I defined a WCF Service with FaultExceptions, but the client is not catching the exceptions properly. The contract for the exception is: [DataContract] public class ServiceFault { [DataMember] public string Operation { get; set; } …
Rafael
  • 2,413
  • 4
  • 32
  • 54
0
votes
1 answer

Handling WCF Faults for non-WCF clients

I have created a Wcf service. It will be access by both Wcf clients and non Wcf clients. I created my own class for the FaultException handling as below; [DataContract] public class ErrorResponse { [DataMember] public string ErrMsg…
neildt
  • 5,101
  • 10
  • 56
  • 107
0
votes
1 answer

web services catching custom java exception in c# client

I have a custom java exception called ClientAlreadyExistsException this exception is thrown by a signup method in java and I use Apache CXF to generate the web services. Now in my C# client when I call for the signup method I can't catch the…
waliminem
  • 3
  • 3
0
votes
1 answer

How client application comes to know that a particular wcf method throws faultexception or not?

I know a wcf method throws fault exception and client application catches that fault exception. But is there any way to know that whether that wcf method throws fault exception or not at client side ?
Shailesh Jaiswal
  • 3,606
  • 13
  • 73
  • 124
0
votes
2 answers

WCF Client Catching SoapException from asmx webservice

I have a WCF service that calls an asmx web service. That web service throws an enxception that looks like this: soap:Server
Gratzy
  • 9,164
  • 4
  • 30
  • 45
0
votes
1 answer

WCF Custom FaultException thrown but ProtocolException Recived by Client

I have a WCF service that is coded to throw a Custom FaultException under certain conditions. When hosted locally and on several servers this executes as excpected, Custom fault thrown by service custom fault caught by client, but on production and…
0
votes
1 answer

.NET 4.5 WCF Client Deal with bad Server?

I have a .net 4.5 client with a standard Service Reference to a remote Windows WCF service. Sometimes, when things go horribly wrong on the server, it will actually return HTML instead of the strongly-typed response my Service client expects. The…
Snowy
  • 5,942
  • 19
  • 65
  • 119
0
votes
1 answer

Unable to Catch the FaultException thrown by WCF Service in SilverLight client Application

I am Calling a WCF Service Method from my Silverlight Application. Wcf Service is returning a Fault Exception on Failure. I am able to throw the fault exception from my WCF Service. But it is not receiving to my Silverlight Application(.xaml.cs).…
Sudhakar Byna
  • 135
  • 1
  • 3
  • 15
0
votes
0 answers

Are FaultExceptions handled differently in .NET 4 than in .NET 4.5?

We are experiencing different behavior on our clients when handling FaultExceptions thrown by our WCF service depending on the version of .NET framework. The service defines a custom fault: [DataContract] public class MyFault { [DataMember] …
turbophi
  • 151
  • 2
  • 8
0
votes
2 answers

Self-Hosting WCF and System.ServiceModel.FaultException

I have a simple WCF Service Library Project (call this Project W) with a handful of DLLs in directory X. I set the startup directory of W to X, all methods work correctly using WcfServiceHost in Visual Studio 2010. I want to self-host W, so, I…
lingo_journey
  • 653
  • 1
  • 8
  • 22
0
votes
1 answer

FaultException error on webservice call

I created a webservice that returnes some categories from database. If i test with the client that WCF is offering everything is perfect. I started building a client. I added a service reference to my service…
sebastian.roibu
  • 2,579
  • 7
  • 37
  • 59
0
votes
1 answer

WCF SOAP Fault incorrect type

First of all, here is my setup: .Net 4.0 ASP.Net application WCF service, with basicHttpBinding (soap 1.1) The reference class was generated using svcutil, with the options /useSerializerForFaults; the WSDL defines all operations, and provides…
Borissov
  • 101
  • 1
  • 6
0
votes
2 answers

Custom Exception with WCF

hey i am using Oleg Sych's solution for handling exception via WCF: link everything works well with Known Exceptions (such as InvalidOperationException and SystemException) but when i am trying to use my own custom exception, it doesnt work and i…
Ori Price
  • 3,593
  • 2
  • 22
  • 37
0
votes
1 answer

How to specify only certain FaultExceptions to be Passed?

I have a WCF service and there is a CustomFaultException class inheriting from FaultException. I have set the below code: But it always returns the Exception with full stack trace details. How…
The Light
  • 26,341
  • 62
  • 176
  • 258
0
votes
2 answers

Throwing FaultException from WCF service methods

I am learning WCF, and currently focusing on the Faults chapter. As i understand, WCF handles FaultException exceptions a bit differently when thrown by a service. As such, it seems like a good idea that all exceptions that are thrown from a service…
lysergic-acid
  • 19,570
  • 21
  • 109
  • 218
1 2 3
8
9