Weather Web Part Error: "Bad or missing query parameters in request."

Feb 2, 2009 at 11:33 AM
Hi,
I have downloaded the Weather Web Part, followed the instructions in setup.bat to install it and it shows up in the "Edit Page" > "Add a Web Part" dialog, but when I add it to the page i get the error: "Bad or missing query parameters". What might have gone wrong?

Thanks,
George
Feb 11, 2009 at 10:19 PM
An update to get this web part working as of 12/9/2008.

1) There is a bug in the code. You need to change the reqUrl variable which holds the URL that is accessed to get the weather XML data from and add a URL parameter link=xoap and then recompile the code. You'll get the "Bad or missing query parameters in request" until you make this change. If you're in there changing the reqUrl variable, you might want to change the default UserLocation and UserCountry that in various spots in the code to whatever makes sense as a default for you. The reqUrl variable is in the "./Source Code/SharePoint Buzz Weather Web Part/SharePoint Buzz Weather Web Part/SharePoint Buzz Weather Web Part/SharePoint Buzz Weather Web Part.cs" file. The variable declaration looks like:

               String reqUrl = "http://xoap.weather.com/weather/local/" + GetLocaleID() + "?cc=*&dayf=" + ConfigurationSettings.AppSettings.Get("ExtForecastLength") + "&prod=xoap&par=" + ConfigurationSettings.AppSettings.Get("PartnerID") + "&key=" + ConfigurationSettings.AppSettings.Get("LicenseKey");

and should be changed to:

               String reqUrl = "http://xoap.weather.com/weather/local/" + GetLocaleID() + "?cc=*&dayf=" + ConfigurationSettings.AppSettings.Get("ExtForecastLength") + "&prod=xoap&link=xoap&par=" + ConfigurationSettings.AppSettings.Get("PartnerID") + "&key=" + ConfigurationSettings.AppSettings.Get("LicenseKey");

2) You need to register and get an XML feed partner ID and license key from weather.com. The URL for that is not the one from sharepointbuzz above (at least not any more). You can register with them at http://www.weather.com/services/xmloap.html. They will e-mail you the partner ID and license key, so you don't need to dig it out of wx_config (the license key isn't in wx_config anyways).

3) To plug in your weather.com license key and partner id, you'll need to open up the web.config file for your SharePoint site (if you read the documentation for this webpart,, it will be the same web.config file that you needed to add the <safecontrol> tag to) and add two keys into the <appSettings> element (if you don't have an <appSettings> element, then create one and put the following tags): <add key="PartnerID" value="<your weather.com partner id goes here>" /> <add key="LicenseKey" value="<your weather.com license key goes here>" /> 3) Be aware that the way this control determines the location to display weather for is by looking at the SharePoint user's "WorkCity" and "WorkCountry" SharePoint profile properties. These may or may not be filled in your organization (they weren't in mine) and they also may or may not be mapped to active directory properties. 4) Now the weather web part should work, but the terms and conditions of weather.com require that you cache data that you pull from them in various ways (you can pull current conditions more often than the 5 day forecast, for example) which is not being done by this control, so you'll be in violation of those TOS.