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
0 answers

Catching WCF faults when hosting a service and a client in a single application

I am experimenting with a WCF service in a Visual Studio unit test. Both the client and the service are configured programmatically. Currently my code looks like this: using System; using System.ServiceModel; using…
JustAMartin
  • 13,165
  • 18
  • 99
  • 183
1
vote
1 answer

Fault Exceptions never being catched at client

I am trying to implement a FaultException in a WCF service. I referred various articles. However it seems that FaultExceptions are never being catched at client. I have written code like this, Service Contract - [ServiceContract] public…
VJOY
  • 3,752
  • 12
  • 57
  • 90
1
vote
1 answer

WCF catch custom FaultException

I Want to use custome FaultException like this [DataContract] public class Fault { [DataMember] public string Message { get; set; } } public class MyFault:FaultException where T : Fault { public MyFault(T faultClass) :…
kfir
  • 21
  • 3
1
vote
1 answer

strongly typed FaultExceptions not working

I’m trying to pass strongly typed FaultExceptions from a WCF service to a Silverlight client but all I'm getting is the generic "The remote server returned an error: NotFound." response, while using the same code to throw generic FaultExceptions…
1
vote
1 answer

System.ServiceModel.FaultException in System.dll

I am trying to consume a remote ASP.NET WebMethod using the Windows Phone SDK 7.1 I have the following C# Code: public static PublicServices.RegisteredServicesSoapClient taarafClient; App.taarafClient.FetchStreamCompleted += new…
Boudi Maatouk
  • 19
  • 1
  • 1
  • 2
0
votes
2 answers

MVC Application FaultException Thrown How to get to display Error page

I have mvc 3 application which when a Standard generic throw new Exception is thrown in code the error page from Views\Shared\error.cshtml is shown. This is done by simply setting . (This is As expected and as…
Somedeveloper
  • 817
  • 2
  • 14
  • 31
0
votes
1 answer

Specialised FaultException subclass or FaultException

I want my WCF service to be able to return some known faults. ie a defined FaultContract I'm a bit confused as to whether I should be deriving my own FaultException subclass, or creating a detail class and using FaultException. There…
GazTheDestroyer
  • 20,722
  • 9
  • 70
  • 103
0
votes
0 answers

Missing security headers in FaultException

I'm using a custom binding in my service and client which basically looks like this: public class UserNameWsTrustBinding : Binding { public override BindingElementCollection CreateBindingElements() { var coll = new…
Jan Köhler
  • 5,817
  • 5
  • 26
  • 35
0
votes
1 answer

How can I extract detail of the exception by giving the TDetail of the FaultException in .net?

The response of the SOAP request is the following xml output. SOAP-ENV:Client
0
votes
1 answer

Not able to catch FaultException in WCF client with WSDualHttpBinding

I have a WCF server with a custom UserNamePasswordValidator. public class CustomUserNameValidator : UserNamePasswordValidator { private readonly string m_userName; private readonly string m_password; /// /// …
christian
  • 3
  • 2
0
votes
1 answer

Soap Request FaultException.Detail is always empty

I am using a third party service & hence has no access to change anything from service side. I WSDL which I added as connect service. The problem is that I have enabled the raw request & I can see error details in trace or debug log. But When I try…
Khurram Ilyas
  • 117
  • 3
  • 19
0
votes
0 answers

Get Details out of Fault-Exception doesn't show full Details

I have a xml-file of the following format: soap:Receiver
T.Naz
  • 125
  • 8
0
votes
2 answers

How to use FaultException with details without specifying FaultContractAttribute

I'm well aware of how to use FaultException with details. I know I can declare details contract, then I need to decorate the method which is expected to throw this kind of exceptions with [FaultContract(type(DetailsContractType))] and then I do…
Alex
  • 655
  • 1
  • 8
  • 16
0
votes
0 answers

service is in a fault state exception only in one environment

I am using the same DLLs of various services that I used in one of the development environment to the Test. I ensured configs are same except for endpoint address where it is the servername in each case. I dont have any problem in Dev. However, in…
Jasmine
  • 5,186
  • 16
  • 62
  • 114
0
votes
1 answer

Cannot delete Product record after upgrading from Dynamics 365 CRM 8.1 to Dynamics 365 CRM 9

I have tried the following steps in CRM 9: Disabled all the plugins related to Product Entity Created a new Product without any Parent or Child product. Tried deleting the product. This step throws an error. The error I received was: SQL Server…
1 2 3
8 9