473,587 Members | 2,588 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Returning CollectionBase from WebService

Hi All,

I'm trying to build a webservice that returns a CollectionBase.

I am getting this error:

"You must implement a default accessor on
System.Collecti ons.CollectionB ase because it inherits from
ICollection."

I've searched and searched on this one - Plenty of articles, none of
which make much sense to me, the common thread seems to be that I need
to add some default properties. (I'm new to .Net - Help!)

I've pasted in my code below.

Many Thanks,

Simon.
<WebMethod()> _
Public Function GetAddresses(By Val UPRN As String, ByVal USRN As
Integer, ByVal PostCode As String, ByVal PAON As String, ByVal SAON As
String, ByVal DesignatedStree tName As String, ByVal Easting As Integer,
ByVal northing As Integer) As CollectionBase
Dim AddressCollecti on As New OldInfra.BS7666 .AddressCollect ion
Dim CollAddress As CollectionBase =
AddressCollecti on.GetAddresses (UPRN, USRN, PostCode, PAON, SAON,
DesignatedStree tName, Easting, northing)
Return CollAddress
End Function

Nov 19 '05 #1
1 1162
I've added the following code to both my webservice and
AddressCollecti on class. Hasnt made any difference :(

Public Property address() As Address
Get
Return address
End Get
Set(ByVal Value As Address)
address = Value
End Set
End Property

Nov 19 '05 #2

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

Similar topics

5
3523
by: Steve M | last post by:
I have subclassed CollectionBase. I have also implemented GetEnumerator(). I have tried to set the DataSource of a DataGrid to an instance of my subclass. However, the items in the grid are not obtained via the Enumerator that I create in the GetEnumerator() method. I have tried elplicitly implementing IEnumerable on my sublass as well. Can...
1
410
by: Karuppasamy | last post by:
H I have a WebService calling a Method in a Remote Object. The Remote method Returns an Object. This Webservice also returns the same object. All things are working fine when this Web Service is running in a Windows XP. But when I am trying to run the same webservice in a Windows 2000 Advanced Server Machine, I am getting the following error ...
2
2731
by: Scott Reynolds | last post by:
I am having a problem exposing a class inherited from the collection base class as a webservice. If I expose the collection on a web page all works well and I am very happy. However when I try and expose this via a web service I get a weird error saying that the dll could not be found. The specific error is: I can't figure it out. I thought...
1
3517
by: Morten Dyndgaard | last post by:
Hi, I want to do the following: I have to XmlSerialize a HashTable, but since it inherits from IDictionary it cannot be XmlSerialized, and I prefer not to make my own implementation of IXmlSerializer. So, I make two arrays, one containing the keys and one containing the values, and I would like to XmlSerialize these arrays. However, the
2
6957
by: Samuel R. Neff | last post by:
What's the advantage of inheriting from CollectionBase as opposed to just implementing IList? It seems that it saves you from having to implement a few properties (Clear, CopyTo, Count, GetEnumerator, and RemoveAt) but the way it implements all the other things you need to override seems overkill and counters the advantage of having an...
5
19576
by: Stacey Levine | last post by:
I have a webservice that I wanted to return an ArrayList..Well the service compiles and runs when I have the output defined as ArrayList, but the WSDL defines the output as an Object so I was having a problem in the calling program. I searched online and found suggestions that I return an Array instead so I modified my code (below) to return...
4
1218
by: Daniel | last post by:
I've been asking around and reading but I cannot find a definitive answer. I have customers that need information from our calendar application. The data will come from SQL Server 2000. The customers who use .net are able to read the datasets that the web service returns. I'm having problems when customers are using Java or CFMX. What...
2
1625
by: Asim Qazi | last post by:
Hi All public class MyResponse { public bool m_bStatus; public string m_szErrorCode; public string m_szMessage; }
1
1451
by: Ronchese | last post by:
Helllo. I need to return a XML from my WebService, but I'm not getting the result as a XML. I mean, instead of receiveing a tag (<xyy></xyz>), I'm receiving it encoded (with &lt; or &gt;). There is some right way to return the correct XML from my WebService? Just for example, the WebMethod looks like it:
0
7918
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7843
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...
0
8206
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. ...
0
8340
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7967
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...
0
6621
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...
1
2353
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1452
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1185
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...

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.