Solved

Method overloading in a web service

Posted on 2006-10-26
3
236 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 500 total points
Comment Utility

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_
Comment Utility

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_
Comment Utility

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

743 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now