自己写的欢迎指正,soap如何调用thinkphp3.2namespace Home\Controller;<br>
use Think\Controller;<br>
class IndexController extends Controller {<br>
public function index(){ <br>
$host = $_SERVER['HTTP_HOST']; <br>
$module = MODULE_NAME; <br>
$action = ACTION_NAME;<br>
$server="";<br>
$wsdl=""; <br>
$soaparray=array("location"=>"http://".$host."/".$module."/".$action,"uri"=>$action.".html");<br>
$server= new \SoapServer(null,$soaparray); <br>
$server->setClass(get_class($this)); <br>
$server->handle(); <br>
<br>
} <br>
public function Add($a,$b)<br>
{<br>
return $a+$b;<br>
}<br>
public function testsoap(){<br>
$soap = new \SoapClient(null,array( "location" => "http://yourhost/index/index","uri"=> "index.html", "style" => SOAP_RPC, "use" => SOAP_ENCODED));<br>
echo $soap->Add(1,2);<br>
unset($soap); <br>
}<br>
}
AD:真正免费,域名+虚机+企业邮箱=0元