import org.wso2.ns._2007.yahoo.srch.YahooSearchStub; import org.wso2.ns._2007.yahoo.srch.types.FormatType; import org.wso2.ns._2007.yahoo.srch.types.LanguageType; import org.wso2.ns._2007.yahoo.srch.types.SearchString; import org.wso2.ns._2007.yahoo.srch.types.SearchString0; import srch.yahoo.ResultSet; import srch.yahoo.ResultType; import java.math.BigInteger; public class Main { public static void main(String[] args) throws Exception { YahooSearchStub stub = new YahooSearchStub("http://search.yahooapis.com/WebSearchService/V1/webSearch"); SearchString0 s = new SearchString0(); SearchString s1 = new SearchString(); s.setSearchString(s1); s1.setQuery("wso2"); s1.setSearchString("webSearch"); s1.setAppid("YahooDemo"); s1.setStart(new BigInteger("0")); s1.setResults(new BigInteger("10")); s1.setFormat(FormatType.all); s1.setSimilar_ok("1"); s1.setAdult_ok("0"); LanguageType l = new LanguageType(); l.setLanguageType("en"); s1.setLanguage(l); ResultSet set = stub.YahooSearch(s); ResultType results[] = set.getResult(); for (int i = 0; i < results.length; i++) { System.out.println("[" + i + "]: " + results[i].getDisplayUrl()); } } }