|
View:
New views
3 Messages
—
Rating Filter:
Alert me
|
|
|
Proper way to register a custom type converter
by Cliff Meyers
::
Rate this Message:
Reply (Restricted by the Administrator) | Reply to Author | View Threaded | Show Only this Message Hi All,
I was wondering what is the proper way to register a custom type converter. We've created one so that we can handle System.Collections.Generic.IList appropriately and it works fine with RPC / RemoteObject calls. However it doesn't appear to be getting picked up when we push messages over RTMP; any instances of IList come back to the client as null. Right now we use the following code in Global.asax: void Application_Start(object sender, EventArgs e) { System.ComponentModel.TypeDescriptor.AddAttributes( typeof(FluorineFx.AMF3.ArrayCollection), new Attribute[] { new System.ComponentModel.TypeConverterAttribute(typeof(NCash.GenericCollectionTypeConverter)) } ); } It seems like there should be another place to do this, perhaps in Web.config in the Fluorine sections? Thanks, -Cliff _______________________________________________ fluorine mailing list fluorine@... http://fluorine.thesilentgroup.com/mailman/listinfo/fluorine_fluorine.thesilentgroup.com |
|
|
Re: Proper way to register a custom type converter
by Cliff Meyers
::
Rate this Message:
Reply (Restricted by the Administrator) | Reply to Author | View Threaded | Show Only this Message Hi All,
Update on this issue. I was headed in the wrong direction with the TypeConverter but here is what I have discovered: If I try to send an object as the body of an AsyncMessage over RTMP, all collection types in this object are sent as Array rather than ArrayCollection. Basically I am seeing the same behavior as if I were to set "legacy-collection=true" on an AMFChannel. Is there a way to support sending of ArrayCollection over an RTMPChannel? From what I can tell there is no such "legacy-collection" property on RtmpChannel or RtmpEndpoint and the logic to apply "legacy-collection" behavior via filters only exists in AMFEndpoint. Thanks, -Cliff On Sat, Apr 4, 2009 at 10:23 PM, Cliff Meyers <cliff.meyers@...> wrote: > Hi All, > > I was wondering what is the proper way to register a custom type > converter. We've created one so that we can handle > System.Collections.Generic.IList appropriately and it works fine with > RPC / RemoteObject calls. However it doesn't appear to be getting > picked up when we push messages over RTMP; any instances of IList come > back to the client as null. Right now we use the following code in > Global.asax: > > void Application_Start(object sender, EventArgs e) { > System.ComponentModel.TypeDescriptor.AddAttributes( > typeof(FluorineFx.AMF3.ArrayCollection), > new Attribute[] { > new > System.ComponentModel.TypeConverterAttribute(typeof(NCash.GenericCollectionTypeConverter)) > } > ); > } > > It seems like there should be another place to do this, perhaps in > Web.config in the Fluorine sections? > > Thanks, > > -Cliff > _______________________________________________ fluorine mailing list fluorine@... http://fluorine.thesilentgroup.com/mailman/listinfo/fluorine_fluorine.thesilentgroup.com |
|
|
Re: Proper way to register a custom type converter
by Support-179
::
Rate this Message:
Reply (Restricted by the Administrator) | Reply to Author | View Threaded | Show Only this Message Hi Cliff,
This issue was fixed in the SVN version (RtmptProtocolEncoder.cs). You can get the modified sources and the binaries too from the SVN and replace in your FluorineFx installation (it will show up as v1.0.0.16). There is also a breaking change I wrote about: "legacy-collection" element must be moved under <properties><serialization>. <channels> <channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel"> <endpoint uri="http://{server.name}:{server.port}/{context.root}/Gateway.aspx" class="flex.messaging.endpoints.AMFEndpoint"/> <properties> <serialization> <!--<legacy-collection>false</legacy-collection>--> <!--<legacy-throwable>true</legacy-throwable>--> </serialization> </properties> </channel-definition> </channels> Zoli -----Original Message----- From: fluorine-bounces@... [mailto:fluorine-bounces@...] On Behalf Of Cliff Meyers Sent: Tuesday, April 07, 2009 4:03 AM To: fluorine@... Subject: Re: [Fluorine] Proper way to register a custom type converter Hi All, Update on this issue. I was headed in the wrong direction with the TypeConverter but here is what I have discovered: If I try to send an object as the body of an AsyncMessage over RTMP, all collection types in this object are sent as Array rather than ArrayCollection. Basically I am seeing the same behavior as if I were to set "legacy-collection=true" on an AMFChannel. Is there a way to support sending of ArrayCollection over an RTMPChannel? From what I can tell there is no such "legacy-collection" property on RtmpChannel or RtmpEndpoint and the logic to apply "legacy-collection" behavior via filters only exists in AMFEndpoint. Thanks, -Cliff On Sat, Apr 4, 2009 at 10:23 PM, Cliff Meyers <cliff.meyers@...> wrote: > Hi All, > > I was wondering what is the proper way to register a custom type > converter. We've created one so that we can handle > System.Collections.Generic.IList appropriately and it works fine with > RPC / RemoteObject calls. However it doesn't appear to be getting > picked up when we push messages over RTMP; any instances of IList come > back to the client as null. Right now we use the following code in > Global.asax: > > void Application_Start(object sender, EventArgs e) { > System.ComponentModel.TypeDescriptor.AddAttributes( > typeof(FluorineFx.AMF3.ArrayCollection), > new Attribute[] { > new > System.ComponentModel.TypeConverterAttribute(typeof(NCash.GenericColle > ctionTypeConverter)) > } > ); > } > > It seems like there should be another place to do this, perhaps in > Web.config in the Fluorine sections? > > Thanks, > > -Cliff > _______________________________________________ fluorine mailing list fluorine@... http://fluorine.thesilentgroup.com/mailman/listinfo/fluorine_fluorine.thesil entgroup.com _______________________________________________ fluorine mailing list fluorine@... http://fluorine.thesilentgroup.com/mailman/listinfo/fluorine_fluorine.thesilentgroup.com |
| Free embeddable forum powered by Nabble | Forum Help |