Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/date/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Authentication zend soap服务器授权_Authentication_Zend Framework_Soap - Fatal编程技术网

Authentication zend soap服务器授权

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' =>

我已经设置了Zend SOAP客户端和服务器:

请参阅下面的部分代码。在客户端中,我在标题中设置了用户名和密码

但是我在服务器上找不到关于如何提取这些信息的任何信息,这样我就可以对传入的消息进行身份验证,最好是通过Zend_Auth,我已经在系统的其余部分使用过了

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的答复: