Overloaded methods are not supported by WCF service?

overloading, wcf

Solution

This is a limitation of WSDL. It does not support the same overloading concepts as C#/.NET, so that method names on services have to be unique. You have two option to resolve your problem.

First one is to use diffrent names for your methods. The other one is to set the Name property on one of your OperationContracts like so

[OperationContract(Name="GetUserById")]
UserAccount GetUser(Int32 id);

[OperationContract]
UserAccount GetUser(string username, string password);

Problem

i have two methods named as ``` [OperationContract] UserAccount GetUser(Int32 id); [OperationContract] UserAccount GetUser(string username, string password); ``` when i try to build them, they said you can not have same name methods in service ? Is it.

Original source

Related problems