Error when deserializing Facebook News Feed Object

Sep 29, 2012 at 3:28 PM

When trying to deserialize a facebook feed obtained with the following code:

    HttpWebRequest feedRequest = (HttpWebRequest)WebRequest.Create(feedurl);
    feedRequest.Method = "GET";
    WebResponse feedResponse = feedRequest.GetResponse();
    StreamReader sr = new StreamReader(feedResponse.GetResponseStream(), System.Text.Encoding.UTF8);
    string raw_response = sr.ReadToEnd();
    var facebook_feed = fastJSON.JSON.Instance.ToObject(raw_response);
    sr.Close();
    feedResponse.Close();
the raw_response object's value is:  
{"data":[{"id":"244108255703803_278540402260588","from":{"name":"Rachel Jaworski","id":"1373936548"},"to":{"data":[{"name":"Pink Tree Sweets","category":"Food\/grocery","id":"244108255703803"}]},"message":"saw the sign hanging on the window of the new store that said now hiring. wondering if there was a form i could fill out?\n","type":"status","created_time":"2012-09-07T20:21:27+0000","updated_time":"2012-09-07T20:21:27+0000","comments":{"count":0}},{"id":"244108255703803_274615572653071","from":{"name":"Pink Tree Sweets","category":"Food\/grocery","id":"244108255703803"},"to":{"data":[{"name":"Jamie Yang","id":"680653527"},{"name":"Nadine Shen Molesky","id":"1628569450"}]},"message":"Jamie Yang and Nadine Shen Molesky- great sleepover!!!","message_tags":{"0":[{"id":"680653527","name":"Jamie Yang","type":"user","offset":0,"length":10}],"15":[{"id":"1628569450","name":"Nadine Shen Molesky","type":"user","offset":15,"length":19}]},"picture":"http:\/\/photos-b.ak.fbcdn.net\/hphotos-ak-ash4\/376623_274614642653164_1090078417_s.jpg","link":"http:\/\/www.facebook.com\/photo.php?fbid=274614642653164&set=a.274614629319832.62557.244108255703803&type=1&relevant_count=13","name":"Jamie and Nadine's Sleepover!","caption":"\u0040[680653527:2048:Jamie Yang] and \u0040[1628569450:2048:Nadine Shen Molesky]- great sleepover!!!","icon":"http:\/\/static.ak.fbcdn.net\/rsrc.php\/v2\/yz\/r\/StEh3RhPvjk.gif","type":"photo","status_type":"added_photos","object_id":"274614642653164","created_time":"2012-08-28T01:59:49+0000","updated_time":"2012-08-28T01:59:49+0000","likes":{"data":[{"name":"long jin","id":"1295213957"},{"name":"Lauren Elizabeth Wong","id":"1557245549"},{"name":"Aaron Lai","id":"828628985"},{"name":"Andover Village Square","category":"Shopping\/retail","id":"160107984120070"}],"count":5},"comments":{"count":0}},{"id":"244108255703803_273406859440609","from":{"name":"Julina Lin","id":"1269492625"},"to":{"data":[{"name":"Pink Tree Sweets","category":"Food\/grocery","id":"244108255703803"}]},"message":"\u795d\u751f\u610f\u8208\u9686\uff0c\u5275\u610f\u7121\u9650\u3002","type":"status","application":{"name":"Facebook for iPad","namespace":"fbipad_","id":"173847642670370"},"created_time":"2012-08-24T17:20:39+0000","updated_time":"2012-08-24T17:20:39+0000","comments":{"count":0}},{"id":"244108255703803_273160449465250","from":{"name":"Pink Tree Sweets","category":"Food\/grocery","id":"244108255703803"},"picture":"http:\/\/photos-f.ak.fbcdn.net\/hphotos-ak-snc7\/10489_273160199465275_1269643394_s.jpg","link":"http:\/\/www.facebook.com\/photo.php?fbid=273160199465275&set=a.273160182798610.61981.244108255703803&type=1&relevant_count=9","name":"Tennis Fundraiser","icon":"http:\/\/static.ak.fbcdn.net\/rsrc.php\/v2\/yz\/r\/StEh3RhPvjk.gif","type":"photo","status_type":"added_photos","object_id":"273160199465275","created_time":"2012-08-24T00:17:15+0000","updated_time":"2012-08-27T22:20:35+0000","likes":{"data":[{"name":"Andover Village Square","category":"Shopping\/retail","id":"160107984120070"},{"name":"Patty Lin","id":"596565532"},{"name":"long jin","id":"1295213957"},{"name":"Janice April McDaniel","id":"1510793061"}],"count":11},"comments":{"data":[{"id":"244108255703803_273160449465250_1057956","from":{"name":"Andover Village Square","category":"Shopping\/retail","id":"160107984120070"},"message":"We look forward to welcoming Pink Tree Sweets to Andover Village Square!","message_tags":[{"id":"244108255703803","name":"Pink Tree Sweets","type":"page","offset":29,"length":16},{"id":"160107984120070","name":"Andover Village Square","type":"page","offset":49,"length":22}],"created_time":"2012-08-27T22:20:35+0000"}],"count":1}},{"id":"244108255703803_269189386529023","from":{"name":"\u5289\u4ebc\u777f","id":"100002438948505"},"to":{"data":[{"name":"Pink Tree Sweets","category":"Food\/grocery","id":"244108255703803"}]},"message":"\u4e5f\u592a\u5f37\u4e86\u5427!\n\u771f\u60f3\u6bcf\u6a23\u90fd\u5403\u5403\u770b\u54e9!\n\u671f\u5f85\u53f0\u7063\u4e5f\u958b\u500b\u5206\u5e97\u54e6......","type":"status","created_time":"2012-08-12T05:46:41+0000","updated_time":"2012-08-12T05:46:41+0000","comments":{"count":0}},{"id":"244108255703803_402673403119604","from":{"name":"Pink Tree Sweets","category":"Food\/grocery","id":"244108255703803"},"story":"Pink Tree Sweets shared a link.","story_tags":{"0":[{"id":"244108255703803","name":"Pink Tree Sweets","offset":0,"length":16,"type":"page"}]},"picture":"http:\/\/external.ak.fbcdn.net\/safe_image.php?d=AQDITfbly9q3u7Bd&w=90&h=90&url=http\u00253A\u00252F\u00252Fimagesak.websitetonight.com\u00252Fskins\u00252Fpl.gd\u00252Fimages\u00252Flogo1.gif","link":"http:\/\/pinktreesweets.com\/","name":"Pink Tree Sweets","caption":"pinktreesweets.com","description":"See this Go Daddy InstantPage\u00ae! http:\/\/pinktreesweets.com. Get yours free with a domain name at GoDaddy.com. Fall Grand Opening","icon":"http:\/\/static.ak.fbcdn.net\/rsrc.php\/v2\/yD\/r\/aS8ecmYRys0.gif","type":"link","status_type":"shared_story","application":{"name":"Share_bookmarklet","id":"5085647995"},"created_time":"2012-08-11T04:47:40+0000","updated_time":"2012-08-11T04:47:40+0000","likes":{"data":[{"name":"Andover Village Square","category":"Shopping\/retail","id":"160107984120070"},{"name":"Aaron Lai","id":"828628985"}],"count":2},"comments":{"count":0}},{"id":"244108255703803_499734750041413","from":{"name":"Pink Tree Sweets","category":"Food\/grocery","id":"244108255703803"},"story":"Pink Tree Sweets shared a link.","story_tags":{"0":[{"id":"244108255703803","name":"Pink Tree Sweets","offset":0,"length":16,"type":"page"}]},"picture":"http:\/\/external.ak.fbcdn.net\/safe_image.php?d=AQDITfbly9q3u7Bd&w=90&h=90&url=http\u00253A\u00252F\u00252Fimagesak.websitetonight.com\u00252Fskins\u00252Fpl.gd\u00252Fimages\u00252Flogo1.gif","link":"http:\/\/pinktreesweets.com\/","name":"Pink Tree Sweets","caption":"pinktreesweets.com","description":"See this Go Daddy InstantPage\u00ae! http:\/\/pinktreesweets.com. Get yours free with a domain name at GoDaddy.com. Fall Grand Opening","icon":"http:\/\/static.ak.fbcdn.net\/rsrc.php\/v2\/yD\/r\/aS8ecmYRys0.gif","type":"link","status_type":"shared_story","application":{"name":"Share_bookmarklet","id":"5085647995"},"created_time":"2012-08-11T03:15:34+0000","updated_time":"2012-08-11T03:15:34+0000","likes":{"data":[{"name":"Aaron Lai","id":"828628985"}],"count":1},"comments":{"count":0}},{"id":"244108255703803_268161986631763","from":{"name":"Tingting Liu","id":"505810015"},"to":{"data":[{"name":"Pink Tree Sweets","category":"Food\/grocery","id":"244108255703803"}]},"message":"Cannot wait for the grand opening!!!!!\ncannot wait to seeing you!!!\nall the best wishes!!!!","type":"status","created_time":"2012-08-08T20:37:09+0000","updated_time":"2012-08-08T20:37:09+0000","comments":{"count":0}},{"id":"244108255703803_267493166698645","from":{"name":"Eileen Kim","id":"685328195"},"to":{"data":[{"name":"Pink Tree Sweets","category":"Food\/grocery","id":"244108255703803"}]},"message":"Gorgeous cupcakes... Can't wait to sink my teeth in one of them! Congrats Annie! :) ","type":"status","created_time":"2012-08-06T20:31:23+0000","updated_time":"2012-08-06T20:31:23+0000","comments":{"count":0}},{"id":"244108255703803_266759076772054","from":{"name":"Jamie Yang","id":"680653527"},"to":{"data":[{"name":"Pink Tree Sweets","category":"Food\/grocery","id":"244108255703803"}]},"message":"Can't wait to stop by. Love your cupcakes!","type":"status","created_time":"2012-08-04T13:35:10+0000","updated_time":"2012-08-04T13:35:10+0000","comments":{"count":0}},{"id":"244108255703803_266637980117497","from":{"name":"Claire Obrien","id":"100002783215745"},"to":{"data":[{"name":"Pink Tree Sweets","category":"Food\/grocery","id":"244108255703803"}]},"message":"Congratulations!  Best of luck with your new venture. Claire","type":"status","created_time":"2012-08-04T03:12:57+0000","updated_time":"2012-08-04T03:12:57+0000","comments":{"count":0}},{"id":"244108255703803_266635966784365","from":{"name":"June Kaiter","id":"1213753849"},"to":{"data":[{"name":"Pink Tree Sweets","category":"Food\/grocery","id":"244108255703803"}]},"message":"Thanks for making our 50th party wonderful!  \n--June & Peter","type":"status","created_time":"2012-08-04T03:02:14+0000","updated_time":"2012-08-04T03:02:14+0000","comments":{"count":0}},{"id":"244108255703803_266633396784622","from":{"name":"Jasmine Ou","id":"556204176"},"to":{"data":[{"name":"Pink Tree Sweets","category":"Food\/grocery","id":"244108255703803"}]},"message":"Congratulations!  \u795d\u751f\u610f\u5174\u9686\uff01","type":"status","created_time":"2012-08-04T02:49:15+0000","updated_time":"2012-08-04T02:49:15+0000","comments":{"count":0}},{"id":"244108255703803_266632440118051","from":{"name":"Miranda Chen","id":"100000942555021"},"to":{"data":[{"name":"Pink Tree Sweets","category":"Food\/grocery","id":"244108255703803"}]},"message":"\u8fd9\u8ba9\u4eba\u5782\u6d8e\u4e09\u5c3a\u554a\uff1a\uff09\u795d\u4f60\u751f\u610f\u5174\u9686\u54e6\uff1a\uff09","type":"status","created_time":"2012-08-04T02:43:32+0000","updated_time":"2012-08-04T02:43:32+0000","comments":{"count":0}},{"id":"244108255703803_266626863451942","from":{"name":"Pink Tree Sweets","category":"Food\/grocery","id":"244108255703803"},"picture":"http:\/\/photos-h.ak.fbcdn.net\/hphotos-ak-prn1\/555528_266626040118691_280700021_s.jpg","link":"http:\/\/www.facebook.com\/photo.php?fbid=266626040118691&set=a.266626026785359.59594.244108255703803&type=1&relevant_count=20","name":"Bloomingdale's Charity spring 2012","caption":"20 new photos","icon":"http:\/\/static.ak.fbcdn.net\/rsrc.php\/v2\/yz\/r\/StEh3RhPvjk.gif","type":"photo","status_type":"added_photos","object_id":"266626040118691","created_time":"2012-08-04T02:16:50+0000","updated_time":"2012-08-10T13:10:58+0000","likes":{"data":[{"name":"\u8449\u6167\u73b2","id":"100000042293836"},{"name":"Kozue Sawame","id":"1408495"},{"name":"Elo Eloisa","id":"100000212600550"},{"name":"Andover Village Square","category":"Shopping\/retail","id":"160107984120070"}],"count":9},"comments":{"data":[{"id":"244108255703803_266626863451942_994658","from":{"name":"Daisy  Chang","id":"100003133534226"},"message":"\u540c\u5b78\u4f60\u592a\u5f37\u4e86...","created_time":"2012-08-06T01:00:40+0000"},{"id":"244108255703803_266626863451942_1007164","from":{"name":"Michele Wang","id":"100000158815553"},"message":"\u597d\u68d2\u5594\uff01","created_time":"2012-08-10T02:14:25+0000"},{"id":"244108255703803_266626863451942_1008343","from":{"name":"\u8449\u6167\u73b2","id":"100000042293836"},"message":"\u5149\u7528\u770b\u8d77\u4f86\u5c31\u8272\u9999\u5473\u805a\u5168\u4e86, \u597d\u6f02\u4eae! \u7b49\u59b3\u7d05\u56de\u53f0\u7063\u958b\u5206\u5e97\u5594!","created_time":"2012-08-10T13:10:58+0000"}],"count":3}},{"id":"244108255703803_266622266785735","from":{"name":"Pink Tree Sweets","category":"Food\/grocery","id":"244108255703803"},"picture":"http:\/\/photos-h.ak.fbcdn.net\/hphotos-ak-prn1\/524284_266621383452490_78740184_s.jpg","link":"http:\/\/www.facebook.com\/photo.php?fbid=266621383452490&set=a.266621363452492.59591.244108255703803&type=1&relevant_count=13","name":"June and Peter's 50th Anniversary","caption":"13 new photos","icon":"http:\/\/static.ak.fbcdn.net\/rsrc.php\/v2\/yz\/r\/StEh3RhPvjk.gif","type":"photo","status_type":"added_photos","object_id":"266621383452490","created_time":"2012-08-04T01:57:12+0000","updated_time":"2012-08-05T21:58:43+0000","likes":{"data":[{"name":"Patty Lin","id":"596565532"},{"name":"Julina Lin","id":"1269492625"},{"name":"Linda Young","id":"100003580315613"},{"name":"Andover Village Square","category":"Shopping\/retail","id":"160107984120070"}],"count":7},"comments":{"data":[{"id":"244108255703803_266622266785735_994365","from":{"name":"Victoria Shih","id":"1678335867"},"message":"Great ! Definitely I will visit your store soon!","created_time":"2012-08-05T21:58:43+0000"}],"count":1}},{"id":"244108255703803_342581259157484","from":{"name":"Pink Tree Sweets","category":"Food\/grocery","id":"244108255703803"},"to":{"data":[{"name":"Brestyans Gymnastics Boys Team's Tennis Tournament fundraiser","start_time":"2012-08-18T10:00:00-0400","timezone":"America\/New_York","location":"Bass River Tennis Club","id":"342580615824215"}]},"message":"The tennis tournament!!!!!!!!! All levels are welcome, and have fun, especially those tennis lovers. Cupcakes are provided by Pink Tree Sweets. Thanks","type":"status","created_time":"2012-08-04T01:49:48+0000","updated_time":"2012-08-04T01:49:48+0000","likes":{"data":[{"name":"Debbie Naka","id":"1502820583"}],"count":1},"comments":{"count":0}},{"id":"244108255703803_342580615824215","from":{"name":"Pink Tree Sweets","category":"Food\/grocery","id":"244108255703803"},"message":"Brestyans Gymnastics Boys Team's Tennis Tournament fundraiser","story":"at Bass River Tennis Club.","icon":"http:\/\/static.ak.fbcdn.net\/rsrc.php\/v2\/yW\/r\/r28KD-9uEMh.gif","actions":[{"name":"View","link":"\/events\/342580615824215\/"}],"type":"status","object_id":"342580615824215","created_time":"2012-08-04T01:46:26+0000","updated_time":"2012-08-04T01:46:27+0000","likes":{"data":[{"name":"Andover Village Square","category":"Shopping\/retail","id":"160107984120070"}],"count":1},"comments":{"count":0}},{"id":"244108255703803_402275059833934","from":{"name":"Pink Tree Sweets","category":"Food\/grocery","id":"244108255703803"},"message":"June and Peter's Golden 50th Anniversary","story":"at Turner Hill.","icon":"http:\/\/static.ak.fbcdn.net\/rsrc.php\/v2\/yW\/r\/r28KD-9uEMh.gif","actions":[{"name":"View","link":"\/events\/402275059833934\/"}],"type":"status","object_id":"402275059833934","created_time":"2012-08-04T01:39:36+0000","updated_time":"2012-08-04T01:39:36+0000","likes":{"data":[{"name":"Pei Hsieh","id":"100001162207361"}],"count":1},"comments":{"count":0}},{"id":"244108255703803_395547780505670","from":{"name":"Pink Tree Sweets","category":"Food\/grocery","id":"244108255703803"},"message":"Bloomingdale's Charity Event","story":"at Bloomingdale's Chestnut Hill.","icon":"http:\/\/static.ak.fbcdn.net\/rsrc.php\/v2\/yW\/r\/r28KD-9uEMh.gif","actions":[{"name":"View","link":"\/events\/395547780505670\/"}],"type":"status","object_id":"395547780505670","created_time":"2012-08-04T01:38:01+0000","updated_time":"2012-08-04T01:38:02+0000","likes":{"data":[{"name":"Pei Hsieh","id":"100001162207361"}],"count":1},"comments":{"count":0}},{"id":"244108255703803_266615396786422","from":{"name":"Pink Tree Sweets","category":"Food\/grocery","id":"244108255703803"},"story":"Pink Tree Sweets updated their cover photo.","story_tags":{"0":[{"id":"244108255703803","name":"Pink Tree Sweets","offset":0,"length":16,"type":"page"}]},"picture":"http:\/\/photos-h.ak.fbcdn.net\/hphotos-ak-ash4\/304647_266615370119758_1284032870_s.jpg","link":"http:\/\/www.facebook.com\/photo.php?fbid=266615370119758&set=a.247197905394838.53979.244108255703803&type=1&relevant_count=1","icon":"http:\/\/static.ak.fbcdn.net\/rsrc.php\/v2\/yz\/r\/StEh3RhPvjk.gif","type":"photo","object_id":"266615370119758","created_time":"2012-08-04T01:22:06+0000","updated_time":"2012-08-04T01:22:06+0000","likes":{"data":[{"name":"Julina Lin","id":"1269492625"},{"name":"Victoria Shih","id":"1678335867"},{"name":"Pei Hsieh","id":"100001162207361"},{"name":"Andover Village Square","category":"Shopping\/retail","id":"160107984120070"}],"count":5},"comments":{"count":0}},{"id":"244108255703803_266190596828902","from":{"name":"Andover Village Square","category":"Shopping\/retail","id":"160107984120070"},"to":{"data":[{"name":"Andover Village Square","category":"Shopping\/retail","id":"160107984120070"},{"name":"Pink Tree Sweets","category":"Food\/grocery","id":"244108255703803"},{"name":"Pink Tree Sweets","category":"Food\/grocery","id":"244108255703803"}]},"message":"Andover Village Square welcomes Pink Tree Sweets to Andover!","message_tags":{"0":[{"id":"160107984120070","name":"Andover Village Square","type":"page","offset":0,"length":22}],"32":[{"id":"244108255703803","name":"Pink Tree Sweets","type":"page","offset":32,"length":16}]},"type":"status","created_time":"2012-08-02T18:03:04+0000","updated_time":"2012-08-02T18:03:04+0000","comments":{"count":0}},{"id":"244108255703803_265675846880377","from":{"name":"Pink Tree Sweets","category":"Food\/grocery","id":"244108255703803"},"message":"how about this one","type":"status","status_type":"mobile_status_update","created_time":"2012-08-01T03:32:33+0000","updated_time":"2012-08-01T03:32:33+0000","likes":{"data":[{"name":"Julina Lin","id":"1269492625"}],"count":1},"comments":{"count":0}},{"id":"244108255703803_265675296880432","from":{"name":"Pink Tree Sweets","category":"Food\/grocery","id":"244108255703803"},"story":"Pink Tree Sweets added 2 new photos.","story_tags":{"0":[{"id":"244108255703803","name":"Pink Tree Sweets","offset":0,"length":16,"type":"page"}]},"picture":"http:\/\/photos-a.ak.fbcdn.net\/hphotos-ak-ash4\/480992_265675183547110_993744837_s.jpg","link":"http:\/\/www.facebook.com\/photo.php?fbid=265675183547110&set=a.265675180213777.59277.244108255703803&type=1&relevant_count=2","icon":"http:\/\/static.ak.fbcdn.net\/rsrc.php\/v2\/yz\/r\/StEh3RhPvjk.gif","type":"photo","status_type":"added_photos","object_id":"265675183547110","created_time":"2012-08-01T03:29:18+0000","updated_time":"2012-08-01T03:29:18+0000","likes":{"data":[{"name":"Aaron Lai","id":"828628985"}],"count":1},"comments":{"count":0}},{"id":"244108255703803_258746250906670","from":{"name":"Pink Tree Sweets","category":"Food\/grocery","id":"244108255703803"},"message":"Pink Tree Sweets opening in Andover, Massachuseets soon!!!\n-admin\ncupcakes..... and more!!!! :) :O","type":"status","status_type":"mobile_status_update","created_time":"2012-07-11T01:32:27+0000","updated_time":"2012-07-11T01:32:27+0000","likes":{"data":[{"name":"Julina Lin","id":"1269492625"},{"name":"Jenny Tsai","id":"693948282"}],"count":2},"comments":{"count":0}}],"paging":{"previous":"https:\/\/graph.facebook.com\/244108255703803\/feed?access_token=OBFISCATED&limit=25&since=1347049287&__previous=1","next":"https:\/\/graph.facebook.com\/244108255703803\/feed?access_token=OBFISCATED&limit=25&until=1341970346"}}
i get the this exception (type IS == null):

if

 

(type == null

)

 

throw new Exception("Cannot determine type"

);

 

string typename = type.FullName;

 

is fastJSON just having a hard time deserializing this object ?