Web Services Tutorial : Weather Forecast Application



This is my first tutorial in my blog imbeginner for developing the desktop application. In this tutorial I am going to tell u how to develop simple Global Weather Forecast application in C#.
Application Name: Global Weather Forecast .
Requirement:
Visual studio 2005/2008(Developer).
.net framework 2.0 (For End-user) .
Internet Connection
Getting Started:
Before getting started I m assuming that the reader have some basic knowledge about programming and Microsoft Technology (.Net) .If you don’t know about .net then just follow my article. In this project our aim is to get weather forecast anywhere around the world. So we need a service which provide weather information and also must be free of cost. So here comes Web Service.
Web Services : Web services are typically application programming interfaces (API) or Web APIs that are accessed via Hypertext Transfer Protocol (HTTP) and executed on a remote system hosting the requested services.
After surfing over internet I came across one web service which is perfect for our project The Web Service is Global weather web service and it is provided by Webservicex.net

Creating New Project:
1.Start Visual Studio. In this example I am using Studio 2008.But you can user 2005 also.







2. Select C# Windows Application Form and Studio 2005 select Other languages to get view C# Form.







3. You Will get an emty form in your screen.









Adding Control to Form:
Global weather Web service gives us following information after calling it.
Location,Time,Wind,Visibility,SkyCondition,Temperature,DewPoint,Relative Humidity,Pressure,Status
But before that we will add controls to our form from the toolbox which is present at right side. You can also access toolbox from View ->Toolbox.
Common Controls:
13 Labels, 11Textbox, 2Buttons, Weather Images and icons.After some minor arrangement i got this..
My Final Form:












Coding Section:
Now we will take the web reference of the web service.To add web reference right click on the project solution and select add web reference.

















Windows will popup asking for the url of the webservice.In our project the url is
http://www.webservicex.net/WCF/ServiceDetails.aspx?SID=48.
Paste url in the textbox & click go. Aftersome time u will get service found message as given.Click on
Add reference



















Now check out web references folder added or not. If added means web service is added in our project. If Not then try again. This global Web Service needs 2 parameters
City Name, Country Name for that we already created 2 textboxes.

posted under , , |

1 comments:

Anonymous said...

Where is the rest tutorial? Would love to see it completed and update for .NET4

Newer Post Older Post Home

We have seen by

    Followers

    Translate


Recent Comments