当前位置:Gxlcms > PHP教程 > php-各位大虾们,帮帮忙吧!不知道错在哪里?

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

时间:2021-07-01 10:21:17 帮助过:28人阅读

php参数传递webservice

addclass.php
class addclass{

public function add($x,$y){return $x+$y;}

}
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;
}
?>

人气教程排行