What are the advantages and disadvantages of having more WebMethods in a single Web Service?
What are the advantages and disadvantages of having more WebMethods in a single Web
Share
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.
If you add multiple web methods to a single web service class, they will all be supported through a single URL (which can make deployment and configuration much simpler). On the client side, when you create a web reference, it will create a separate class for each web service, and than separate methods within each class, one for each web method. So, as you can imagine, it’s easier to work with in the client code, as well, when you have a single class with multiple methods rather than multiple classes each containing only one method. That can become a nightmare for dependency injection (DI) (you are injecting your dependencies right? Hmmm?). So, the rule of thumb should be to try to group all the related methods together into a single web service and keep the number of web services as few as is reasonable.