uncategorized

Overloaded Methods as WCF OperationContracts

Interesting find today. It is possible to create a WCF Service Contract that has overloaded methods on it. The compiler doesn’t complain at all. You can even attribute both as [OperationContract] and the compiler still won’t complain. If you go to use that Service Contract though, it will blow up and thrown an error about duplicate naming. While this is frustrating you can get around it. Options include, changing the name of one of the Operation Contracts or setting the name parameter on the Operation Contract attribute (i.e. [OperationContract(Name=”SomeUniqueName”)]).