How using overloaded functions in webservices???

Hello,


I'm trying to create a webservice who has 2 overloaded functions. When I'm trying to execute it, I receive an error. Overloaded functions are aparantely not supported...

Can someone, please, tell me how I've to solve this overloading problem?

Example :

<WebMethod()> _
Public Function A (Byref param1 as string) as boolean
....
End Function

<WebMethod()> _
Public Function A (Byref param1 as string, Byref param2 as string) as boolean
....
End Function




Thanks !
davyberrohoAsked:
Who is Participating?
 
RealMrTeaCommented:
It is do-able...  Please read the following article.  You must add the MessageName property to your WebMethod attribute.  Nothing that complicated...it is shown in detail in this article.

http://dotnetjunkies.com/WebLog/mahalax/archive/2004/10/13/28425.aspx

The following is the Microsoft take on it:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbtskUsingWebMethodAttribute.asp

Good Luck,
Eric
0
 
Bob LearnedCommented:
That is correct, AFAIK, that overloaded methods are not supported in WebServices.  The proxy generator needs to create function signatures in the references module, and apparently is confused by overloading.

Also, if you don't need to receive a reference back from the method, I would define the methods like this instead (using ByVal parameters):

Public Function A (ByVal param1 as string) as boolean
....
End Function

Otherwise, there is some overhead to return a ByRef value that is unnecessary.

Bob
0
 
Bob LearnedCommented:
I love to learn new things, and to be proven wrong :))

Bob
0
 
davyberrohoAuthor Commented:
Nobody is perfect Bob :o).

0
 
RealMrTeaCommented:
From TheLearnedOne I will take that as a compliment that I could teach you something.

Later,
Eric
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.