1、接口类中给操作方法定义别名:就是把 [OperationContract] 改成 [OperationContract(Name = "Method1")],这样服务类编译就不会报接口名称必须唯一的错了
2、在自动生成代码中找到 Method1 方法,在 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IBase/Method1", ReplyAction="http://tempuri.org/IBase/Method1Response")] 里面加上 Name="Method1" 标签,
变成:
[System.ServiceModel.OperationContractAttribute(Name="Method1",Action="http://tempuri.org/IBase/Method1", ReplyAction="http://tempuri.org/IBase/Method1Response")]
3、查找方法名 Method1替换成成可重载的方法名称,如要批量替换,可在方法名后加括号以区别标签内的相同内容。