Solved

Method overloading in a web service

Posted on 2006-10-26
3
241 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 500 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

740 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