SERVER:
function doAuthenticate(){
if(isset($_SERVER['PHP_AUTH_USER']) and isset($_SERVER['PHP_AUTH_PW']) )
{
if($_SERVER['PHP_AUTH_USER']=="abhishek" and $_SERVER['PHP_AUTH_PW']="123456" )
return true;
else
return false;
}
}
Call this doAuthenticate function for each operation on the server. If it returns true, then allow only the client / user.
CLIENT'S side
require_once('../lib/nusoap.php');
$client = new nusoap_client('<wsdl path>?wsdl', true);
$client->setCredentials("abhishek","123456","basic");
..
source
share