Data table parameter in web services.

P

Prem Kumar

Hi

I understand .NET 2.0 says data table is xml serializable and serializable
in general. I am facing some issues in using data table as an input parameter
in web services.

I am able to create a web service having a data table as input parmeter in
one of the web method, it does list it in IE, when i browse the asmx file,
but somehow am not able to consume this in the client. When i am coding, the
method definition intellisense does not represent the argument as data table,
but as something else.

Can somebody help me out, by sending some samples which has data table as
input paramter in a web method ? / Give me ideas on how to go about this ?

Prem
 
V

Vijay Pandey

Check method deffinition in the proxy class that you generate. See what it
actually returns. If it is not a datatable, it should be an object. Try
converting it to a datatable. It shud work.

I have used dataset as parameter in webservices, there is no reason why
DataTable will not work.
 
F

francoisdt

Can I use this method of passing a data table as parameter to
make a generic web method and pass a list of parameters
with a data table instead of fixed in out parameters?

What I like to do.:
============
Write a software that will call web services dynamically
depends upon settings save upon database.


So the webservice call is not hard-coded but for example
I have a user interface that let a user pick and choose
which web service to use on a set of data.
Save the settings and then when user clicks on a button
the code in the button will read the "action'" that must be
taken upon the data from database and then the name of
web service and url and parms will be read from dynamically and
populated dynamically. So no web service is hard coded.


In such a way one can have a user interface displaying data
and when user clicks a button it will execute the webservice
'action'" that is linked to the button.


The code in the button will just read from database table which
webservice
to execute and this string as a generic procdure that will execute the
web wervice.
This way limitless webservices can be executed instead of hard coded
references and proxies that need to be recompiled
 
V

Vijay Pandey

Better you use xml document as parameter, you have to decide what are
different possible inputs and in what format they will be supplied.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,815
Latest member
treekmostly22

Latest Threads

Top