您好,欢迎访问一九零五行业门户网

php代码 重新封装zend_soap实现http连接安全认证的php代码

复制代码 代码如下:
_login=$options['login'];
$this->_password=$options['password'];
$this->_authenticate();
}
}
private function _authenticate(){
$this->setauthenticate($this->_login,$this->_password);
}
public function sethttplogin($login){
$this->_login=$login;
}
public function sethttppassword($password){
$this->_password=$password;
if(isset($this->_login)){
$this->_authenticate();
}
}
public function setauthenticate($login,$password){
if ($_server['php_auth_user']!=$login || $_server['php_auth_pw']!=$password) {
header('www-authenticate: basic realm=myframework realm');
header('http/1.0 401 unauthorized');
echo you must enter a valid login id and password to access this resource.\n;
exit;
}
}
}
?>
复制代码 代码如下:
view = $globals['view'];
$this->params = $globals['params'];
$this->requestobj = $globals['requestobj'];
$this->dbobj = $globals['dbobj'];
}
function indexaction(){
if(isset($_get['wsdl'])) {
$autodiscover = new myframework_soap_autodiscover();
$autodiscover->setclass('model_service_soapclasssettest');
$autodiscover->handle();
exit;
} else {
//$opti => 'utf-8','login'=>'tangjian','password'=>'123456');
$opti => 'utf-8');
$soap = new myframework_soap_server(http://tj.myframework.com/default/soap_server_test/index?wsdl,$options);
$soap->sethttplogin('tangjian');
$soap->sethttppassword('123456');
$soap->setclass('model_service_soapclasssettest');
$soap->handle();
exit;
}
}
function clientaction() {
//$opti => 'utf-8','login'=>'tangjian','password'=>'123456',
// 'compression' =>soap_compression_gzip);
$opti => 'utf-8',
'compression' =>soap_compression_gzip);
$client = new myframework_soap_client('http://tj.myframework.com/default/soap_server_test/index?wsdl',$options);
$client->sethttplogin('tangjian');
$client->sethttppassword('123456');
$result=$client->getpass('tang',man);
print_r($result);
}
}
?>
以上就介绍了php代码 重新封装zend_soap实现http连接安全认证的php代码,包括了php代码方面的内容,希望对php教程有兴趣的朋友有所帮助。
其它类似信息

推荐信息