amoghrpurohit / yahoo-finance-managed

Automatically exported from code.google.com/p/yahoo-finance-managed
0 stars 0 forks source link

401 when accessing News #37

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
trying to access NewsSearch however I am getting a 401 un autherised message ?

however when i query the websearch I get results back.

Do I need to grant permissions in my yahoo application in the yahoo web site ?

  var dl = new SearchDownload();
            Results = new List<IBaseSearchResult>();
            var culture = new Culture(Language.en, Country.UK);
            string queryText = "bob diamond barclays capital";
            SearchOptions = new List<SearchOptions>();

            #region searchDownload
            dl.UniversalOptions.HttpsUsed = false;
            dl.UniversalOptions.ConsumerKey = ConsumerKey;
            dl.UniversalOptions.ConsumerSecret = new System.Security.SecureString();
            foreach (char c_loopVariable in ConsumerSecret)
            {
                dl.UniversalOptions.ConsumerSecret.AppendChar(c_loopVariable);
            }
            dl.UniversalOptions.ConsumerSecret.MakeReadOnly();
            dl.Proxy = new WebProxy("app-proxy.mydomain.com", 8080) { UseDefaultCredentials = true };

 var newsSearch = new NewsSearchOptions
            {
                AlwaysLatestDateNow = true,
                Count = 10,
                //Culture = culture,
                QueryText = queryText,

            };
SearchOptions.Add(newsSearch);

Original issue reported on code.google.com by 16thJanu...@gmail.com on 15 Mar 2012 at 4:11

GoogleCodeExporter commented 8 years ago
an update to the problem, If I have a list of search options i.e.
SearchOptions = new List<SearchOptions>();

and I add a WebSearchOptionClass i.e. SearchOptions.Add(webSearchOptions);

Then call the download I get my resutls. i.e. 
SearchResponse resp = dl.Download(SearchOptions);

Again if i add just NewsSearchOptions to the list I also get results. i.e.
SearchOptions.Add(newsSearchOptions);
SearchResponse resp = dl.Download(SearchOptions);

However if i add both I get a 401 error message ? Is this expected ?
SearchOptions.Add(newsSearchOptions);
SearchOptions.Add(webSearchOptions);
SearchResponse resp = dl.Download(SearchOptions);

Original comment by 16thJanu...@gmail.com on 16 Mar 2012 at 8:36

GoogleCodeExporter commented 8 years ago
I will have a look on this issue. Could take some days, because at the moment 
I'm in holidays.
Which version do you use?

greetz

Maas

Original comment by Maas...@gmail.com on 16 Mar 2012 at 9:11

GoogleCodeExporter commented 8 years ago
This issue will be fixed in next version.

greetz

Maas

Original comment by Maas...@gmail.com on 22 Mar 2012 at 2:45

GoogleCodeExporter commented 8 years ago

Original comment by Maas...@gmail.com on 22 Mar 2012 at 3:22