Issue #0001653: worlcheck class working version

This commit is contained in:
Aram HARUTYUNYAN 2013-07-02 08:46:43 +00:00
parent 81bc916f71
commit 1d52af8534

View File

@ -9,7 +9,7 @@ class WsWorldCheck
public function __construct()
{
$c = Zend_Registry::get('config');
$location = ($c->profil->webservice->location=='production')?'production':'pilot';
$location = ($c->profil->webservice->location == 'production') ? 'production' : 'pilot';
$cWC = new Zend_Config_Ini('/Worldcheck/webservicesWC.ini', $location);
$config = $cWC->toArray();
$this->webservices = $config['webservices'];
@ -20,8 +20,9 @@ class WsWorldCheck
}
/**
* loadClient
* loadClientWC
* @param string $webservice
* @return SOAP client with Header
*/
protected function loadClientWC($webservice)
{
@ -61,32 +62,28 @@ class WsWorldCheck
$headerPart .= '<wsse:Password Type="'.$this->headerData['passwordType'].'">'.$this->headerData['password'].'</wsse:Password>';
$headerPart .= '</wsse:UsernameToken></wsse:Security>';
$headerVar = new SoapVar($headerPart,XSD_ANYXML);
$headerVar = new SoapVar($headerPart, XSD_ANYXML);
$header = new SoapHeader($this->headerData['namespace'], $this->headerData['securityType'], $headerVar, true);
return $header;
}
/**
* getScreener
* @param array $data
* @return Identifier
* @param object $data
* @return NameIdentifier
*/
public function getScreener($data)
{
$params = new stdClass();
$params->data = $data;
$params->screenRequest = $data;
$client = $this->loadClientWC('screener');
try {
$reponse = $client->screen($params);
return $reponse->screenResponse;
return $client->screen($params)->return;
} catch (SoapFault $fault) {
Zend_Registry::get('firebug')->info($params);
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
return $fault->faultstring;
} else {
echo $client->__getLastResponse();
//$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
return false;
}
}