This error comes when i do method overloading in WCF in C#.Net. When i implement two method having same name in WCF I get an error "System.InvalidOperationException:Cannot have two operations in the same contract with the same name".
So to solve this error we have to implement these two method Using NAME paramerter like below.
[ServiceContract]
public interface IService1
{
[OperationContract(Name="ShowIntegerData")]
string DisplayData(int value);
[OperationContract(Name="ShowStringData")]
string DisplayData(string value);
}
So to solve this error we have to implement these two method Using NAME paramerter like below.
[ServiceContract]
public interface IService1
{
[OperationContract(Name="ShowIntegerData")]
string DisplayData(int value);
[OperationContract(Name="ShowStringData")]
string DisplayData(string value);
}