Questions tagged [faultcontract]
30 questions
1
vote
2 answers
Type cannot be ISerializable and have DataContractAttribute attribute
Im getting a Type 'WcfServiceLibrary1.GetDataErrorException' cannot be ISerializable and have DataContractAttribute attribute.
When trying to add a custom exception in a WCF service.
[ServiceContract]
public interface IService1 {
…

hub
- 165
- 3
- 13
1
vote
1 answer
svcutil fails against service with a fault contract
We have a WCF self hosted service which we have been developing for awhile. As part of our standard we have defined a FaultContract which we apply to operations.
Recently we needed to add a new ServiceContract so we did that and added a simple…

Shane Courtrille
- 13,960
- 22
- 76
- 113
1
vote
1 answer
svcutil.exe client proxy and fault contract
Is it possible to have fault contract information included in my svcutil.exe generated client c# proxy code?
I mean, if a web service method is marked with FaultContractAttribute, I want it's type argument to be mentioned in comments to client…

Sergey Savenko
- 666
- 6
- 11
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
How to Handle Blank Request Header with Rest API calls in WCF
One of my client is getting error message "The message with To 'http://XXXXXX/api/XXX/XXXX.svc/REST/Anonymous/XXXX/XXXX' cannot be processed at the receiver, due to an AddressFilter mismatch at the EndpointDispatcher. Check that the sender and…

user3030687
- 1
- 3
0
votes
2 answers
FaultContract with MessageContracts
I am using MessageContracts for my WCF services; I am grouping various DataContracts into a single MessageContracts. My base response is contains - isOperationSuccess (bool), exceptionMessage (Exception). If an error occurs at service level, I am…
0
votes
1 answer
WCF: FaultContracts and exception hierarchies
My system consists of two sites, communicating between themselves using WCF. Occasionally, exceptions are thrown when one site invokes operations on its peer, and I'm trying to decide what's the best way to use WCF's FaultContracts in such cases.
In…

telewin
- 1,102
- 8
- 17
0
votes
2 answers
Looking for advice on WCF Fault Contracts
I have a situation where I want to be able to distinguish between different types of errors within a web service. In an API this would usaully be a separate exception for each, does this mean I should have multiple fault contracts in WCF?
Is this…

Jamie
- 876
- 1
- 10
- 28
0
votes
0 answers
how to select FaultContractAtribute based on Name parameter
I have to implement interface that generates two different SystemFaults
Interface:
[ServiceContract]
public interface IErrorProvider
{
[OperationContract(Action = "getError")]
[FaultContractAttribute(typeof(string), Action = "getError", Name =…

Jarno Saarinen
- 1
- 1
0
votes
1 answer
WCF Soap Faults: How to get Fault code on cilent
I am just wondering if I can have an example of handling a Soap Fault on the cilent side and mainly how I can capture the Fault code?
This is what I have for my fault in the WCF side
Throw New FaultException(Of String)("Value to large", New…

user3428422
- 4,300
- 12
- 55
- 119
0
votes
0 answers
Client/Service binding mismatch after adding [FaultContract] to Interface
i created a WCF webservice in .net/c#. I also created a test client app. everything works fine.
Now i wanted to add a custom exception
[DataContract]
[Serializable]
public class MyException : Exception
{
public MyException(string message)
…

coconut
- 494
- 2
- 5
- 13
0
votes
1 answer
FaultContract - what does it means?
I should create wcf service that returns data about users, the interface and DataContract is below:
[ServiceContract]
public interface IUserInfoProvider{
[FaultContract]
public UserInfo GetUserInfo(Guid userId)}
[DataContract]
public…

sevine
- 36
- 6
0
votes
1 answer
WCF Service FaultContract Understanding
I have a WCF service and I have a FaultContract. I have a Reason in the FaultContract so I have something like this.
FltInfo.Reason = "This is a test";
throw new FaultException(FltInfo, new FaultReason(FltInfo.Reason));
Obviously, you…

user2887486
- 79
- 10
0
votes
1 answer
WCF autogenerate FaultContracts
We have many WCF services, we have not been using contract first. So now we have a lot of code that throws exceptions, that are not specified in the FaultContracts.
Other than manually inspecting the code. Is there a way to generate FaultContracts…

Shiraz Bhaiji
- 64,065
- 34
- 143
- 252
0
votes
1 answer
wcf fault exception not throwing/being caught properly
This is the exception I get:
An exception of type 'System.ServiceModel.FaultException`1' occurred in TestService.exe but was not handled in user code
I try to run my client and the debugger gets caught when I try to do the following
catch (Exception…

Price Jones
- 1,948
- 1
- 24
- 40