欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

php SOAP WSDL简单应用实例

程序员文章站 2022-05-13 12:59:09
...
php教程 SOAP WSDL简单应用实例
<?php
   $ws = "http://www.bkjia.com/sd/2001/TemperatureService.wsdl";
   $zipcode = "23590";
   $client = new SoapClient($ws,array('trace' => 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('trace' => 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());
?>