PHP soap 經典實例

$c = new SoapClient('http://webservice.webxml.com.cn/WebServices/WeatherWS.asmx?wsdl');

echo "</br>";

//$array = $c->__getTypes();

$obj = $c->getWeather(array('theCityCode'=>'792'));

$getWeatherResult = $obj->getWeatherResult;

$info = $getWeatherResult->string;

echo "</br>";

foreach($info as $str)

{

    echo $str;

    echo "</br>";

}

 

獲取北京天氣情況。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章