473,973 Members | 1,807 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to return collection from webservcie

I have a custom collection (Dervided from CollectionBase) and it works pretty
well when I consume it from C# console app.But it is not working if I return
the collection from a web service.The IE complains about( You must implement
a default accessor as it inherits from ICollection).
I want to now what are the methods need to be implemented for that
collection.Any help with sample code is highly appreciated.
Thanks

Jun 1 '06 #1
2 1071
Implement IList -- that has the method "Add(object )".

The de-serializer looks for the method.
--
Happy Hacking,
Gaurav Vaish
http://www.mastergaurav.org
http://webservices.edujini.in
-------------------
"Ghanashyam " <Gh********@dis cussions.micros oft.com> wrote in message
news:4E******** *************** ***********@mic rosoft.com...
I have a custom collection (Dervided from CollectionBase) and it works
pretty
well when I consume it from C# console app.But it is not working if I
return
the collection from a web service.The IE complains about( You must
implement
a default accessor as it inherits from ICollection).
I want to now what are the methods need to be implemented for that
collection.Any help with sample code is highly appreciated.
Thanks

Jun 1 '06 #2
Hi, I had same problem, when I tried to return my custom serilized collection
from Web Service.
It was solved then I implemented IList interface, and exactly "this[int]
indexer".
I think this indexer is it - default accessor.
"Ghanashyam " wrote:
I have a custom collection (Dervided from CollectionBase) and it works pretty
well when I consume it from C# console app.But it is not working if I return
the collection from a web service.The IE complains about( You must implement
a default accessor as it inherits from ICollection).
I want to now what are the methods need to be implemented for that
collection.Any help with sample code is highly appreciated.
Thanks

Jun 4 '06 #3

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

Similar topics

3
5885
by: Eric the half a Bee | last post by:
Hello I am trying to implement a search function within a collection of Employees. I am searching for a specific EmpID number in the collection, and if it is found, I want to return the Employee. This I can do. The problem comes if the EmpID is not found in the collection. The only way to achieve this I can think of is to throw an invalid argument exception:
6
1868
by: Whoever | last post by:
Here's what I have A custom collection: public class aUser { public string UserName { get {...} set {...} } public class UserList : System.Collection.CollectionBase { public void Add(aUser user) {...} public aUser this {...}
2
1643
by: kermit | last post by:
I have a .net aspx page MyPage.aspx (client side) with code behind MyPage.aspx.vb (server side). I use the Page_Load event in MyPage.aspx.vb to load data into a multiteir class based collection. MyCollection(sYear).cMonths(sMonth).cDays(sDay).cEvents(sID).EventText My problem arrives when I try to access this collection from the page (MyPage.aspx).
7
1816
by: nafri | last post by:
hello all, I want to create a function that returns the first element of the Array that is input to it. However, the Input Array can be an Array of points, double, or anyother type, which means the return type of the function depends on the type of the objects the Input array holds. I can have the return type as Object, but it has problems like late binding and more importantly the client has to always Cast it. For example. class...
1
4429
by: Thomas D. | last post by:
Hello all, I'm using the IXmlSerializable interface for a project and encounter some problems when testing my webservice in a client application. I know this interface is undocumented and not intended for use, but I think this is the only solution for my situation. I searched the web, in the hope finding the answer, without any luck, so my final hope is with you. Let me explain the situation: I have an 'export'-wrapper to my regular...
9
3231
by: MSDNAndi | last post by:
Hi, I have a set of simple webservices calls that worked fine using .NET Framework 1.0. I am calling a Java/Apache based webservices, the calling side is not able to supply a proper WSDL. What it does is to call a webservice with two parameters, one being a integer, the other one being a "String" which contains XML (not the best practice, however that is the target interface and we cannot change that).
1
1451
by: Ghanashyam | last post by:
I have a custom collection (Dervided from CollectionBase) and it works pretty well when I consume it from C# console app.But it is not working if I return the collection from a web service.The IE complains about( You must implement a default accessor as it inherits from ICollection). I want to now what are the methods need to be implemented for that collection.Any help with sample code is highly appreciated. Thanks
11
3269
by: joey.powell | last post by:
Hello, I have a windows forms application (VS2005) where I need to do the following... 1. Startup with a main form. 2. Have the user to select a file and then bring up a second form modally (Form1.ShowDialog()) so that the user can make custom selections. 3. I can store the selections from the second form in many different
2
2537
by: Veloz | last post by:
Hi there My question is regarding how to best return "collections" from a method call. Should you return an actual object or an interesting/ appropriate interface of the object, to the caller? (This is not really restricted to returning collections but that's the example I'm going to focus on) For example, let's say you have method that is going to return a "list of books".
0
10160
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11811
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
11563
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10071
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8453
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6410
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6542
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4726
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3755
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.