php实现soap简单示例代码

来源:互联网 发布:酷开下载软件 编辑:程序博客网 时间:2024/06/06 02:39
1、server.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;
0 0
原创粉丝点击