handle(); ?> client.php add(7,8); //echo $client->__soapCall("add", array(7, 8)); }catch (SoapFault $e){ echo $e; } ?> "/> handle(); ?> client.php add(7,8); //echo $client->__soapCall("add", array(7, 8)); }catch (SoapFault $e){ echo $e; } ?> ">
Home > Backend Development > PHP Tutorial > php-各位大虾们,帮帮忙吧!不知道错在哪里?

php-各位大虾们,帮帮忙吧!不知道错在哪里?

WBOY
Release: 2016-06-02 11:34:46
Original
866 people have browsed it

php参数传递webservice

addclass.php
class addclass{

<code>public function add($x,$y){return $x+$y;}</code>
Copy after login

}
server.php

require "addclass.php";
$soap = new SoapServer('test.wsdl');
$soap->setClass("addclass");
$soap->handle();
?>
client.php
try{
$client = new SoapClient("test.wsdl");
echo $client->add(7,8);
//echo $client->__soapCall("add", array(7, 8));

}catch (SoapFault $e){
echo $e;
}
?>

Related labels:
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template