Click here to Skip to main content
15,892,797 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I'm trying to consume Microsoft Azure Text Analytic service (https://goo.gl/ejaqMA[^]) whose document can be found at https://goo.gl/SBdH4H[^]

I'm using the following code

C#
try
           {
               var actionURI = new Uri("https://api.datamarket.azure.com/data.ashx/amla/text-analytics/v1/GetKeyPhrases");
               DataServiceContext context = new DataServiceContext(actionURI);
               var accountKey = "testkey";
               var cred = new NetworkCredential(accountKey, accountKey);
               var cache = new CredentialCache();
               cache.Add(actionURI, "Basic", cred);
               context.Credentials = cache;

               DataServiceQuery<string> query = context.CreateQuery<string>("GetKeyPhrases");
               query.AddQueryOption("Text", string.Concat("\'", System.Uri.EscapeDataString("Hello World"), "\'"));

               List<string> test = query.Execute().ToList<string>();

           }
           catch (Exception ex)
           {
               Console.WriteLine(ex.Message);
           }


But I'm always getting the following error after the Execute() method

InnerException = "The request was not accepted by the data provider's service. The team is investigating the issue. We are sorry for the inconvenience."

Can anyone please point me where I'm making the mistake?
Posted
Updated 30-Jun-15 0:50am
v4

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900