I have five separate services where each one corresponds to a different database table such as Product, User, Orders etc.
I am trying to send my custom exceptions across WCF. I have browsed the internet and i have wrapped my custom exceptions inside a fault exception:
interface
[FaultContract(typeof(NoSuchInstanceException))]
cs
throw new FaultException<NoSuchInstanceException>(e, new FaultReason(e.Message), newFaultCode("UserFault"));
The problem is when i update the service the client proxy disappears. I browsed the internet and found the following solution which says to add a mapping to the service reference SVCMAP file. http://travisspencer.com/blog/2007/11/
<NamespaceMapping
TargetNamespace="http://schemas.datacontract.org/2004/07/MyCompany.MyProject.Exceptions" ClrNamespace="MyCompany.MyProject.Exceptions" />
</NamespaceMappings>
My problem is that every service needs the custom exceptions adding to the mapping but when i do this. An error is displayed saying the exception is already defined in one of the other services. Do i merge the services into one service? Any help is really appreciated. Thanks
I can think of two options: