These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: NHibernate & Web Services
PostPosted: Tue May 25, 2010 4:39 am 
Newbie

Joined: Tue May 25, 2010 4:27 am
Posts: 1
I am trying to publish my DAOs into web services and I am having some problems:

When a collection is implemented by an IList<> interface, it works fine until it is published by a Web Service (this is obvious). The Xml Serializer can not handle interface definitions.
It is not possible to solve by implementing a generic List configuring the NHibernate collection as a field and exposing the generic List implementation, because the "bag" collection could not be serialized too.

Please, does anybody know the best strategy to handle this issue?

Thanks in advance.


Top
 Profile  
 
 Post subject: Re: NHibernate & Web Services
PostPosted: Wed May 26, 2010 4:29 am 
Beginner
Beginner

Joined: Fri Feb 27, 2009 6:07 am
Posts: 38
Location: Moscow,Russia
interface cannot be serialized,therefore
this code work:
Code:
  [WebMethod]
  public List<Entity> GetEntities()

and this no:
Code:
  [WebMethod]
   public IList<Entity> GetEntities()


"bag" collection is serialized:
Code:
   [Serializable]
   [DebuggerTypeProxy(typeof (CollectionProxy))]
   public class PersistentBag : AbstractPersistentCollection, IList


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.