[Webinar] Learn how to a build a cloud-first strategyRegister Now


How to pass an arraylist filled with a list of objects to a web service and retrive the arraylist back from the client side

Posted on 2008-11-12
Medium Priority
Last Modified: 2012-05-05
Dear Experts,

I created two applications web application (ASP.NET 2.0) and web service. I want to fill an arraylist with a list of objects (Customer Class) then a want to pass it to the web service. In the web service I want to process the list of objects and returned them to the web application as an arraylist of objects also.

I tried to do it many time but unfortunately every time I end up with failure.

Please how can I accomplish such behavior?

Thank you  
Question by:Samijf
LVL 16

Expert Comment

by:Gyanendra Singh
ID: 22947872
You cannot actually pass an actual ArrayList or other .NET object to a web service.
Web Services communicate via XML that is described by XML Schema which is referred to by a WSDL file.  None of these things is capable of describing an ArrayList or any other .NET type.
Web Services are meant to be platform-neutral. How would another platform be able to interpret an ArrayList if it were actually sent?

Refer this link if you want to pass collection

but dont forget to add serilized attribute in your class

Accepted Solution

Samijf earned 0 total points
ID: 22996559
Thank you for your response.

Is there is any sample by VB.Net and please I want know how to pass a custom collection as parameter to the web service and also how to receive it back in the consumer client if passable.

Because my scenario is as follow

I need to pass a list of custom objects to the web service which I can include in the custom collection as the solution explained in the link provided (C# sample) then I want to process them there and return them back to consumer client as a custom collection.

Thank again.

Featured Post

NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question