Returning CollectionBase from WebService

  • Thread starter Web Team @ Borough of Poole
  • Start date
W

Web Team @ Borough of Poole

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.Collections.CollectionBase 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(ByVal UPRN As String, ByVal USRN As
Integer, ByVal PostCode As String, ByVal PAON As String, ByVal SAON As
String, ByVal DesignatedStreetName As String, ByVal Easting As Integer,
ByVal northing As Integer) As CollectionBase
Dim AddressCollection As New OldInfra.BS7666.AddressCollection
Dim CollAddress As CollectionBase =
AddressCollection.GetAddresses(UPRN, USRN, PostCode, PAON, SAON,
DesignatedStreetName, Easting, northing)
Return CollAddress
End Function
 
W

Web Team @ Borough of Poole

I've added the following code to both my webservice and
AddressCollection 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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top