Adding authentication functionality to soap server (Using Zend)? -


I have a soap server that is designed like this:

  class server controller Zend_Controller_Action increases {public function server action () {memcache_flush (); Zend_Registry :: Received ('Cash') - & gt; Clean (Zend_Cache :: CLEANING_MODE_ALL); $ Server = New Soap Server ("http: // #### / services / soap-server / wsdl"); $ Server & gt; SetClass ('SOAP_Server_Map'); $ Server & gt; take care (); }}  

I want to add certification for this so that whenever anyone calls a function in " SOAP_Server_Map ", it checks that the credentials SoapClient options array ('login' and 'password') are valid.

Do anyone have any suggestions / help? To add authentication to either Zend_Soap_Server or Zend_Json_Server, simply copy your HTTP server (i.e.: Apache) to

Or specify HTTP Authentication in the .htaccess file. The following .htaccess file should work:

  AuthType Basic AuthName "Highest Data Services" AuthUserFile / var / www / localhost / passwd Valid-user is required  

Ensure that you keep your password file out of the docrot for security purposes, using the htpasswd that comes with apache. Naturally, you can use more advanced certification types.

To use the service, you must now specify the user name and password when requesting. If you are using the Zend Framework to create your client, then you have to do SOAP Can work:

  $ client = new Zend_Soap_Client ($ wsdl, arrer ('login' = & gt; $ username, password '= & gt; $ password));  

and for JSONRPC the following:

  $ http = new Zend_Http_Client (); $ Http- & gt; Setth ($ username, $ password); $ Client = new Zend_Json_Client ($ uri, $ http);  

Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -