PEAR Forum :: PHP Extension and Application Repository

PEAR Forum Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Services_Weather error

 
Post new topic   Reply to topic    PEAR Forum Forum Index -> Web Services
View previous topic :: View next topic  
Author Message
sidkdbl07



Joined: 03 Sep 2009
Posts: 1

PostPosted: Thu Sep 03, 2009 10:50 pm    Post subject: Services_Weather error Reply with quote

I'm trying to get weather info but no matter how I try to set it up (METAR, Weatherdotcom, etc.) I get the same error. Am I missing a PHP or apache setting perhaps?

Quote:
Error: Services_Weather (Weather.php:161): Requested service could not be found.


Here is my code (very similar to the example in docs/Services_Weather/examples/weather.com-basic.php)



Code:
<?php
header('Content-Type: text/javascript');
header('Cache-Control: no-cache');
header('Pragma: no-cache');

include('PEAR/Services/Weather.php');

$weather = Services_Weather::service("WeatherDotCom", array("debug" == 2, "httpTimeout" => 30)); if(Services_Weather::isError($weather)) {
  die("Error: ".$weather->getMessage()."\n");
}
echo "hey";

$weather->setAccountData("1136608212", "8191fde815d2f7d8");
$weather->setUnitsFormat("metric");

$search = $weather->searchLocation("Calgary, CANADA");
if(Services_Weather::isError($search)) {
  die("Error: ".$search->getMessage()."\n");
}
 
foreach(array("getLocation", "getWeather", "getForecast") as $function) {   $data = $weather->$function($search);
  if(Services_Weather::isError($data)) {
    echo "Error: ".$data->getMessage()."\n";
    continue;
  }
   
  var_dump($data);
}
?>
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    PEAR Forum Forum Index -> Web Services All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



PEAR Forum topic RSS feed 
Powered by phpBB © 2001, 2005 phpBB Group

Provided by Ministry of Web developement