第一次用,通过,还没深入了解。
首先在php.ini中启用extension=php_soap.dll,重启apache.
1 $Client=new SoapClient("url?wsdl"); 2 3 if($Client){ 4 //解决中文乱码问题 5 $client->soap_defencoding = 'utf-8'; 6 $client->decode_utf8 = false; 7 $client->xml_encoding = 'utf-8'; 8 9 $param=array('name'=>"test","pass"=>'4124'); 10 try{ 11 $result=$Client->__soapCall("login",array("parameters"=>$param)); 12 print_r($result); 13 }catch(Exception $e){ 14 echo $e->getMessage(); 15 } 16 }else{ 17 echo "no"; 18 }