Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > Other .NET > .NET Web Services
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
.NET Web Services Discussions about .NET XML Web Service technologies including ASMX files, WSDL and SOAP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET Web Services section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 17th, 2003, 08:23 PM
Registered User
 
Join Date: Jun 2003
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Return Collection object from a Web Method

I would like to return a custom collection object from a web method.
I created my custom collection by inheriting CollectionBase and implementing strongly typed

Item, Add, Remove, Count, etc methods/properties. But when the result is serialized to XML

the collection is converted to a generic Array, which is not what I want.

Does anyone know how to return an actual custom collection from a Web Method?
Could you provide some sample code?

PS: I would prefer not to use a DataSet for this.
Reply With Quote
  #2 (permalink)  
Old June 23rd, 2003, 10:12 PM
Registered User
 
Join Date: Jun 2003
Location: Kolkata, W.B., India.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to firdausnasar
Default

You can very well use a class collection to be returned from the Web Method. All you need to do is to define a similar class at the Web Service Consumer application. Then you assign the returned class collection from the webservice to the Consumer Side instance of a similar class.

Best of Luck...
Reply With Quote
  #3 (permalink)  
Old June 17th, 2006, 07:42 AM
Registered User
 
Join Date: Jun 2006
Location: Bangalore, Karnataka, India.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to syedAhamed Send a message via Yahoo to syedAhamed
Default

Thank you for your suggestion firdausnasar,

But I would have tried that also, but still its returning as generic array.

Any other suggestion



Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
return collection by function in class jimusa Visual Basic 2005 Basics 1 July 30th, 2008 03:18 PM
function return collection in class by VB jimusa Visual Studio 2005 1 July 30th, 2008 03:12 PM
Return OleDb.OleDbConnection from the WEB method? Dmitriy Pro VB 6 2 May 4th, 2004 07:10 AM
Return DataTable from Web Method Function kasie ASP.NET 1.0 and 1.1 Basics 2 February 11th, 2004 06:23 AM
Object as parameter in a web service method evandro.paula .NET Web Services 3 October 14th, 2003 02:20 PM



All times are GMT -4. The time now is 09:14 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.