This commit is contained in:
Michael RICOIS 2013-09-19 10:16:50 +00:00
parent 641e6cd97d
commit 08af5c99de
2 changed files with 111 additions and 102 deletions

View File

@ -10,11 +10,11 @@ class WsWorldCheck
{
$c = Zend_Registry::get('config');
$location = ($c->profil->webservice->location == 'production') ? 'production' : 'pilot';
$cWC = new Zend_Config_Ini('/Worldcheck/webservicesWC.ini', $location);
$cWC = new Zend_Config_Ini(APPLICATION_PATH . '/../library/Worldcheck/webservicesWC.ini', $location);
$config = $cWC->toArray();
$this->webservices = $config['webservices'];
$configWC = new Zend_Config_Ini('/Worldcheck/applicationWC.ini');
$configWC = new Zend_Config_Ini(APPLICATION_PATH . '/../library/Worldcheck/applicationWC.ini');
$data = $configWC->toArray();
$this->wcData = $data['wsworldcheck'];
}
@ -30,18 +30,21 @@ class WsWorldCheck
$options['soap_version'] = SOAP_1_1;
$options['features'] = SOAP_USE_XSI_ARRAY_TYPE + SOAP_SINGLE_ELEMENT_ARRAYS;
$options['compression'] = SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP | SOAP_COMPRESSION_DEFLATE;
//$options['compression'] = SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP | SOAP_COMPRESSION_DEFLATE;
$options['style'] = SOAP_DOCUMENT;
$options['use'] = SOAP_LITERAL;
$options['trace'] = true;
$options['encoding'] = 'utf-8';
//$options['encoding'] = 'utf-8';
if (APPLICATION_ENV == 'development'){
$options['cache_wsdl'] = WSDL_CACHE_NONE;
}
$client = false;
$header = $this->headerWC();
try {
$client = new SoapClient($wsdl, $options);
$client = new SoapClient(realpath(dirname(__FILE__)) . DIRECTORY_SEPARATOR . $wsdl, $options);
$client->__setSoapHeaders($header);
} catch (Exception $e) {
throw new Exception('Application Error');
@ -66,7 +69,7 @@ class WsWorldCheck
$header = new SoapHeader($this->wcData['namespace'], $this->wcData['securityType'], $headerVar, true);
return $header;
}
//**** SCREENER WSDL ****//
/**
@ -85,19 +88,25 @@ class WsWorldCheck
$params->screenRequest->customId2 = '2';
$client = $this->loadClientWC('screener');
try {
return $client->screen($params)->return;
$response = $client->screen($params);
echo $client->__getLastRequest();
echo $client->__getLastResponse();
exit;
return $response->return;
} catch (SoapFault $fault) {
if ($fault->faultcode){
return $fault->faultstring;
echo $fault->faultstring;
return false;
} else {
echo $client->__getLastResponse();
return false;
}
}
}
//**** CONTENT WSDL ****//
/**
* getContentSources
* @return Content Sources
@ -116,7 +125,7 @@ class WsWorldCheck
}
}
}
/**
* getDetails
* @param object: matchIdentifier, nameType
@ -140,7 +149,7 @@ class WsWorldCheck
}
}
}
/**
* getSummaries
* @param object
@ -154,7 +163,7 @@ class WsWorldCheck
$param->matchType = $data->matchType; // value must be watchlist
$param->start = $this->wcData['response']['start'];
$param->limit = $this->wcData['response']['limit'];
try {
return $client->getSummaries($param)->return;
} catch (SoapFault $fault) {
@ -166,7 +175,7 @@ class WsWorldCheck
}
}
}
/**
* return an array, where key=entityId, and value=fullName according to nameIdentifier
* @param object
@ -181,7 +190,7 @@ class WsWorldCheck
$param->matchType = $data->matchType; // value must be watchlist
$param->start = $this->wcData['response']['start'];
$param->limit = $this->wcData['response']['limit'];
try {
$category = $client->getSummaries($param)->return->entitySummaries->categories;
foreach ($category->category as $category)
@ -209,7 +218,7 @@ class WsWorldCheck
}
}
}
/**
* getSummariesForMatch
* @param string matchIdentifier
@ -231,7 +240,7 @@ class WsWorldCheck
}
}
}
/**
* return object with entityId and fullName according to matchIdentifier
* @param string matchIdentifier
@ -256,7 +265,7 @@ class WsWorldCheck
}
}
}
/**
* getTitles
* @param object
@ -270,7 +279,7 @@ class WsWorldCheck
$param->matchType = $data->matchType; // value must be watchlist
$param->start = $this->wcData['response']['start'];
$param->limit = $this->wcData['response']['limit'];
try {
return $client->getTitles($param)->return;
} catch (SoapFault $fault) {
@ -282,7 +291,7 @@ class WsWorldCheck
}
}
}
/**
* getTitlesForMatch
* @param string matchIdentifier
@ -304,9 +313,9 @@ class WsWorldCheck
}
}
}
//**** USER WSDL ****//
/**
* change My Password
* @param string new password
@ -325,10 +334,10 @@ class WsWorldCheck
} else {
echo $client->__getLastResponse();
return false;
}
}
}
}
/**
* reset Password
* @param string username
@ -350,7 +359,7 @@ class WsWorldCheck
}
}
}
/**
* get Usernames
* @param string userIdentifier
@ -372,9 +381,9 @@ class WsWorldCheck
}
}
}
//**** PREFERENCE WSDL ****//
/**
* getAllGroupConfingVariables
* @param string groupIdentifier
@ -396,7 +405,7 @@ class WsWorldCheck
}
}
}
/**
* getGroupConfigVariable
* @param string groupIdentifier
@ -419,7 +428,7 @@ class WsWorldCheck
}
}
}
/**
* getGroupConfigVariables
* @param string groupIdentifier
@ -432,7 +441,7 @@ class WsWorldCheck
$param = new stdClass();
$param->groupIdentifier = $groupIdentifier;
$param->groupConfigVariableTypeSet->groupConfigVariableTypes->groupConfigVariableType = $groupConfigVariableType;
try {
return $client->getGroupConfigVariables($param)->return;
} catch (SoapFault $fault) {
@ -444,9 +453,9 @@ class WsWorldCheck
}
}
}
//**** STOREDNAME WSDL ****//
/**
* getStoredNameModel
* @param string groupIdentifier
@ -457,7 +466,7 @@ class WsWorldCheck
$client = $this->loadClientWC('storedName');
$param = new stdClass();
$param->groupIdentifier = $groupIdentifier;
try {
return $client->getStoredNameModel($param)->return;
} catch (SoapFault $fault) {
@ -469,7 +478,7 @@ class WsWorldCheck
}
}
}
/**
* getStoredNameModelForAllGroups
* @return object
@ -477,7 +486,7 @@ class WsWorldCheck
public function getStoredNameModelForAllGroups()
{
$client = $this->loadClientWC('storedName');
try {
return $client->getStoredNameModelForAllGroups()->return;
} catch (SoapFault $fault) {
@ -489,7 +498,7 @@ class WsWorldCheck
}
}
}
/**
* getStoredNameModelGroups
* @return object
@ -497,7 +506,7 @@ class WsWorldCheck
public function getStoredNameModelGroups()
{
$client = $this->loadClientWC('storedName');
try {
return $client->getStoredNameModelGroups()->return;
} catch (SoapFault $fault) {
@ -509,7 +518,7 @@ class WsWorldCheck
}
}
}
/**
* getUserFilters
* @return object
@ -517,7 +526,7 @@ class WsWorldCheck
public function getUserFilters()
{
$client = $this->loadClientWC('storedName');
try {
return $client->getUserFilters()->return;
} catch (SoapFault $fault) {
@ -529,9 +538,9 @@ class WsWorldCheck
}
}
}
//**** NAME WSDL ****//
/**
* addNote
* @param string nameIdentifier
@ -544,7 +553,7 @@ class WsWorldCheck
$param = new stdClass();
$param->nameIdentifierList->nameIdentifiers->nameIdentifier = $nameIdentifier;
$param->note = $note;
try {
return $client->addNote($param)->return;
} catch (SoapFault $fault) {
@ -556,7 +565,7 @@ class WsWorldCheck
}
}
}
/**
* archive
* @param string nameIdentifier
@ -567,7 +576,7 @@ class WsWorldCheck
$client = $this->loadClientWC('name');
$param = new stdClass();
$param->nameIdentifierList->nameIdentifiers->nameIdentifier = $nameIdentifier;
try {
return $client->archive($param)->return;
} catch (SoapFault $fault) {
@ -579,7 +588,7 @@ class WsWorldCheck
}
}
}
/**
* delete
* @param string nameIdentifier
@ -590,7 +599,7 @@ class WsWorldCheck
$client = $this->loadClientWC('name');
$param = new stdClass();
$param->nameIdentifierList->nameIdentifiers->nameIdentifier = $nameIdentifier;
try {
return $client->delete($param)->return;
} catch (SoapFault $fault) {
@ -602,7 +611,7 @@ class WsWorldCheck
}
}
}
/**
* assign
* @param string nameIdentifier
@ -615,7 +624,7 @@ class WsWorldCheck
$param = new stdClass();
$param->nameIdentifierList->nameIdentifiers->nameIdentifier = $nameIdentifier;
$param->assigneeIdentifier = $assigneeIdentifier;
try {
return $client->assign($param)->return;
} catch (SoapFault $fault) {
@ -637,7 +646,7 @@ class WsWorldCheck
$client = $this->loadClientWC('name');
$param = new stdClass();
$param->nameIdentifierList->nameIdentifiers->nameIdentifier = $nameIdentifier;
try {
return $client->unassign($param)->return;
} catch (SoapFault $fault) {
@ -649,7 +658,7 @@ class WsWorldCheck
}
}
}
/**
* changeOwner
* @param string nameIdentifier
@ -662,7 +671,7 @@ class WsWorldCheck
$param = new stdClass();
$param->nameIdentifierList->nameIdentifiers->nameIdentifier = $nameIdentifier;
$param->ownerIdentifier = $ownerIdentifier;
try {
return $client->changeOwner($param)->return;
} catch (SoapFault $fault) {
@ -674,7 +683,7 @@ class WsWorldCheck
}
}
}
/**
* getDetailsName
* @param string nameIdentifier
@ -685,7 +694,7 @@ class WsWorldCheck
$client = $this->loadClientWC('name');
$param = new stdClass();
$param->nameIdentifier = $nameIdentifier;
try {
return $client->getDetails($param)->return;
} catch (SoapFault $fault) {
@ -712,7 +721,7 @@ class WsWorldCheck
$param->matchType = $matchType;
$param->start = $this->wcData['response']['start'];
$param->limit = $this->wcData['response']['limit'];
try {
return $client->getMatches($param)->return->matches;
} catch (SoapFault $fault) {
@ -724,7 +733,7 @@ class WsWorldCheck
}
}
}
/**
* Returns array where key=entityId, and value=matchIdentifier according to nameIdentifier
* @param object data (contains nameIdentifier, matchType)
@ -739,7 +748,7 @@ class WsWorldCheck
$param->matchType = $data->matchType; // value must be watchlist
$param->start = $this->wcData['response']['start'];
$param->limit = $this->wcData['response']['limit'];
try {
$matches = $client->getMatches($param)->return->matches;
foreach ($matches->match as $matchData)
@ -756,7 +765,7 @@ class WsWorldCheck
}
}
}
/**
* getSelectableAssignees
* @param string groupIdentifier
@ -767,7 +776,7 @@ class WsWorldCheck
$client = $this->loadClientWC('name');
$param = new stdClass();
$param->groupIdentifier = $groupIdentifier;
try {
return $client->getSelectableAssignees($param)->return;
} catch (SoapFault $fault) {
@ -779,7 +788,7 @@ class WsWorldCheck
}
}
}
/**
* getSelectableGroups
* @return object
@ -787,7 +796,7 @@ class WsWorldCheck
public function getSelectableGroups()
{
$client = $this->loadClientWC('name');
try {
return $client->getSelectableGroups()->return;
} catch (SoapFault $fault) {
@ -810,7 +819,7 @@ class WsWorldCheck
$param = new stdClass();
$param->groupIdentifier = $groupIdentifier;
$param->nameSystemStatus = $nameSystemStatus;
try {
return $client->getSelectableOwners($param)->return;
} catch (SoapFault $fault) {
@ -822,7 +831,7 @@ class WsWorldCheck
}
}
}
/**
* saveForOngoingScreening
* @param string nameIdentifier
@ -834,7 +843,7 @@ class WsWorldCheck
$client = $this->loadClientWC('name');
$param = new stdClass();
$param->nameIdentifierList->nameIdentifiers->nameIdentifier = $nameIdentifier;
try {
return $client->saveForOngoingScreening($param)->return;
} catch (SoapFault $fault) {
@ -846,9 +855,9 @@ class WsWorldCheck
}
}
}
//**** MATCH WSDL ****//
/**
* acknoledge
* @param string matchIdentifier
@ -861,7 +870,7 @@ class WsWorldCheck
$param = new stdClass();
$param->matchIdentifierList->matchIdentifiers->matchIdentifier = $matchIdentifier;
$param->note = $note;
try {
return $client->acknoledge($param)->return;
} catch (SoapFault $fault) {
@ -873,7 +882,7 @@ class WsWorldCheck
}
}
}
/**
* addNote
* @param string matchIdentifier
@ -888,7 +897,7 @@ class WsWorldCheck
$param->matchIdentifierList->matchIdentifiers = new stdClass();
$param->matchIdentifierList->matchIdentifiers->matchIdentifier = $matchIdentifier;
$param->note = $note;
try {
return $client->addNote($param)->return;
} catch (SoapFault $fault) {
@ -900,7 +909,7 @@ class WsWorldCheck
}
}
}
/**
* getDetailsMatch
* @param string matchIdentifier
@ -911,7 +920,7 @@ class WsWorldCheck
$client = $this->loadClientWC('match');
$param = new stdClass();
$param->matchIdentifier = $matchIdentifier;
try {
return $client->getDetails($param)->return;
} catch (SoapFault $fault) {
@ -923,7 +932,7 @@ class WsWorldCheck
}
}
}
/**
* getNewUpdatedNameModel
* @param string groupIdentifier
@ -934,7 +943,7 @@ class WsWorldCheck
$client = $this->loadClientWC('match');
$param = new stdClass();
$param->groupIdentifier = $groupIdentifier;
try {
return $client->getNewUpdatedNameModel($param)->return;
} catch (SoapFault $fault) {
@ -946,7 +955,7 @@ class WsWorldCheck
}
}
}
/**
* getNewUpdatedNameModelForAllGroups
* @return object
@ -954,7 +963,7 @@ class WsWorldCheck
public function getNewUpdatedNameModelForAllGroups()
{
$client = $this->loadClientWC('match');
try {
return $client->getNewUpdatedNameModelForAllGroups()->return;
} catch (SoapFault $fault) {
@ -966,7 +975,7 @@ class WsWorldCheck
}
}
}
/**
* getNewUpdatedNameModelGroups
* @return object
@ -974,7 +983,7 @@ class WsWorldCheck
public function getNewUpdatedNameModelGroups()
{
$client = $this->loadClientWC('match');
try {
return $client->getNewUpdatedNameModelGroups()->return;
} catch (SoapFault $fault) {
@ -986,7 +995,7 @@ class WsWorldCheck
}
}
}
/**
* getNewUpdatedNames
* @param object $data
@ -997,7 +1006,7 @@ class WsWorldCheck
$client = $this->loadClientWC('match');
$param = new stdClass();
//to be continued
try {
return $client->getNewUpdatedNames($param)->return;
} catch (SoapFault $fault) {
@ -1009,7 +1018,7 @@ class WsWorldCheck
}
}
}
/**
* resolve
* @param object $data
@ -1023,7 +1032,7 @@ class WsWorldCheck
$param->matchRisk = $data->matchRisk;
$param->matchStatus = $data->matchStatus;
$param->note = $data->note;
try {
return $client->resolve($param)->return;
} catch (SoapFault $fault) {

View File

@ -1,25 +1,25 @@
[pilot]
webservices.actionLog.wsdl = "http://wcwsdl/pilot/actionLog.wsdl"
webservices.batch.wsdl = "http://wcwsdl/pilot/batch.wsdl"
webservices.name.wsdl = "http://wcwsdl/pilot/name.wsdl"
webservices.screener.wsdl = "http://wcwsdl/pilot/screener.wsdl"
webservices.storedName.wsdl = "http://wcwsdl/pilot/storedName.wsdl"
webservices.content.wsdl = "http://wcwsdl/pilot/content.wsdl"
webservices.group.wsdl = "http://wcwsdl/pilot/group.wsdl"
webservices.preference.wsdl = "http://wcwsdl/pilot/preference.wsdl"
webservices.role.wsdl = "http://wcwsdl/pilot/role.wsdl"
webservices.user.wsdl = "http://wcwsdl/pilot/user.wsdl"
webservices.match.wsdl = "http://wcwsdl/pilot/match.wsdl"
webservices.actionLog.wsdl = "wsdl/pilot/actionLog.wsdl"
webservices.batch.wsdl = "wsdl/pilot/batch.wsdl"
webservices.name.wsdl = "wsdl/pilot/name.wsdl"
webservices.screener.wsdl = "wsdl/pilot/screener.wsdl"
webservices.storedName.wsdl = "wsdl/pilot/storedName.wsdl"
webservices.content.wsdl = "wsdl/pilot/content.wsdl"
webservices.group.wsdl = "wsdl/pilot/group.wsdl"
webservices.preference.wsdl = "wsdl/pilot/preference.wsdl"
webservices.role.wsdl = "wsdl/pilot/role.wsdl"
webservices.user.wsdl = "wsdl/pilot/user.wsdl"
webservices.match.wsdl = "wsdl/pilot/match.wsdl"
[production]
webservices.actionLog.wsdl = "http://wcwsdl/production/actionLog.wsdl"
webservices.batch.wsdl = "http://wcwsdl/production/batch.wsdl"
webservices.name.wsdl = "http://wcwsdl/production/name.wsdl"
webservices.screener.wsdl = "http://wcwsdl/production/screener.wsdl"
webservices.storedName.wsdl = "http://wcwsdl/production/storedName.wsdl"
webservices.content.wsdl = "http://wcwsdl/production/content.wsdl"
webservices.group.wsdl = "http://wcwsdl/production/group.wsdl"
webservices.preference.wsdl = "http://wcproduction/pilot/preference.wsdl"
webservices.role.wsdl = "http://wcwsdl/production/role.wsdl"
webservices.user.wsdl = "http://wcwsdl/production/user.wsdl"
webservices.match.wsdl = "http://wcwsdl/production/match.wsdl"
webservices.actionLog.wsdl = "wsdl/production/actionLog.wsdl"
webservices.batch.wsdl = "wsdl/production/batch.wsdl"
webservices.name.wsdl = "wsdl/production/name.wsdl"
webservices.screener.wsdl = "wsdl/production/screener.wsdl"
webservices.storedName.wsdl = "wsdl/production/storedName.wsdl"
webservices.content.wsdl = "wsdl/production/content.wsdl"
webservices.group.wsdl = "wsdl/production/group.wsdl"
webservices.preference.wsdl = "wsdl/production/preference.wsdl"
webservices.role.wsdl = "wsdl/production/role.wsdl"
webservices.user.wsdl = "wsdl/production/user.wsdl"
webservices.match.wsdl = "wsdl/production/match.wsdl"