'UTF-8'));$soap->setClass('">
时间:2021-07-01 10:21:17 帮助过:7人阅读
require_once "../views/config.inc"; // 只要加上一个就报错,用include也一样,其中config.inc 文件很简单加上就报错
$soap = new SoapServer(null,array('uri'=>"http://xxxxxx.com.cn/",'encoding'=>'UTF-8'));
$soap->setClass('user');
$soap->handle();
class user
{
protected $Rolse=array();
public function getRoles($UserName,$Password)
{
return $UserName.$Password;
}
}
?>
$roles=array();
try
{
$client = @new SoapClient(null,
array('location' =>"http://localhost/models/userInfo.php",'trace'=>1,'encoding'=>'UTF-8','uri' => "http://xxxxxx.com.cn")
);
$roles=$client->getRoles('test','12345678');
print_r($roles);
}
catch (SoapFault $fault)
{
echo "Error: ",$fault->faultcode,", string: ",$fault->faultstring;
}
?>
global $conf;
$conf['DBUSER']='root';
$conf['DBPWD']='';
$conf['DBHOST']='localhost';
?>
global $conf;以 ANSI 保存
$conf['DBUSER']='root';
$conf['DBPWD']='';
$conf['DBHOST']='localhost';