new XmlSerializer(typeof(PrefetchPath2))

Posts   
 
    
tolga
User
Posts: 25
Joined: 26-Feb-2006
# Posted on: 04-Mar-2006 04:40:41   

Why does this throw an exception saying "Cannot serialize interface SD.LLBLGen.Pro.ORMSupportClasses.IPrefetchPathElement2." :

XmlSerializer serializer = new XmlSerializer(typeof(PrefetchPath2));

I am trying to wrap the FetchEntityCollection methods in to remobjects methods and being able to pass filter and prefetchpath parameters as xml (from the client to the server) would be wonderful, since I could then deserialize them, make a call to FetchEntityCollection (on the server) and return the entitycollection as serialized xml (from server to client)...

Thanks

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39617
Joined: 17-Aug-2003
# Posted on: 04-Mar-2006 10:12:09   

They're only serializable over remoting, not xml webservices. The xmlserializer fails because it's severily limited: no cyclic references, hashtables or interfaces are supported.

Frans Bouma | Lead developer LLBLGen Pro
tolga
User
Posts: 25
Joined: 26-Feb-2006
# Posted on: 04-Mar-2006 18:44:32   

So is there no way to create webservice methods with filter and prefetchpath parameters to mimic the DataAccessAdapter.FetchEntityCollection methods?

This would be fantastic for me, because I could just have a few web service methods and reuse them for all entities.

Another way this could be accomplished without having a complex type like the PredicateBucket thingy is if the ExpressionPredicate factory methods contained one extra method to create the necessary objects from an expression, like "CustomerName like 'Tol%' and blah bblah".

This way one could parse together a filter string and pass it back and forth through tiers without having to deal with xml serialization crap.

Thanks

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39617
Joined: 17-Aug-2003
# Posted on: 04-Mar-2006 19:59:47   

You can always serialize to Xml using the Soap formatter, then send that string to the service, deserialize there to a predicate object and use it simple_smile

Frans Bouma | Lead developer LLBLGen Pro