Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Returning ArrayList from WebServices

Reply
Thread Tools

Returning ArrayList from WebServices

 
 
Ashish Saxena via .NET 247
Guest
Posts: n/a
 
      04-08-2005
Hi all

public System.Data.DataSet GetDataSetParam(string sProcName,ArrayList aParameterName, ArrayList aParameterValue)
{

when i m calling from my windows application then its givin me error that
collection.arraylist can not be converted to object..but i m writting same peice of code in my windows function its working fine.


please suggest me the way how to pass & return the arraylist ..

Thx & regards,


From: Ashish Saxena

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>Nw41ck19Xk2bRmyHQ3STPA==</Id>
 
Reply With Quote
 
 
 
 
Brock Allen
Guest
Posts: n/a
 
      04-08-2005
Return an array instead. ArrayList is a class in .NET that has no meaning
to your interop client (java, perl, C++, VB6).

-Brock
DevelopMentor
http://staff.develop.com/ballen



> Hi all
>
> public System.Data.DataSet GetDataSetParam(string sProcName,ArrayList
> aParameterName, ArrayList aParameterValue)
> {
> when i m calling from my windows application then its givin me error
> that collection.arraylist can not be converted to object..but i m
> writting same peice of code in my windows function its working fine.
>
> please suggest me the way how to pass & return the arraylist ..
>
> Thx & regards,
>
> From: Ashish Saxena
>
> -----------------------
> Posted by a user from .NET 247 (http://www.dotnet247.com/)
> <Id>Nw41ck19Xk2bRmyHQ3STPA==</Id>
>




 
Reply With Quote
 
 
 
 
Krishna
Guest
Posts: n/a
 
      04-11-2005

You could use CollectionBase for passing strongly typed
collections from web services. The proxy class then
converts this to an array.

public class Apples : System.Collections.CollectionBase
{
public void Add(Apple apple)
{
this.InnerList.Add(apple);
}

public Apple this[int index]
{
get { return (Apple ) this.InnerList
[index]; }
set { this.InnerList[index] = value; }
}
}

public class Apple
{
public string countryoforigin;
public string colour;
}


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Does the clone() method of ArrayList<> make a copy of the objects in the ArrayList? xz Java 16 08-04-2007 10:33 PM
problems returning ArrayList from webServices Mario Rodriguez ASP .Net Web Services 5 04-15-2004 05:20 AM
a class inherited from ArrayList, is saved to ViewState, why the type of the object read from ViewSate is not the class, but the parent, ArrayList leal ting ASP .Net 1 02-10-2004 07:45 PM
writeObject with ArrayList of ArrayList? Kaidi Java 4 01-03-2004 08:16 PM
Iterate through ArrayList using an another ArrayList Saravanan Rathinavelu ASP .Net 3 08-19-2003 07:03 AM



Advertisments