473,385 Members | 2,013 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Problem in using params in web service

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!
Nov 16 '05 #1
0 1299

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Chris Mantoulidis | last post by:
PROBLEM: I'm having some weird problems with string::find() (in ParamGenerate()), but since I'm not sure if that is the source of all bad output in my program, I'm posting least code that's...
3
by: Chris Mantoulidis | last post by:
I posted this here one day ago but it seems like it hasn't been put up for some unknown reason. That gives me a chance to say things a bit better in this post. 1st of all let's desribe the...
3
by: Phil | last post by:
Hi, I have a client/server app. that uses a windows service for the server and asp.net web pages for the client side. My server class has 3 methods that Fill, Add a new record and Update a record....
11
by: Ceri Williams | last post by:
I followed the excellent MSDN article "Code Generation in the .NET Framework Using XML Schema" to build a substitute for the limited xsd.exe. My code works fine under .NET framework 1.1, but after...
0
by: Alan Chen | last post by:
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. public string Request( params object elements ) { //code...
2
by: Brian Blais | last post by:
Hello, I am trying to translate some Matlab/mex code to Python, for doing neural simulations. This application is definitely computing-time limited, and I need to optimize at least one inner...
0
by: Alexiel | last post by:
Hi, i have a problem, I have a Java Client and i call my webservice on ..NET. This run perfectly just except when i send parameters don't work fine. I send my code : This is my java...
2
by: FFMG | last post by:
Hi, I was looking at http://www.php.net/manual/en/function.call-user-func-array.php and I was wondering... Given, // -- function foo( &$params) {
3
by: paulus4605 | last post by:
dears since I'm new to ruby I try to create a form within ruby on rails. this is my controller require "player" class SpelersController < ApplicationController def index @speler =...
1
Canabeez
by: Canabeez | last post by:
Hi all, anyone has an idea why IE is not uploading file and FF does? I'm creating a FORM + IFRAME using DOM and trying to upload a file, now Firefox and Chrome do thins perfectly. I have...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.