package org.globus.ogsa.impl.samples.google.client; import org.globus.ogsa.samples.google.GoogleSearchPort; // Grid Service Port Type import org.globus.ogsa.samples.google.GoogleSearchServiceLocator; // Grid Service Locator import java.net.URL; public class DoSpellingSuggestion { public static void main(String[] args) { GoogleSearchServiceLocator googleSearchService = new GoogleSearchServiceLocator(); if (args.length < 2) { System.err.println("usage: DoSpellingSuggestion "); return; } try { // Create a new instance of the Google Search Service Port Type. // The service is found using the Google Search Service Locator and the input URL. GoogleSearchPort googleSearch = googleSearchService.getGoogleSearchPort(new URL(args[0])); // Call the method 'doSpellingSuggestion' by giving a key and input phrase. String phrase = googleSearch.doSpellingSuggestion("wMFVucygk0f60Sw+/NjpM3TXw4lGb33P", args[1]); // Display the output, i.e. the phrase with the suggested spelling. System.out.println("Suggested Phrase:" + phrase); } catch (Exception e) { e.printStackTrace(); } } }