简介:这是php+soap 入门的详细页面,介绍了和php,有关的知识、技巧、经验,和一些php源码等。 class='pingjiaF' frameborder='0' src='http://biancheng.dnbcw.info/pingjia.php?id=335098' scrolling='no'> 通过开放的webservice获取天气预报数据
php
$c = new SoapClient( 'http://www.webxml.com.cn/WebServices/WeatherWS.asmx?wsdl',
array( 'trace' => true, 'exceptions' => true ) );//var_dump( $c->__getFunctions() );
//var_dump( $c->__getTypes() );
//不需要参数的情况
$pr =$c->getRegionProvince();
//var_dump( $pr->getRegionProvinceResult->string );
//带有参数的情况
$scs = $c->getSupportCityString( array( 'theRegionCode' => '福建' ) );
var_dump( $scs->getSupportCityStringResult->string );
var_dump($scs);
//也可以这样做
$we = $c->__call('getWeather', array( array( 'theCityCode' => 2210) ) );
var_dump( $we );
?> soapserver和soapclient简单实现
soapclient
php
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
$ss = new SoapClient( null, array( 'uri' => 'http://zendstudio.net', 'location' => 'http://localhost/soaptest/soapserver.php' ) );
$header = new SoapHeader( 'zendHeader', 'mmcYY', '12345678' );
$ss->__setSoapHeaders( $header );
echo $ss->im8( 'gently' );
?>
soapserver 写道
“php+soap 入门”的更多相关文章 》
爱J2EE关注Java迈克尔杰克逊视频站JSON在线工具http://biancheng.dnbcw.info/php/335098.html pageNo:10
本文原创发布php中文网,转载请注明出处,感谢您的尊重!