tracker issue : CF-3042657

select a category, or use search below
(searches all categories and all time range)
Title:

Bug 84918:(Watson Migration Closure)When calling a cfc function remotely with returnFormat=JSON ColdFusion does not correctly serialize complex objects

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): Ronnie Otts / Ronnie Otts (rotts2)

Created: 11/01/2010

Components: Language, Java Serialization

Versions: 9.0.1

Failure Type: Unspecified

Found In Build/Fixed In Build: 0000 /

Priority/Frequency: Normal / Unknown

Locale/System: English / Platforms All

Vote Count: 2

Problem:

When calling a cfc function remotely with returnFormat=JSON ColdFusion does not correctly serialize complex objects.
Method:

[vmannebo 12/03/2010] Adding repro code:

\\blrfs04.macromedia.com\builds\coldfusion\bugs\84918

1) Run bad.cfm and you will see the incorrect result. If you change resp to a struct instead of an cfc object, it works fine
---------------------------------------------------------------------------------- 

Example:A simple object "ResponseObj" with two properties SUCCESS and DATA. DATA is an array of objects returned from the EntityLoad() function.SUCCESS is a boolean.
example data:

Expected data (CF9 pre updates outputs this)
{"SUCCESS":true,"DATA":[{"name":"Atelier graphique","id":"103"},{"name":"Signal Gift Stores","id":"112"},{"name":"Australian Collectors, Co.","id":"114"},{"name":"La Rochelle Gifts","id":"119"},{"name":"Baane Mini Imports","id":"121"},{"name":"Mini Gifts Distributors Ltd.","id":"124"},{"name":"Havel & Zbyszek Co","id":"125"},{"name":"Blauer See Auto, Co.","id":"128"},{"name":"Mini Wheels Co.","id":"129"},{"name":"Land of Toys Inc.","id":"131"},{"name":"Euro+ Shopping Channel","id":"141"},{"name":"Volvo Model Replicas, Co","id":"144"},{"name":"Danish Wholesale Imports","id":"145"},{"name":"Saveley & Henriot, Co.","id":"146"},{"name":"Dragon Souveniers, Ltd.","id":"148"},{"name":"Muscle Machine Inc","id":"151"},{"name":"Diecast Classics Inc.","id":"157"},{"name":"Technics Stores Inc.","id":"161"},{"name":"Handji Gifts& Co","id":"166"},{"name":"Herkku Gifts","id":"167"},{"name":"American Souvenirs Inc","id":"168"},{"name":"Porto Imports Co.","id":"169"},{"name":"Daedalus Designs Imports","id":"171"},{"name":"La Corne D'abondance, Co.","id":"172"},{"name":"Cambridge Collectables Co.","id":"173"}]}


JSON output after CF 9.0.1 update
{"SUCCESS":true,"DATA":[{"name":"Atelier graphique","id":"103"},{"name":"Signal Gift Stores","id":"112"},{},{},"","","","","","","","","","","","","","","","","","","","","","","","",""]}

JSON output after CF 9.0.1 update and Hot Fix 1
{"SUCCESS":true,"DATA":[{"name":"Atelier graphique","id":"103"},{"name":"Signal Gift Stores","id":"112"},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{}]}

Workaround:Change the ResponseObj to a structure instead. This only works if you have one level of nested object however.
Result:

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3042657

External Customer Info:
External Company:  
External Customer Name: Ronnie Otts
External Customer Email: 52390EB1428AAAAD992016B8
External Test Config: 11/01/2010

Attachments:

Comments: