Keyword Services Platform

Keyword Services Platform

using (KeywordServer server = new KeywordServer("https://ksp.microsoft.com")) {
  server.UserName = "username"; 
  server.Password = "********"; 
  ITermForecast provider = null; 

  try {
    server.Open(); 
    // Context can be set if needed. It will remain during the following calls. 
    provider = server.GetProviderByImplementation<ITermForecast>("Microsoft.adCenterLabs.Providers.KeywordForecastProvider"); 
    if (provider != null) {
      // Single mode API 
      DataTable result = provider.GetTermForecast(term, -5, 3); 
      DisplayResults(result); 

      // Batch mode API 
      result = provider.GetTermForecast(terms, -5, 3); 
      DisplayResults(result); 
    } 
  } 
  catch (FaultException) {
    // Handle fault returned from calling the proxy method 
  } 
  catch (CommunicationException) { 
    // Handle lost network connection error 
  } 
  catch (TimeoutException) { 
    // Handle time-out error 
  } 
  finally { 
    if (provider != null) 
      server.ReleaseService(provider); 
  } 
}
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s