Typed lists and webservices

Posts   
 
    
Posts: 4
Joined: 07-Apr-2005
# Posted on: 02-Aug-2005 18:41:05   

I have been attempting to create a webservice using LLBLGen Pro. I can create a function that returns an EntityCollection, and I can get a windows application to consume it (after I fix reference.vb). However, when I add a function that returns a typed list, I get a runtime error:

 You must implement the Add(System.Object) method on SIMSWebDAL.TypedListClasses.PremiseCityTypedList because it inherits from IEnumerable.

Is this because XmlSerializable was only added for entities and entityCollections? More importantly, is there a way to get past this?

Thanks, David

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39749
Joined: 17-Aug-2003
# Posted on: 02-Aug-2005 18:56:26   

TypedLists are based on datatables (derived from datatable), so you should add the typed list to a generic DataSet, then return that dataset, and at the consuming end you Import the rows back into a new instance of your typedlist. (I'm not sure if you can cast the automatically instantiated datatable back to a typedlist though, probably not, as it is casting to a type the instance isn't a type of)

Frans Bouma | Lead developer LLBLGen Pro