I have found tons of articles that tell you how to overload a Web Service but none that tell you how to call it.
You can do something like this:
This example is used all over the place but if you try to call the 2nd method I get an error on compile. In a project that is in the same solution.
The service compiles fine and when you run it you will see 2 services with the MessageName listed below.
How do you get this to work and how do you call it?
Thanks,
Tom
You can do something like this:
Code:
namespace TestOverloadingWebService
{
[WebService(Namespace = "[URL unfurl="true"]http://tempuri.org/")[/URL]]
public class OverloadingInWebService : System.Web.Services.WebService
{
[WebMethod(MessageName = "AddInt", EnableSession = true)]
public int Add(int a, int b)
{
return (a + b);
}
[WebMethod(MessageName = "AddFloat", EnableSession = true)]
public float Add(float a, float b)
{
return (a + b);
}
}
}
This example is used all over the place but if you try to call the 2nd method I get an error on compile. In a project that is in the same solution.
The service compiles fine and when you run it you will see 2 services with the MessageName listed below.
How do you get this to work and how do you call it?
Thanks,
Tom