Saturday, July 21, 2012

Creating Weather web part for share point 2010

Few days back while working with client got one requirement  that they want the weather information  to be get displayed on their site. So I did some goggling around this problem but I haven't found  any good help from internet. There are some third party web parts  available but we want to develop some configurable UI and want to implement reusable component. So I thought to create SL application by consuming the weather web service.

The point here is that there are some free weather web service available but those only give the weather information of only specific country by there pin code. And we want to implement some thing that which can be used in any continent apart from country or region. So we decided to go for commercial weather service.
We can get whole week weather information from the weather web service and once the information is in our application just need to explore through it and put the images and values of the weather as adding some filter as per the data received from service  and you have SL weather web part ready with accurate data for your site...!

I am giving some steps here for  how to add the weather web service and use it in your SL application.

1. Create the SL application from VS 2010




2. Once the application is ready just add the web service in service reference and creates its proxy.



3. When service is added and you have its object created in your mainpage.cs file then just you have to create now the handler and execute it as given below. I have not given the whole code of binding the e.result data to the xaml. I think you are so smart to do that..   :)



4. Once every thing is done with binding and testing just upload the xap to any library  and  put it in SL div in aspx page by passing the proper address of xap or use SL web part. Any thing which you find simple is Ok.

5. And your weather web part is ready to use in your application.





Its very simple to use in any application. feel free to ask any queries.    :)









1 comment:

Anonymous said...

can you tell me which web service you used to get the 5 day feed. Also whether it is paid or free.