New Posts New Posts RSS Feed: Deserializing array regress ?
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Deserializing array regress ?

 Post Reply Post Reply
Author
Walid View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14-Nov-2010
Posts: 161
Post Options Post Options   Quote Walid Quote  Post ReplyReply Direct Link To This Post Topic: Deserializing array regress ?
    Posted: 28-Sep-2012 at 2:44am
Hi,

I have an Rpc method returning an IEnumerable<a knowntype> that was right working in DF2010 and now with DF2012 is causing an error with the following message.

Did I miss something ?

Le module de formatage a généré une exception en tentant de désérialiser le message : Une erreur s'est produite en tentant de désérialiser le paramètre http://ideablade.com/EntityModel:InvokeServerMethodResult. Le message InnerException était « L'élément « http://ideablade.com/EntityModel:ReturnObject » contient des données du contrat de données « http://schemas.datacontract.org/2004/07/Common:ArrayOfServiceManager ». Le désérialiseur n'a connaissance d'aucun type mappant à ce contrat. Ajoutez le type correspondant à « ArrayOfServiceManager » dans la liste des types connus, par exemple en utilisant l'attribut KnownTypeAttribute ou en l'ajoutant à la liste des types connus qui est transmise à DataContractSerializer. ». Pour plus d'informations, voir InnerException.




    [DataContract]
    public class ServiceManager : IKnownType
    {
        [DataMember]
        public string Name { get; set; }

        [DataMember]
        public string Description { get; set; }

        [DataMember]
        public ServiceStatus Status { get; set; }
    }

        [AllowRpc]
        public static IEnumerable<ServiceManager> GetServiceManagers(IPrincipal principal, EntityManager entityManager, params Object[] args)
        {
            return ServicesControlManager.Instance.GetServiceManagers();
        }




Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Posted: 28-Sep-2012 at 11:07am
Hi Walid,
 
DevForce will automatically add a List<T> for any type found that implements IKnownType, and this is unchanged from DF2010.   It sounds like the assembly holding the ServiceManager class hasn't been found by DevForce, so check what's been probed.  See http://drc.ideablade.com/devforce-2012/bin/view/Documentation/discovery for more info.
Back to Top
Walid View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14-Nov-2010
Posts: 161
Post Options Post Options   Quote Walid Quote  Post ReplyReply Direct Link To This Post Posted: 28-Sep-2012 at 11:35am
Devforce found the class :

2012-09-28 20:30:33 IdeaBlade.EntityModel.KnownTypeHelper:<GetMarkedKnownTypes>b__13 Probed for known types and found Common.ServiceManager
Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Posted: 28-Sep-2012 at 2:21pm
The type needs to be known on both client and server.  Is this by any chance a type in a dynamic XAP?
 
 
Back to Top
Walid View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14-Nov-2010
Posts: 161
Post Options Post Options   Quote Walid Quote  Post ReplyReply Direct Link To This Post Posted: 28-Sep-2012 at 2:24pm
yes, the file hosting the type is link to an SL assembly dynamically loaded in a xap.

Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Posted: 28-Sep-2012 at 7:39pm
You're right, this is a regression bug in the recomposition logic.  We'll post when we have a fix.
Back to Top
Walid View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14-Nov-2010
Posts: 161
Post Options Post Options   Quote Walid Quote  Post ReplyReply Direct Link To This Post Posted: 29-Sep-2012 at 2:32am
ok thanks

this probem could also be related to the issue i told you about the model in a dynamic xap ?
i think marcel said he will investigate on this one
Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Posted: 29-Sep-2012 at 10:01am
This is a DevForce bug, so I'll get in touch with Marcel.  And yes, it is related to your earlier issue with the dynamic XAP.
Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Posted: 08-Oct-2012 at 5:39pm
Just an update for anyone else who ran into this problem - it was fixed in the 7.0.1 release, which is available via NuGet.
Back to Top
Walid View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14-Nov-2010
Posts: 161
Post Options Post Options   Quote Walid Quote  Post ReplyReply Direct Link To This Post Posted: 09-Oct-2012 at 12:26am
I confirm,the fix works well.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down