Authentication zend soap服务器授权
我已经设置了Zend SOAP客户端和服务器: 请参阅下面的部分代码。在客户端中,我在标题中设置了用户名和密码 但是我在服务器上找不到关于如何提取这些信息的任何信息,这样我就可以对传入的消息进行身份验证,最好是通过Zend_Auth,我已经在系统的其余部分使用过了Authentication zend soap服务器授权,authentication,zend-framework,soap,Authentication,Zend Framework,Soap,我已经设置了Zend SOAP客户端和服务器: 请参阅下面的部分代码。在客户端中,我在标题中设置了用户名和密码 但是我在服务器上找不到关于如何提取这些信息的任何信息,这样我就可以对传入的消息进行身份验证,最好是通过Zend_Auth,我已经在系统的其余部分使用过了 Cient: $username = "user"; $password = "pass"; // initialize SOAP client $options = array( 'location' =>
Cient:
$username = "user";
$password = "pass";
// initialize SOAP client
$options = array(
'location' => 'http://dev.local/api/soap/index',
'uri' => 'http://dev.local/api/soap/index',
'soap_version' => SOAP_1_2,
'login' => $username,
'password' => $password
);
try {
$client = new Zend_Soap_Client(null, $options);
Server:
$options = array('uri' => 'http://dev.local/api/soap');
$server = new Zend\Soap\Server(null, $options);
$manager = new Manager_Api_Soap();
$server->setClass($manager);
您可以在zend中获得如下变量的标题值:
$this->getRequest()->getHeader('login')
有关更多详细信息,请参阅我先前关于Zend和REST的答复: