Methods with the same name in different endpoints
I have read here that it is not a开发者_开发知识库 good idea to overload methods in WCF. However, if I am going to provide two different endpoints, and thus two different interfaces, is it okay to have their methods named just the same?
Thank you very much!
That's not a problem. The main issue with methods with the same name in the same interface is that WSDL doesn't support that; you can still do it in WCF by changing the Name property of the operation contract (as suggested in the link you mentioned), but people usually just define different method names.
If the methods are in different interfaces, even if both are implemented by the same service, that's not an issue because when you create a proxy for the service (using Add Service Reference or svcutil) you'll get one client class per contract.
精彩评论