php利用SoapClient调用webservices

1.开启soap支持,在php.ini中去除extension=php_soap.dll以前的‘;’php


2.掉用页面html

<?phpweb

header('Content-Type: text/html; charset=UTF-8');ide

$client = new SoapClient('http://webservice.webxml.com.cn/WebServices/MobileCodeWS.asmx?WSDL');xml

$parm=array('mobileCode'=>'13782149159','userID'=>'');htm

$result=$client->getMobileCodeInfo($parm);get

$result=get_object_vars($result);   //将stdclass object转换为array,这个比较重要了webservice

echo "你的手机卡信息:".$result['getMobileCodeInfoResult'];it

?>io

就这么简单了。。

相关文章
相关标签/搜索