啟動服務失敗:「Cannot have two operations in the same contract with the same name」。WCF 不支援同名多載,需透過 OperationContract(Name="...") 區分。
[ServiceContract(Namespace="https://www.cnblogs.com/frank_xl/")]
public interface IWCFService
{
[OperationContract(Name="SayHello1")] string SayHello();
[OperationContract(Name="SayHello2")] string SayHello(string name);
[OperationContract(Name="SayHello3")] string SayHello(string firstName, string lastName);
}
用戶端 Proxy 將生成對應不同名稱的方法。