自己写的欢迎指正,soap如何调用thinkphp3.2
namespace home\controller;
use think\controller;
class indexcontroller extends controller {
public function index(){
$host = $_server['http_host'];
$module = module_name;
$action = action_name;
$server=;
$wsdl=;
$soaparray=array(location=>http://.$host./.$module./.$action,uri=>$action..html);
$server= new \soapserver(null,$soaparray);
$server->setclass(get_class($this));
$server->handle();
}
public function add($a,$b)
{
return $a+$b;
}
public function testsoap(){
$soap = new \soapclient(null,array( location => http://yourhost/index/index,uri=> index.html, style => soap_rpc, use => soap_encoded));
echo $soap->add(1,2);
unset($soap);
}
}
ad:真正免费,域名+虚机+企业邮箱=0元