tags:

views:

73

answers:

1

I have a service where every operation can respond with the same custom fault type. I have this working fine by applying the FaultContract attribute to every operation like so:

[OperationContract]
[FaultContract(typeof(MyFault))]
public string Operation1();

[OperationContract]
[FaultContract(typeof(MyFault))]
public string Operation2();

etc, etc,...

From looking in Reflector, I can see that the FaultContractAttribute can only be applied to methods....so my question is:

Can fault contracts be declared at a higher level than operation (i.e. ServiceContract, Endpoint, Service)?

A: 

Sorry, this is an exact duplicate of this one:

http://stackoverflow.com/questions/1392556/wcf-same-faultcontract-on-many-methods

Please vote to close.

WayneC