My first Web Service experience
I'm a software engineer, and deal with C++ everyday. While it is fun, I have to admit I'm somewhat far from up-to-date topics such as "Web Service".
In this president day weekend, I had a chance to jump into it. And, it was fantastic experience to know what is "Web Service". In short, "Web Service" enables me to access services of the Web site programatically.
The first thing I did was going to Google and got Google API.
http://www.google.com/apis/
I think what the API does explains what is "Web Service" very well. It allows me to use Google Search engine through my program.
The API comes with WSDL file. Actually, I don't know what is it exactly yet, but it seems to describe:
- What kinds of methods does Google exposes to us?
- How to use these methods? What Parameters, What return type, etc.
using System; public class GoogleSpell { static public void Main(){ GoogleSearchService service = new GoogleSearchService(); string result = service.doSpellingSuggestion("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "atmosphire"); Console.WriteLine(result); } }Then compile the code with GoogleSearchService.cs, and run. Google checks the wrong spelling "atmosphire" and correct it to "atmosphere". Wow. It is that easy!
0 Comments:
Post a Comment
<< Home