Mutant
Mutant

Reputation: 3821

Webservice method overloading

I am able to overload the method in webservice, though on access it categorize both methods (same method with diff params) as different operations.

What is the advantage? Is there any way I can achieve calling same method from the client side and based on parameters it calls the one I need?

Upvotes: 1

Views: 1414

Answers (2)

rahulmohan
rahulmohan

Reputation: 1345

Operation Overloading is a concept available in Object Oriented programming languages. However, WebServices are not limited to OO platforms. They are message oriented, where the message can be constructed/deconstructed in any platform of your choice. Since all platforms do not provide operation overloading, and since web-services are meant for integration across platforms, it is illegal for web-services to support operation overloading.

Now, the reality is slightly different. I can see several articles online where developers have done such stuff. OASIS themselves had some confusion it seems, but they finally ruled against operation overloading (see section-3.6) .

Upvotes: 1

XtremeBytes
XtremeBytes

Reputation: 1497

There is no way of doing it, by rule Web Services should have Unique name. But .NET just provides an option to use the MessageName attributes for the overloaded methods.

Upvotes: 3

Related Questions