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!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.