I am fairly new to WCF and have created a few services, so I have some experience with WCF. I want to create multiple services that can use a single FaultContract. I have noticed that the Fault type needs to be in the same project to make use of the [DataContract] and member attributes. Is this true or is there something I can do to add the contracts? Here is what I would like to do:
NameSpace Service1{
[ServiceContract()]
iService1Interface1{
[OperationContract()]
[FaultContract(typeOf(ServiceFault.Fault)]
DoTheWork1();
}
}
NameSpace Service2{
[ServiceContract()]
iService1Interface2{
[OperationContract()]
[FaultContract(typeOf(ServiceFaults.Fault)]
DoTheWork2();
}
}
NameSpace ServiceFaults{
[DataContract]
public class Fault{
public Fault(message){
//build a message
}
[DataMember]
public Message{}
}
}
Does this make sense? Thanks
Daniel