首頁 >後端開發 >php教程 >php SOAP WSDL简单应用实例

php SOAP WSDL简单应用实例

PHP中文网
PHP中文网原創
2017-03-13 14:09:391310瀏覽

php教程 SOAP WSDL简单应用实例

<?php
   $ws = "http://www.bkjia.com/sd/2001/TemperatureService.wsdl";
   $zipcode = "23590";
   $client = new SoapClient($ws,array(&#39;trace&#39; => 1));
   $temperature = $client->getTemp($zipcode);
   echo htmlspecialchars($client->__getLastRequest());
?>

获取soap发送的数据

<?php
   $ws = "http://www.bkjia.com/sd/2001/TemperatureService.wsdl";
   $zipcode = "12312";
   $client = new SoapClient($ws,array(&#39;trace&#39; => 1));
   $temperature = $client->getTemp($zipcode);
   echo htmlspecialchars($client->__getLastResponse());
?>

wdsl应用

<?php
   $ws = "http://www.bkjia.com/sd/2001/TemperatureService.wsdl";
   $client = new SoapClient($ws);
   var_dump($client->__getFunctions());
?>
陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn