Thursday, March 22, 2012

Strongly Typed Collections

I'm writing a web service that I want to return a strongly typed collection.
If I inherit System.collections.generic.list(of T) it returns an ArrayOfT.
If I inherit CollectionsBase, it also returns an ArrayOf. I want the root
xml element to just be of the class itself (if that makes any sense). Is
this even possible? What do I need to inherit?
If you want a strong object/collection on the outside world (of a web
service)...then the client needs to know something about some kind of strong
collection.
..
Take a look here:
http://sholliday.spaces.live.com/Blog/cns!A68482B9628A842A!158.entry
I have a IZebraCollection......which the service and the host know about.
Its WCF, but WCF can be exposed as a webservice.
..
"Dave T" <DaveT@.discussions.microsoft.com> wrote in message
news:A1A6AA44-6974-4B5C-9C11-795D570F46A7@.microsoft.com...
> I'm writing a web service that I want to return a strongly typed
> collection.
> If I inherit System.collections.generic.list(of T) it returns an ArrayOfT.
> If I inherit CollectionsBase, it also returns an ArrayOf. I want the root
> xml element to just be of the class itself (if that makes any sense). Is
> this even possible? What do I need to inherit?

0 comments:

Post a Comment