1、server.php
2、client.php
function getName() {
return 'test';
}
$soapServer = new SoapServer(null, array(
'uri' => 'http://demo1/soap')
);
$soapServer->addFunction('getName');
$soapServer->handle();
2、client.php
$soapClient = new SoapClient(null, array(
'location' => 'http://demo1/soap/server.php',
'uri' => 'http://demo1/soap'
));
$result = $soapClient->getName();
echo $result;