Tim,

>I have a component object stored in the session scope. I am attempting
>to use CFWDDX to store this in a database for logging/other purposes.
>
><cfset session.myCart = CreateObject("component","apps.cart")>
><cfwddx action="CFML2WDDX" input="#session#" output="wddxSession">
>
>This actually seems to work -- I can insert the string into the database.
>However, when I want to reverse the WDDX call to look at the packet, I
>lose everything in the "myCart" key.

CFMX 7 does not support serializing CFC components. What you'll need to do
is manually build a serialize()/deserialize() method for your component.
Using WDDX you could do this pretty easily just by copying all the
properties into a WDDX packet.

Heck, you could probably do something like:

<cffunction name="serialize">
  <cfwddx action="cfml2wddx" input="#variables#" output="sWddx" />
  <cfreturn sWddx />
</cffunction>

I haven't test this, but worse case scenario is you just copy all the
necessary information to rebuild this instance of the component in a
structure an wddx that.

Your deserialize method would just take the WDDX packet (or what format you
use used) and would use that information to rebuild the instance.

-Dan


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:236625
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to