CMSC 498B: Developing User Interfaces - Spring 2005

Web Services

Web Services

How to provide remote procedure access on the web in a multi-platform way?

  • Use lowest-common denominator technology
  • Transmission protocol: HTTP
  • Language encoding: XML

Uses two specialized XML languages:

  • WSDL - Web Services Description Language - Says what a web service offers
  • SOAP - Simple Object Access Protocol - Calls a web services and returns results, encoding paramters, return values, etc. in XML

Show how to access Google web service

  1. Create new project
  2. Add web reference to http://api.google.com/GoogleSearch.wsdl
  3. Create simple form with key, search box, go button, and results window
  4. First do sync search with GoogleSearchService.doGoogleSearch
  5. Then do aync search with GoogleSearchService.BegindoGoogleSearch
    The trick is to specify the search object as the last parameter so it gets passed back to the callback
    Ex: search.BegindoGoogleSearch(keyBox.Text, searchBox.Text, 0, 10, true, "", false, "", "", "", new AsyncCallback(Callback), search);

Details at http://api.google.com