Sunday, June 27, 2010

7 Days Weatherforecast Application

I have develop silverlight application which will display the 7 day forecast of given city.I was thinking of this application long time ago but I have not developed it because of some reason but now after some research and time I have develop it and here is my application for you. Below is the screen shot of the main form which will display the weather forecast for a given city code. I have used the weatherBug web service which are free to use. You have to registered with the weather bug and they will send you the key and the resource link for your use.

For the registration for the weather bug web site you need to visit following link here you can click on the Register link and your registration will start. After accepting the terms and condition and selection one of the the web service usage option you can click on the submit button.
In the next page they will ask about the detail of the you, mean your name , email address, company name , address and country you can click to the submit button. when you click on the save button they (weather bug) will send you email for confirmation. when you click on the verification link in the email they(weather bug) will send you another email for the application code and the documentation links.
For this application I have created web service in the web application of the the silverlight application, so that to communicate with the weather bug services because silverlight doesn't support cross domain web service references so we have to make an adapter web service in our web application and link it to the Silverlight app. For detail of how to consume the web service in the silverlight application check this link.
For this application to run, the web service "WeatherService" in the application should be running as it has to communicate with the weather bug service. You can open the solution file of the project and press the F5 , and both the service and the application will run at the same time.
Some detail about the application I have placed one text box and the search button to search with any of the city code and also place some of the city code beneath the text box control so that you can also select from the list as well. You can download the source code from here. You can also download full source code from here ( key is not provided in full source code)
All and any comments / bugs / suggestions are welcomed!

20 comments:

Anonymous said...

where do we get city codes?
thanks,
Waqar

Asim Sajjad said...

@Waqar: I have downloaded from weatherbug site but didn't know exactly. I will search again and will tell you

Asim Sajjad said...

@Waqar: you can download it from this link
http://weather.weatherbug.com/corporate/products/API/help.aspx#getstationlistbycitycode

here you can click on the "Complete List of City Codes" to download the list

sem said...

where is the .xaml code please for the interface

thank you

Asim Sajjad said...

@Sem: I have not uploaded the xaml of the project as It containt the key for login to access the weather service.

moly said...

the city codes link doesn't work , please help!

Asim Sajjad said...

@moly: I have open the city codes link it is working. what error it gives ?

hiho said...

May you send me the xaml file wizout the key I already have a key but I am in very bad need to it :) thanQ in advance
here is my email address
Ahmad.saaad@gmail.com

moly said...

it gives page error, any way the site support sent me the codes and will solve the link issue.

moly said...

Asim, please send me the xaml file and hide your key or put xxxxx. my mail is egmoly@hotmail.com

m said...

Asim, please upload the xaml file and hide your key or put xxxxx. I need it

Anonymous said...

@Waqar: if u want the codes write ur mail and I will send it to u.

Asim Sajjad said...

Ok I will try to upload the code without key and let you know.

moly said...

thank you Asim.

Asim Sajjad said...

@moly: I have inserted link for the full source code you can download it from end of the post where old link to download the example was given.

moly said...

@Asim: thank you very much, that is really helpful

Asim Sajjad said...

@moly: you are welcome. Happy to see that I help someone :)

Ways and Means said...

7 Days Weatherforecast Application
is very nice.I like it.Thanks for sharing.

Ways and Means said...

7 Days Weatherforecast Application
is very nice.I like it.Thanks for sharing.

sydney 7 day forecast said...

Even disasters that are not natural may still have an effect on the environment. Nuclear power plants that may have been leaking or blown up may cause disastrous changes to the environment.