?
Solved

Method overloading in a web service

Posted on 2006-10-26
3
Medium Priority
?
247 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
  • 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses
Course of the Month15 days, 19 hours left to enroll

850 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