Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 145
  • Last Modified:

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 !
0
davyberroho
Asked:
davyberroho
  • 2
  • 2
1 Solution
 
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
 
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:
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

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now