forced2register
New Member
I just started to work with RestSharp and using the NextFlix API have been able to successfully create my Oauth tokens and request data from NetFlix. But for some reason I can not seem to create my objects to match the return XML correctly.My code:\[code\] var client2 = new RestClient("http://api-public.netflix.com") { Authenticator = OAuth1Authenticator.ForProtectedResource(MyOauth.ConsumerKey, MyOauth.ConsumerSecret, MyOauth.OauthToken, MyOauth.OauthTokenSecret) }; var request = new RestRequest("/catalog/titles/autocomplete"); request.AddParameter("term", "star wars"); var searchResults = client2.Execute<CatalogList>(request);\[/code\]My attempted object creation:\[code\] [XmlRoot("autocomplete")] public class CatalogList { public List<AutoCompleteItem> Titles { get; set; } } [XmlRoot("autocomplete_item")] public class AutoCompleteItem { [XmlElement("title short")] public string Title { get; set; } [XmlElement("short")] public string ShortName { get; set; } }\[/code\]serachresults returns 20 titles and my List has 20 entries, however the AutoCompleteItem is always empty. I've changed up the element names, attributes etc but never get the right combination.The XML that is returned looks like:\[code\]<?xml version="1.0" standalone="yes" ?> <autocomplete><url_template>http://api-public.netflix.com/catalog/titles/autocomplete?{-join|&|term} </url_template> <autocomplete_item><title short="Star Wars: Episode II: Attack of the Clones" /> </autocomplete_item>\[/code\]What am I missing here?Thanks,Jason