1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
| <?php
require_once('../lib/nusoap.php');
//
$proxyhost = isset($_POST['proxyhost']) ? $_POST['proxyhost'] : '';
$proxyport = isset($_POST['proxyport']) ? $_POST['proxyport'] : '';
$proxyusername = isset($_POST['proxyusername']) ? $_POST['proxyusername'] : '';
$proxypassword = isset($_POST['proxypassword']) ? $_POST['proxypassword'] : '';
$client = new nusoap_client('http://www.webservicex.net/WeatherForecast.asmx?wsdl', TRUE);
$err = $client->getError();
if ($err) {
echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
}
//$Placename = "miami";
$result = $client->GetWeatherByPlaceName('miami');:mrgreen:
echo $client->Placename;
// $result = $client->getTimeZoneTime(array('timezone'=>'ZULU')); //works
// $result = $client->call(GetWeatherByPlaceName(array('Placename'=>'miami')));
// $result = $client->call('GetWeatherByPlaceName', array());
// $result = $client->call('GetWeatherByPlaceName', array('miami' => 'PlaceName'));
// $result = $client->call(GetWeatherByPlaceName(PlaceName="miami"));
// Check for a fault
if ($client->fault) {
echo '<h2>Fault</h2><pre>';
print_r($result);
echo '</pre>';
} else {
// Check for errors
$err = $client->getError();
if ($err) {
// Display the error
echo '<h2>Error</h2><pre>' . $err . '</pre>';
} else {
// Display the result
echo '<h2>Result</h2><pre>';
print_r($result);
echo '</pre>';
}
} |
Partager