?
Solved

Method overloading in a web service

Posted on 2006-10-26
3
Medium Priority
?
244 Views
Last Modified: 2010-04-16
Is it possible to overload methods in a web service?  If so, how?  (I am familiar with method overloading in general).
0
Comment
Question by:tguillor
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
3 Comments
 
LVL 22

Accepted Solution

by:
_TAD_ earned 2000 total points
ID: 17813232

Yes, you can overload a method, but it requires a unique signature (MethodName) for the web service.

for example:

Suppose you want two functions:

[WebMethod (MessageName="GetData(int)")]
Public GetData(int i)
{

}

[WebMethod (MessageName="GetData(string)")]
Public GetData(string s)
{

}

0
 
LVL 22

Expert Comment

by:_TAD_
ID: 17813233

Yes, you can overload a method, but it requires a unique signature (MethodName) for the web service.

for example:

Suppose you want two functions:

[WebMethod (MessageName="GetData(int)")]
Public GetData(int i)
{

}

[WebMethod (MessageName="GetData(string)")]
Public GetData(string s)
{

}

0
 
LVL 22

Expert Comment

by:_TAD_
ID: 17813234

Yes, you can overload a method, but it requires a unique signature (MethodName) for the web service.

for example:

Suppose you want two functions:

[WebMethod (MessageName="GetData(int)")]
Public GetData(int i)
{

}

[WebMethod (MessageName="GetData(string)")]
Public GetData(string s)
{

}

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses
Course of the Month11 days, 13 hours left to enroll

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question