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参数传递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;
}
?>