代码如下:
1 2 3 4 5 | $ws = "http://webservice.webxml.com.cn/WebServices/WeatherWebService.asmx?wsdl" ; $client = new SoapClient( $ws , array ( 'trace' =>0, 'uri' => ' http://WebXml.com.cn/' )); $param [ "theCityName" ]= '北京' ; $rs = $client ->__call( 'getWeatherbyCityName' , array ( $param )); $result = ( array ) $rs ->getWeatherbyCityNameResult->string; |