Error when returning a collection from a web service

S

Simon Harris

I am trying to create a web service that returns a collection.

It keeps complaining that I need to specifiy a default accessor.

I have searched Google over and over for this - Lots of results, none of
which really make full sense to me.

I understand that this is related to serialization, and that I need to add
default properties - Something about enabling the web service to reference
each object in my collection by its index.

Can some one please give me some code (VB) and comment it to show what I
need to do? Help this .Net newb out! :)

Many Thanks,
Simon.
 
B

Brock Allen

The recommondation is to not pass .NET data classes as parameters or return
values to your webservices, because they rely upon more than just their state
-- they also rely upon all of their code that is .NET specific. WebServices
are about interop with other platforms like Java. Java will have no clue
how to work with a CollectionBase .NET object.

The approach you should take it to use primitives and simpel classes that
you design that exist just as placeholders for the XML that is being passed
around. Arrarys work fine, BTW. Go to groups.google.com and search a bit
more in the webservices NG archives for some more pointers, as this issue
has come up before.
 
M

Matt Berther

Hello Simon,

I think what you're after is a default property...

Im not good at VB.NET, but a google for VB.NET default property should yield
a solution.
 

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,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top