PHP调用WebService(WSDL)的简单demo

<?php

//header("Content-Type: text/html; charset=utf-8");

$client = new SoapClient("http://www.webxml.com.cn/WebServices/WeatherWebService.asmx?WSDL");
$client->soap_defencoding = 'utf-8';
$client->xml_encoding = 'utf-8';   

/*
echo "<pre>";
var_dump($client->__getFunctions());
echo "</pre>";
*/

$param = array('theCityName'=>"南阳");
$result = $client->__Call('getWeatherbyCityName',array('paramters'=>$param));

echo "<pre>";
print_r($result);
echo "</pre>";


?>