Hi,
I am writing my first web service program, I am puzzled that I can't use
params while I have no problem in a console app.
[WebMethod]
public string Request(
params object[] elements
)
{
//code processing elements
}
The client (using Window application) code:
private void button1_Click(object sender, System.EventArgs e)
{
localhost.Service1 svc1 = new localhost.Service1();
svc1.Credentials = system.Net.CredentialCache.DefaultCredentials;
string response = svc1.Request("Type1", 22, "Request 1");
textBox1.Text = response;
}
I added web reference to the above web service, compile, here is the
error:
No overload for method 'Request' takes '3' arguments
This is completely legal in Console app (or Windows app). I am wondering
why this won't work for a web service?
I was trying to use this kind of interface to be able to extend the
support of different products while maintain the compatiblity of
existing ones. Any other suggestions besides using params?
Thanks!
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!