« Return to Thread: ArrayCollection items deserializing as type Object

Re: ArrayCollection items deserializing as type Object

by Support-179 :: Rate this Message:

Reply (Restricted by the Administrator) | Reply to Author | View in Thread

Some parts of this message have been removed. Learn more about Nabble's security policy.
Hi Philip,
 
Glad to be able to help :))
 
Anyway when you check the log file for such cases you will notice the following traces (DEBUG level):
DEBUG FluorineFx.FluorineGateway - Begin AMF request
DEBUG FluorineFx.Messaging.MessageServer - Query endpoint .....
DEBUG FluorineFx.IO.AMFReader - Class definition flex.messaging.messages.RemotingMessage loaded <----- this is the first class definition for Flex RPC
After these lines you should see what types FluorineFx will deserialize. Everything that has no corresponding class mapped will be traced as "Class definition (untyped) loaded"
When you do not see a trace about the specific type then probably class mapping info was not sent from the client.
 
Zoli
 


From: fluorine-bounces@... [mailto:fluorine-bounces@...] On Behalf Of Philip McKeown
Sent: Tuesday, September 23, 2008 3:26 PM
To: 'Fluorine Mailing List'
Subject: Re: [Fluorine] ArrayCollection items deserializing as type Object

Ah, it’s typical that you find the solution after you’ve posted the question!

 

I’ve discovered that the problem was that using the “private static const” to register the class alias worked most of the time because the Class object had been referenced somehow before the call was made. In this case, the alias didn’t get registered until after the server request was made, and so, the Flash runtime didn’t know how to map the response object.

 

After moving this line of code to another location, the deserialization worked fine!

 

Thanks for listening!! ;-)

 

Philip McKeown

 

From: fluorine-bounces@... [mailto:fluorine-bounces@...] On Behalf Of Philip McKeown
Sent: 23 September 2008 11:17
To: fluorine@...
Subject: [Fluorine] ArrayCollection items deserializing as type Object

 

Hi All,

 

This is my first time posting, but I’ve looked through the online forum to try to find a similar issue, and couldn’t. This is probably a newbie issue, so hopefully someone has come across this before…

 

I have a .Net service which returns a custom complex object. This object has a number of generic List<> properties, which are lists of other custom objects.

 

In Flex I have a set of Value Objects to match each of the objects returned in the service response. Each Value Object contains a line of code to register the class alias, e.g.:

 

private static const ALIAS_REMOTE:* = registerClassAlias("ServerObjectName", ClientValueObject);

 

When the call to my service returns to the Flex Client, each object in the object graph gets deserialized to the correct type, except for one particular class which is contained in one of the ArrayCollections, and my problem is I can’t see why. The object is declared and registered the same as everything else, the client-side object code is generated and I’ve double-checked for typo’s. I’ve also tried registering the class mappings on the server.

 

There is nothing special, or different about this class (that I can see). I’ve also tried logging the server DEBUG events, which have not shown any issues. Is there anything else I can check or try?

 

Sorry if this sounds a bit confusing, I’m trying to keep the post short!

 

Thanks,

Philip McKeown

 


_______________________________________________
fluorine mailing list
fluorine@...
http://fluorine.thesilentgroup.com/mailman/listinfo/fluorine_fluorine.thesilentgroup.com

 « Return to Thread: ArrayCollection items deserializing as type Object