2011-04-19 15:59:50 +00:00
|
|
|
<?php
|
2012-06-15 15:07:35 +00:00
|
|
|
ini_set('max_execution_time', 300);
|
|
|
|
|
2011-10-13 10:22:44 +00:00
|
|
|
require_once ('Functions.lib.php');
|
|
|
|
define("DATA_SET_VERSION", '1.0');
|
2012-02-27 11:23:13 +00:00
|
|
|
class WSgiant extends Zend_Soap_Client
|
2011-04-19 15:59:50 +00:00
|
|
|
{
|
|
|
|
protected $wsService = array();
|
|
|
|
protected $header;
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-04-19 15:59:50 +00:00
|
|
|
function __construct($parametres)
|
|
|
|
{
|
2012-02-27 11:23:13 +00:00
|
|
|
$this->wsService = new Zend_Config_Ini( realpath(dirname(__FILE__)).'/giant.ini' );
|
2011-04-19 15:59:50 +00:00
|
|
|
if($parametres InstanceOF stdClass)
|
|
|
|
self::init($parametres);
|
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-04-19 15:59:50 +00:00
|
|
|
/**
|
|
|
|
* init
|
|
|
|
* @param unknown_type $parametres
|
|
|
|
*/
|
|
|
|
private function init($parametres)
|
|
|
|
{
|
2012-05-20 16:31:28 +00:00
|
|
|
$utilisateur = new Scores_Utilisateur();
|
2012-02-27 11:11:43 +00:00
|
|
|
$options = array(
|
|
|
|
'features' => SOAP_USE_XSI_ARRAY_TYPE + SOAP_SINGLE_ELEMENT_ARRAYS,
|
|
|
|
'soapVersion' => SOAP_1_1,
|
|
|
|
'login' => $this->wsService->options->login,
|
|
|
|
'password' => $this->wsService->options->password,
|
|
|
|
'compression' => SOAP_COMPRESSION_ACCEPT
|
|
|
|
);
|
2012-01-18 13:11:10 +00:00
|
|
|
$this->setOptions($options);
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-04-19 15:59:50 +00:00
|
|
|
$giantHeader = new stdClass();
|
|
|
|
$giantHeader->ConsumerId = $this->wsService->header->ConsumerId;
|
2012-01-18 13:11:10 +00:00
|
|
|
$giantHeader->CustomerId = $utilisateur->getLogin();
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-04-19 15:59:50 +00:00
|
|
|
$giantHeader->Provider = new stdClass();
|
|
|
|
$giantHeader->Provider->CountryCode = $parametres->CountryCode;
|
|
|
|
$giantHeader->Provider->ProviderId = $parametres->ProviderId;
|
|
|
|
$giantHeader->TimeStamp = time();
|
|
|
|
$giantHeader->TestIndication = $parametres->TestIndication;
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2012-02-27 11:11:43 +00:00
|
|
|
$this->header = new SoapHeader(
|
|
|
|
$this->wsService->header->url,
|
|
|
|
$this->wsService->header->serviceName, $giantHeader
|
2012-05-20 16:31:28 +00:00
|
|
|
);
|
2011-04-19 15:59:50 +00:00
|
|
|
parent::addSoapInputHeader($this->header, true);
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-04-19 15:59:50 +00:00
|
|
|
}
|
2012-05-20 16:31:28 +00:00
|
|
|
|
2011-04-19 15:59:50 +00:00
|
|
|
/**
|
|
|
|
* getAllMethodesFromWsdl
|
|
|
|
* @param unknown_type $service
|
|
|
|
*/
|
|
|
|
public function getAllMethodesFromWsdl($service)
|
|
|
|
{
|
2011-10-13 10:22:44 +00:00
|
|
|
$this->setWsdl($this->wsService->$service->wsdl);
|
2011-04-19 15:59:50 +00:00
|
|
|
return ($this);
|
|
|
|
}
|
2011-10-13 10:22:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Class Search extends GiantFunction
|
|
|
|
{
|
|
|
|
private $soapG;
|
|
|
|
protected $label;
|
|
|
|
protected $labelResults;
|
|
|
|
protected $query;
|
|
|
|
protected $methodes = array(
|
|
|
|
'search',
|
|
|
|
'advancedSearch'
|
|
|
|
);
|
|
|
|
|
|
|
|
private $headerSearch;
|
|
|
|
|
|
|
|
public function __construct($soap)
|
|
|
|
{
|
|
|
|
$this->soapG = $soap;
|
|
|
|
$this->label = new Zend_Config_Ini('Giant/Traductions/label.ini', 'search');
|
|
|
|
$this->labelResults = new Zend_Config_Ini('Giant/Traductions/results.ini', 'search');
|
|
|
|
$this->headerSearch = new stdClass();
|
|
|
|
$this->headerSearch->IncludePhoneticMatches = FALSE;
|
|
|
|
$this->headerSearch->IncludeSuggestions = FALSE;
|
|
|
|
$this->soapG->getAllMethodesFromWsdl('search');
|
|
|
|
}
|
|
|
|
|
|
|
|
protected function search($paramatres, $page)
|
|
|
|
{
|
|
|
|
$this->query = $paramatres->Query;
|
|
|
|
$search = array_merge((array)$paramatres, (array)$this->headerSearch);
|
|
|
|
try {
|
|
|
|
$result = $this->soapG->search($search);
|
|
|
|
} catch (SoapFault $soapFault) {
|
|
|
|
echo 'Erreur Soap : '.$soapFault->getMessage();}
|
|
|
|
return ($result);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function advancedSearch($parametres, $page)
|
|
|
|
{
|
|
|
|
$advanced = array_merge((array)$parametres, (array)$this->headerSearch);
|
2011-12-07 08:58:50 +00:00
|
|
|
$this->query = $advanced['Query'];
|
2011-10-13 10:22:44 +00:00
|
|
|
try {
|
|
|
|
$result = $this->soapG->advancedSearch($advanced);
|
|
|
|
} catch (SoapFault $soapFault) {
|
|
|
|
echo 'Erreur Soap : '.$soapFault->getMessage();}
|
|
|
|
return($result);
|
|
|
|
}
|
|
|
|
|
|
|
|
protected function Tier2Search($Query, $StartRow, $NumRows)
|
|
|
|
{
|
|
|
|
$parametres = new stdClass();
|
|
|
|
$parametres->Query = $Query;
|
|
|
|
$parametres->StartRow = $StartRow;
|
|
|
|
$parametres->NumRows = $NumRows;
|
|
|
|
try {
|
|
|
|
$this->soapG->Tier2Search($parametres);
|
|
|
|
} catch (SoapFault $soapFault) {
|
|
|
|
echo 'Erreur Soap : '.$soapFault->getMessage();}
|
|
|
|
}
|
|
|
|
|
|
|
|
public function Tier2SearchMethods()
|
|
|
|
{
|
|
|
|
try {
|
|
|
|
$result = $this->soapG->Tier2SearchMethods();
|
|
|
|
} catch (SoapFault $soapFault) {
|
|
|
|
echo 'Erreur Soap : '.$soapFault->getMessage();
|
|
|
|
}
|
|
|
|
return ($result);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function __destruct()
|
|
|
|
{
|
|
|
|
unset($this->soapG);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Class CreditData extends GiantFunction
|
|
|
|
{
|
|
|
|
private $soapG;
|
|
|
|
protected $companyId;
|
|
|
|
protected $methodes = array(
|
|
|
|
'RetreiveOptions', 'OrderDataSet',
|
|
|
|
'RetrieveOrderStatus', 'RetrieveDataSet',
|
|
|
|
'StartInvestigation', 'StartMonitoring',
|
|
|
|
'UpdateMonitoringOptions', 'StopMonitoring',
|
|
|
|
'RetrieveMonitoringEventsForOrder', 'RetrieveMonitoringEventsForCustomer',
|
|
|
|
'RetrieveMonitoringEventsForConsumer', 'Ping'
|
|
|
|
);
|
|
|
|
|
|
|
|
public function __construct($soapG, $companyId)
|
|
|
|
{
|
|
|
|
$this->soapG = $soapG;
|
|
|
|
$this->companyId = $companyId;
|
|
|
|
$this->soapG->getAllMethodesFromWsdl('credit-data');
|
|
|
|
}
|
|
|
|
|
|
|
|
protected function RetreiveOptions()
|
|
|
|
{
|
|
|
|
$parametres = new stdClass();
|
|
|
|
$parametres->CompanyId = $this->companyId;
|
|
|
|
try {
|
|
|
|
$result = $this->soapG->RetrieveOptions($parametres);
|
|
|
|
} catch (SoapFault $soapFault) {
|
|
|
|
echo 'Erreur Soap : '.$soapFault->getMessage();}
|
|
|
|
|
|
|
|
return ($result);
|
|
|
|
}
|
|
|
|
|
2013-05-17 14:03:45 +00:00
|
|
|
protected function OrderDataSet($DataSetType, $LanguageCode, $Version = null)
|
2011-10-13 10:22:44 +00:00
|
|
|
{
|
|
|
|
$parametres = new stdClass();
|
|
|
|
$parametres->CompanyId = $this->companyId;
|
|
|
|
$parametres->DataSetType = $DataSetType;
|
|
|
|
$parametres->DataSetVersion = DATA_SET_VERSION;
|
|
|
|
$parametres->LanguageCode = $LanguageCode;
|
|
|
|
try {
|
|
|
|
$result = $this->soapG->OrderDataSet($parametres);
|
|
|
|
} catch (SoapFault $soapFault) {
|
|
|
|
echo 'Erreur Soap : '.$soapFault->getMessage();}
|
|
|
|
return ($result);
|
|
|
|
}
|
|
|
|
|
|
|
|
protected function RetrieveOrderStatus($InternalOrderId)
|
|
|
|
{
|
|
|
|
$parametres = new stdClass();
|
|
|
|
$parametres->InternalOrderId = $InternalOrderId;
|
|
|
|
try {
|
|
|
|
$result = $this->soapG->RetrieveOrderStatus($parametres);
|
|
|
|
} catch (SoapFault $soapFault) {
|
|
|
|
echo 'Erreur Soap : '.$soapFault->getMessage();}
|
|
|
|
return ($result);
|
|
|
|
}
|
|
|
|
|
|
|
|
protected function RetrieveDataSet($InternalOrderId)
|
|
|
|
{
|
|
|
|
$parametres = new stdClass();
|
|
|
|
$parametres->InternalOrderId = $InternalOrderId;
|
|
|
|
try {
|
|
|
|
$result = $this->soapG->RetrieveDataSet($parametres);
|
|
|
|
} catch (SoapFault $soapFault) {
|
|
|
|
echo 'Erreur Soap : '.$soapFault->getMessage();}
|
|
|
|
return ($result);
|
|
|
|
}
|
|
|
|
|
|
|
|
protected function StartInvestigation($DataSetType, $ServiceLevelName, $Version = null, $LanguageCode = null)
|
|
|
|
{
|
|
|
|
$parametres = new stdClass();
|
|
|
|
$parametres->DataSetType = $DataSetType;
|
|
|
|
$parametres->ServiceLevelName = $ServiceLevelName;
|
|
|
|
$parametres->Version = $Version;
|
|
|
|
$parametres->LanguageCode = $LanguageCode;
|
|
|
|
try {
|
|
|
|
$result = $this->soapG->StartInvestigation($parametres);
|
|
|
|
} catch (SoapFault $soapFault) {
|
|
|
|
echo 'Erreur Soap : '.$soapFault->getMessage();}
|
|
|
|
return ($result);
|
|
|
|
}
|
|
|
|
|
|
|
|
protected function StartMonitoring($CategorieName, $EventType, $PreferredStartDate, $PreferredEndDate, $Version = null, $LanguageCode = null)
|
|
|
|
{
|
|
|
|
$parametres = new stdClass();
|
|
|
|
$parametres->CategorieName = $CategorieName;
|
|
|
|
$parametres->EventType = $EventType;
|
|
|
|
$parametres->PreferredStartDate = $PreferredStartDate;
|
|
|
|
$parametres->PreferredEndDate = $PreferredEndDate;
|
|
|
|
$parametres->Version = $Version;
|
|
|
|
$parametres->LanguageCode = $LanguageCode;
|
|
|
|
try {
|
|
|
|
$result = $this->soapG->StartMonitoring($parametres);
|
|
|
|
} catch (SoapFault $soapFault) {
|
|
|
|
echo 'Erreur Soap : '.$soapFault->getMessage();}
|
|
|
|
return ($result);
|
|
|
|
}
|
|
|
|
|
|
|
|
protected function UpdateMonitoringOptions($InternalOrderId, $NewCategorieName, $NewEventType, $NewPreferredStartDate, $NewVersion = null, $NewLanguageCode = null)
|
|
|
|
{
|
|
|
|
$parametres = new stdClass();
|
|
|
|
$parametres->InternalOrderId = $InternalOrderId;
|
|
|
|
$parametres->NewCategorieName = $NewCategorieName;
|
|
|
|
$parametres->NewEventType = $NewEventType;
|
|
|
|
$parametres->NewPreferredStartDate = $NewPreferredStartDate;
|
|
|
|
$parametres->NewVersion = $NewVersion;
|
|
|
|
$parametres->NewLanguageCode = $NewLanguageCode;
|
|
|
|
try {
|
|
|
|
$result = $this->soapG->UpdateMonitoringOptions($parametres);
|
|
|
|
} catch (SoapFault $soapFault) {
|
|
|
|
echo 'Erreur Soap : '.$soapFault->getMessage();}
|
|
|
|
return ($result);
|
|
|
|
}
|
|
|
|
|
|
|
|
protected function StopMonitoring($InternalOrderId, $PreferredEndDate)
|
|
|
|
{
|
|
|
|
$parametres = new stdClass();
|
|
|
|
$parametres->InternalOrderId = $InternalOrderId;
|
|
|
|
$parametres->PreferredEndDate = $PreferredEndDate;
|
|
|
|
try {
|
|
|
|
$result = $this->soapG->StopMonitoring($parametres);
|
|
|
|
} catch (SoapFault $soapFault) {
|
|
|
|
echo 'Erreur Soap : '.$soapFault->getMessage();}
|
|
|
|
return ($result);
|
|
|
|
}
|
|
|
|
|
|
|
|
protected function RetrieveMonitoringEventsForOrder($InternalOrderId, $StartFrom)
|
|
|
|
{
|
|
|
|
$parametres = new stdClass();
|
|
|
|
$parametres->InternalOrderId = $InternalOrderId;
|
|
|
|
$parametres->StartFrom = $StartFrom;
|
|
|
|
try {
|
|
|
|
$result = $this->soapG->RetrieveMonitoringEventsForOrder($parametres);
|
|
|
|
} catch (SoapFault $soapFault) {
|
|
|
|
echo 'Erreur Soap : '.$soapFault->getMessage();}
|
|
|
|
return ($result);
|
|
|
|
}
|
|
|
|
|
|
|
|
protected function RetrieveMonitoringEventsForCustomer($StartFrom)
|
|
|
|
{
|
|
|
|
$parametres = new stdClass();
|
|
|
|
$parametres->StartFrom = $StartFrom;
|
|
|
|
try {
|
|
|
|
$result = $this->soapG->RetrieveMonitoringEventsForCustomer($parametres);
|
|
|
|
} catch (SoapFault $soapFault) {
|
|
|
|
echo 'Erreur Soap : '.$soapFault->getMessage();
|
|
|
|
}
|
|
|
|
return ($result);
|
|
|
|
}
|
|
|
|
|
|
|
|
protected function RetrieveMonitoringEventsForConsumer($StartFrom)
|
|
|
|
{
|
|
|
|
$parametres = new stdClass();
|
|
|
|
$parametres->StartFrom = $StartFrom;
|
|
|
|
try {
|
|
|
|
$result = $this->soapG->RetrieveMonitoringEventsForConsumer($parametres);
|
|
|
|
} catch (SoapFault $soapFault) {
|
|
|
|
echo 'Erreur Soap : '.$soapFault->getMessage();}
|
|
|
|
return ($result);
|
|
|
|
}
|
|
|
|
|
|
|
|
protected function Ping($Type)
|
|
|
|
{
|
|
|
|
$parametres = new stdClass();
|
|
|
|
$parametres->Type = $Type;
|
|
|
|
try {
|
|
|
|
$result = $this->soapG->Ping($parametres);
|
|
|
|
} catch (SoapFault $soapFault) {
|
|
|
|
echo 'Erreur Soap : '.$soapFault->getMessage();
|
|
|
|
}
|
|
|
|
return ($result);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function __destruct()
|
|
|
|
{
|
|
|
|
unset($this->soapG);
|
|
|
|
}
|
2011-04-19 15:59:50 +00:00
|
|
|
}
|