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

首页 >后端开发 >php教程 >php-各位大虾们,帮帮忙吧!不知道错在哪里?

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

WBOY
WBOY原创
2016-06-02 11:34:46866浏览

php参数传递webservice

addclass.php
class addclass{

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

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

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn