AS3 doesn't have the concept of generics, so yes, all collections should
be instances of mx.collections.ArrayCollection by default. Types like
mx.collections.ArrayCollection can only really be sent and received
properly by AMF3, so any remoting endpoint would have to understand this
version of the AMF protocol. Any remoting solution working with Flex 2's
RemoteObject should be aware of the messaging infrastructure that is
used to send messages for any remote service request and response. If
Fluorine isn't sending back the result wrapped in a typed instance of
flex.messaging.messages.AcknowledgeMessage (or an error wrapped in an
mx.messaging.messages.ErrorMessage) with a correct correlationId
property to match the request mx.messaging.remoting.RemotingMessage's
messageId - then it won't work.
 
.

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of khmerang
Sent: Friday, June 15, 2007 2:14 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Flex Remoting and complex objects



Hi all,
I'm beginner with Flex, but have quite a lot experience with .Net. We
have been testing to move some complicated UI to Flex using Fluorine
as the remoting host. Almost everything seems to be working fine, but
sending complex objects from Flex seems to have some serious issues.

We have value objects that contain nested lists, for example:

Project
+ Sections : List<ProjectSection> 

ProjectSection
+ Assets : List<Asset>

Asset
+ AvailableColors : List<Color>

These objects are received by Flex (all generic lists are converted to
ArrayCollections) just fine, but I am getting an error when trying to
send the object back to the host:

TypeError: Error #1034: Type Coercion failed: cannot convert
[EMAIL PROTECTED] to mx.messaging.messages.IMessage.

As a breakpoint inside Fluorine service will not trigger, I am
expecting that the problem happens inside Flex. Has anybody experience
with objects like this? We are using Cairngorm in Flex, could that be
an issue? Or do you think the problem would be with Fluorine (haven't
tested with WebOrb)?

Any ideas appreciated,
Miika



 

Reply via email to