Overloading Web Methods
It’s been a while since I got a chance to blog. Work and life was so busy to do anything other than those. Anyway, I’m back to my blogging habit and I hope to contribute the useful ones. To begin with,
How do you overload a web method?
You know you can leverage the OO concept with the web methods as well but once you try it out you’ll realize that it is not a straight forward ride. You have to tweak some of the header settings to let that happen. Here are the ones you have to tweak,
- WebServiceBinding
- MessageName
You have to make the WebServiceBinding conforms to WsiProfiles.None. And then you have to specify a Message Name so that you can distinguish between the overloaded methods in a descriptive way.
Here is an example,
[WebServiceBinding(ConformsTo = WsiProfiles.None)]
[WebMethod(MessageName = “Method1″, Description = “Description for Method1″)]
public string Method1(string input)
{ // implementation here }
[WebServiceBinding(ConformsTo = WsiProfiles.None)]
[WebMethod(MessageName = “Method2″, Description = “Description for Method2″)]
public string Method2(string input)
{ // implementation here }
tags: ASP.NET, Web Services, Web Service, .NET, WebMethod, WebServiceBinding, Web Method Overload
Written by askars. Read more great feeds at is source WEBSITE
no comments.
Read more articles on .NET Framework 2.0 and Code Samples and howto and ASP.NET.
- [+] Digg: Feature this article
- [+] Del.icio.us: Bookmark this article
- [+] Furl: Bookmark this article















