Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8527383
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T08:32:32+00:00 2026-06-11T08:32:32+00:00

I just started to work with RestSharp and using the NextFlix API have been

  • 0

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:

    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);

My attempted object creation:

  [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; }
    }

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:

<?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>

What am I missing here?

Thanks,

Jason

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T08:32:34+00:00Added an answer on June 11, 2026 at 8:32 am
    [XmlRoot("autocomplete")]
    public class AutocompleteList
    {
        [XmlElement("url_template")]
        public string UrlTemplate { get; set; }
    
        [XmlElement("autocomplete_item")]
        public List<AutocompleteItem> Items { get; set; }
    }
    
    public class AutocompleteItem
    {
        [XmlElement("title")]
        public Title ItemTitle { get; set; }
    }
    
    public class Title
    {
        [XmlAttribute("short")]
        public string Short { get; set; }
    }
    

    The inner Title type is necessary to be able to capture the XML attribute short=.

    string xml = @"<?xml version=""1.0"" standalone=""yes"" ?>
    <autocomplete>
        <url_template>http://api-public.netflix.com/catalog/titles/autocomplete?{-join|&amp;|term}</url_template>
        <autocomplete_item>
            <title short=""Star Wars: Episode II: Attack of the Clones"" />
        </autocomplete_item>
    </autocomplete>";
    
    var reader = new StringReader(xml);
    var ser = new XmlSerializer(typeof(AutocompleteList));
    
    var result = (AutocompleteList) ser.Deserialize(reader);
    

    This produces the same result as

    var result = new AutocompleteList
    {
        UrlTemplate = "http://api-public.netflix.com/catalog/titles/autocomplete?{-join|&|term}",
        Items = new List<AutocompleteItem>
        {
            new AutocompleteItem
            {
                ItemTitle = new Title
                {
                    Short = "Star Wars: Episode II: Attack of the Clones",
                }
            },
        },
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just started to work on informix.( I have been using mysql all my
I've just started using SQL, so that have no idea how t work with
I have an issue at work where we have just started using scrum as
At work we have just started developing in C#.NET using VS2008 and we need
I just started to work with Lync API using SDK. Is it possible to
At work we have just started using CodedUI, in our product there are a
I have just started work on asmall program that sends text over net (TON)
At work I just started using Subversion with AnkhSVN instead of Visual Source Safe.
I've just started to work with DoubleClick Studio . I've successfully created a Flash
I have just started to work with jquery so I need to make sure

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.