Questions tagged [faultcontract]
30 questions
16
votes
1 answer
client will not catch generic FaultException< T >, only FaultException
I've read all there is to read on this, but maybe I'm missing something (well, definitely I'm missing something otherwise it would be working already)
I'm throwing some exception error inside my server business layer:
public class RfcException : …

lurscher
- 25,930
- 29
- 122
- 185
15
votes
5 answers
Extracting detail from a WCF FaultException response
I am successfully working with a third party soap service. I have added a service reference to a soap web service which has auto generated the classes.
When an error occurs it returns a soap response like this:

John
- 29,788
- 18
- 89
- 130
14
votes
3 answers
WCF: Same Faultcontract on many methods
Take for example a project with 10 services and 20 methods on each service.
All services inherit from a base services which has a security check. The first thing each method does is to make a call to the security check. This throws a security…

Shiraz Bhaiji
- 64,065
- 34
- 143
- 252
8
votes
1 answer
Injecting WCF fault contract using Castle Dynamic Proxy Generation
I am currently working on WPF application with a WCF backend. We have implemented a client logging solution and a server logging solution for exception handling, and they work great, but it is often difficult to tie the information together over…

BernicusMaximus
- 250
- 2
- 13
5
votes
1 answer
WCF: Exception handling on OneWay OperationContract
I am having a WCF duplex service with Silverlight client and .NET 3.5 WCF service.
The scenario I have is: during the duplex push OneWay operation from server to client if an exception happens in client notification handler the channel gets silently…

Nikola Malovic
- 1,230
- 1
- 13
- 24
5
votes
4 answers
WCF : FaultContract(typeof(ExceptionDetail)) issue
I have put the attribute [FaultContract(typeof(ExceptionDetail))] for my operation contract. When I am trying to add the service to a client application, I get this error - "Custom tool error: Failed to generate code for the service reference…

user296598
- 51
- 1
- 2
3
votes
4 answers
Using custom FaultContract object containing System.Exception causes 'Add Service Reference' to fail
I just noticed something particular. I have an internal stock service which is published through basicHttpBinding, and a customBinding (http+binary) for which metadata is enabled. I also included a mex endpoint for http. We use Visual Studio 2008 &…

SpoBo
- 2,100
- 2
- 20
- 28
3
votes
2 answers
FaultException() exception thrown by the service is not caught by the client catch(FaultException)
Ok, I know I am missing something here. I have the following operation contract:
public double DivideByZero(int x, int y)
{
if (y == 0)
{
throw new FaultException
(new…

Ashish Gupta
- 14,869
- 20
- 75
- 134
2
votes
1 answer
Writing a data contract to the SOAP envelope headers for an outgoing FaultException?
I am in a bit of a pickle with a current project. We have an integration partner who is refusing to conform to contract, and they are expecting a fault contract with custom headers, rather than the WSDL-defined message contract that includes the…

jrista
- 32,447
- 15
- 90
- 130
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
0 answers
Enterprise Library exception block, System.Exception type handlers overide other exception types handler
I am using the Enterprise Library exception handling block.
I have the following issue:
I want to have a policy with two exception types (optimisticconcurencyexception and system.exceptions). For the optimisticconcurencyexception I add a fault…

Alex Maie
- 269
- 3
- 13
1
vote
2 answers
System.Exception.Data will not serialise on DataContract?
I have some WCF services using dataContracts and i wanted to I was hoping to pass a Exception with custom Dictionary< string , object > data in the Data property, but when i add any data on this array before throwing i get the following error in the…

lurscher
- 25,930
- 29
- 122
- 185
1
vote
1 answer
Return Exception message in JSON format
I am working on WCF application which is running fine in production. It has lots of service methods. Now there is requirement that if one of the field in config file is set to true then it must show some custom message to consumer.
I created…

Imad
- 7,126
- 12
- 55
- 112
1
vote
0 answers
wcf strongly typed FaultContract is not working within UserNamePasswordValidator
On server side:
public class Authenticator : UserNamePasswordValidator
{
public override void Validate(string userName, string password)
{
if (!AccessControlManager.ValidateUser(userName, password))
{
…

Tim
- 459
- 1
- 4
- 20
1
vote
2 answers
Why we need Fault Contracts in WCF
I have been getting my hands Dirty in WCF. Now one of the question which comes to my mind is regarding Fault Contracts in WCF.
I would like to know why we would be needing it. Consider a Sample Application where I am adding 2 Numbers.
So in the…

Naveen Kokcha
- 51
- 2