Consuming a Web Service Sample

To get samples and instructions for installing them, see the following:

  • Click Samples on the Visual Studio Help menu.

    For more information, see Locating Sample Files.

  • The most recent versions and the complete list of samples are available on the Visual Studio 2008 Samples Web site.

  • You can also locate samples on your computer's hard disk. By default, samples and a Readme file are copied to a folder under \Program Files\Visual Studio 9\Samples\. For Visual Studio Express Editions, all samples are located on the Internet.

To run this sample

  • Press F5.

Requirements

This application requires the Microsoft Universal Description Discovery and Integration (UDDI) SDK 1.76, which can be downloaded from: http://msdn.microsoft.com/library/en-us/dnanchor/html/anch_uddi.asp?frame=true

Demonstrates

A TabControl provides five different examples of Web service consumption.

  • Get the local date and time based on a U.S. ZIP code (http://www.ripedev.com/webservices/LocalTime.asmx)

  • Convert Euro dollars into any of the 12 ECC-member nation currencies (http://www.xml-webservices.net/services/conversions/euro_convert/euro_conver.asmx).

  • Look up sales rank and price information for any book from Amazon and Barnes & Noble by entering an ISBN number (http://www.perfectxml.net/WebServices/SalesRankNPrice/BookService.asmx).

  • Get the current weather conditions for any U.S. Zip code (http://www.learnxmlws.com/services/weatherRetriever.asmx).

  • View the Dilbert cartoon-of-the-Day from the Daily Dilbert Web service. This example invokes the Web service asynchronously (http://www.esynaps.com/WebServices/DailyDilbert.asmx).

  • See how UDDI can be used to handle Web service Url errors, allowing you to implement a "fallback plan" (http://www.vbws.com/services/ServerTime.asmx). Status messages and error messages within structured error handling are used to inform the user during the data retrieval process.

These real-world Web services are found on http://www.xmethods.com/.