IBM®
Skip to main content
    Country/region [select]      Terms of use
 
 
      
     Home      Products      Services & solutions      Support & downloads      My account     

IBM developerWorks : Web services : Web services demos
developerWorks
IBM Weather Forecast Web services application
e-mail it!
Contents:
What is the Weather Forecast demo?
Run the demo
Weather Forecast functions
Download the code and documentation
Prerequisites
Resources
Related content:
Subscribe to the developerWorks newsletter
Also in the Web services zone:
Tutorials
Tools and products
Articles
An IBM developerWorks Web services demo

May 2002

Need a Web service that pulls live information from the Web? See the Weather Forecast demo and download the code, tools, and documentation. Then you can use these as the basis for your own application.

What is the Weather Forecast demo?
Weather Forecast is a Web service that provides weather forecasts obtained in real time from the National Weather Service. It uses WebSphere Studio Application Developer to create and test the Web service. It also uses XML, Java technology, Web Services Description Language (WSDL), Simple Object Access Protocol (SOAP), and Universal Description Discovery and Integration (UDDI).

Run the demo
The Weather Forecast demo is available on our server.

Note:You'll need to have JavaScript enabled, and Internet Explorer 5.0 (or higher) or Netscape Communicator 4.5 (or higher).

Weather Forecast functions
When you run the Weather Forecast demo, you get access to several methods.

Note: The demo is case sensitive. State abbreviations should be capitalized (for example, CA for California) and the first letter of the city should be capitalized (for example, San Francisco). Also, only major US cities can be used for this demo.

To see a list of cities for which weather forecasts are available, invoke the getCities method. For Arizona, for example, you get the following list:
  • Flagstaff
  • Page
  • Phoenix
  • Prescott
  • Tucson
  • Winslow
  • Yuma

Then invoke the getForecast method for Phoenix, for example:
City Forecast for Phoenix, AZ
Issued Thursday afternoon - Apr 25, 2002
Low 64, high 92, sunny, 5% chance of precipitation.

The getState method is useful if you don't recall the two-letter abbreviation for a certain state.

Download the code and documentation
You'll need a Web-based application that you want to turn into a Web services-based application. You can then integrate the modified application into the aggregation demo provided in Weather Forecast. You must also have JavaScript enabled, JDK 1.2.2 or JDK 1.3, and Internet Explorer 5.0 (or higher) or Netscape Communicator 4.5 (or higher).

Make sure your machines are connected to the internet, since the demo sends a request to the National Weather Service. It's also a good idea to read the Task topic, "Developing Web Services," and the Samples topic, "Tutorial: Creating a Web service from a Bean," in the online help for WebSphere Studio Application Developer.

You can learn how to set up your environment and integrate an application with the the code and documentation which are located in this four part series, Web Services Development and Deployment with IBM Tools and Technologies, by Greg Flurry:

  • Part 1, introduces the concepts of developing a dynamic e-business application.
  • Part 2, shows how to use WebSphere Studio to publish the Web service in the UDDI Registry and find the Web service in the UDDI Registry. It also shows you how to import WSDL files and create a client of the published Web service.
  • Part 3, demonstrates how to use Application Developer to create and test a Web application that uses the Web service.
  • Part 4, demonstrates how to deploy the Web service into WebSphere Application Server 4.0 and access the deployed Web service from a Web application running in WebSphere Studio.

Prerequisites
You'll need at least .5 GB of free disk space and the following products and code.

Resources



e-mail it!

IBM developerWorks : Web services : Web services demos
developerWorks
  About IBM  |  Privacy  |  Terms of use  |  Contact