1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
<?php
require_once ('lib/nusoap.php');
$ns="http://localhost:8080/mobile/";
$serveur = new soap_server();
$serveur->configureWSDL('meteoo',$ns);
$serveur->wsdl->schemaTargetNamespace=$ns;
$serveur->register('meteoo',array('CityName'=> 'xsd:string','CountryName'=>'xsd:string'),array('return'=>'xsd:Array'),$ns);
function meteoo ($CityName, $CountryName)
{
$wsdl ='http://www.webservicex.net/globalweather.asmx?WSDL';
$client = new nusoap_client($wsdl,true);
$parametres = array('CityName'=>$CityName,'CountryName'=>$CountryName);
$requst =$client->call('GetWeather', $parametres);
return new soapval('return','xsd:Array',$requst);
}
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA)? $HTTP_RAW_POST_DATA : '';
$serveur->service($HTTP_RAW_POST_DATA);
?> |
Partager