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

php SOAP WSDL simple application example

PHP中文网
Release: 2023-02-28 19:26:01
Original
1304 people have browsed it

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

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

wdsl application

<?php
   $ws = "http://www.bkjia.com/sd/2001/TemperatureService.wsdl";
   $client = new SoapClient($ws);
   var_dump($client->__getFunctions());
?>
Copy after login
source:php.cn
Statement of this Website
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
Latest Articles by Author
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template