public function testsoap() { // $soaparray=array("uri"=>"http://10.155.30.170:8880/ws/order.php?wsdl",'soap_version' => SOAP_1_2); $soap = new \SoapClient(null, array("location" => "http://10.155.30.170:8880/ws/order", "uri" => "index.html", "style" => SOAP_RPC, "use" => SOAP_ENCODED)); echo $soap->Add(1, 2); unset($soap); }
<?php ini_set('soap.wsdl_cache_enabled', "0"); //关闭wsdl缓存 $soap = new SoapClient('http://basic.com/soap/Service.php?wsdl'); echo $soap->Add(28, 2); //echo $soap->__soapCall('Add',array(28,2))//或这样调用