Home >Backend Development >PHP Tutorial >php SOAP WSDL simple application example

php SOAP WSDL simple application example

PHP中文网
PHP中文网Original
2017-03-13 14:09:391268browse

php tutorial SOAP WSDL simple application example

<?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());
?>

Get the data sent by 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 application

<?php
   $ws = "http://www.bkjia.com/sd/2001/TemperatureService.wsdl";
   $client = new SoapClient($ws);
   var_dump($client->__getFunctions());
?>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn