array('Functional'=> 'Authentication failed
'), '1001' => array('Functional'=> 'Invalid Provider supplied .'), '1002' => array('Functional'=> 'Impersonation detected. tries to impersonate .'), '1005' => array('Functional'=> 'Failed to validate message. Reason
.'), '1010' => array('Functional'=> 'Invalid Provider/Country combination.'), '1015' => array('Functional'=> 'Provider cannot be used in combination with other providers.'), '1020' => array('Functional'=> 'Invalid Consumer supplied '), '3100' => array('Functional'=> 'Unable to lookup order. No InternalOrderId supplied.'), '3101' => array('Functional'=> 'Unable to lookup order. Invalid InternalOrderId supplied.'), '3110' => array('Functional'=> 'Your query returns more than records. Please specify your query.'), '4000' => array('Functional'=> 'Invalid ProviderOrderId .'), '4001' => array('Functional'=> 'Duplicate ProviderEventId .'), '4002' => array('Functional'=> 'Invalid NumberOfEvents .'), '6000' => array('Functional'=> 'Error connecting to search component.'), '6099' => array('Functional'=> 'Unexpected exception.'), '7000' => array('Functional'=> 'Could not connect to '), '7099' => array('Functional'=> 'Unexpected exception.'), '8000' => array('Functional'=> 'Problem connecting to database.'), '8010' => array('Functional'=> 'Configuration exception
.'), '8090' => array('Functional'=> 'Internal exception during search
.'), '8099' => array('Functional'=> 'Unexpected exception
.') ); private $Provider = array( '1003' => array('Functional'=> 'Authorization failed.'), '3000' => array('Functional'=> 'Invalid CompanyId '), '3001' => array('Functional'=> 'Invalid Version requested.'), '3002' => array('Functional'=> 'Invalid LanguageCode requested.'), '3003' => array('Functional'=> 'Invalid DataSetType requested.'), '3004' => array('Functional'=> 'Invalid ServiceLevel requested.'), '3005' => array('Functional'=> 'Invalid CategoryName requested'), '3006' => array('Functional'=> 'Invalid EventType requested.'), '3007' => array('Functional'=> 'Invalid Date format.'), '3020' => array('Functional'=> 'Invalid OrderId .'), '3021' => array('Functional'=> 'Invalid OrderId / Consumer combination.'), '3022' => array('Functional'=> 'Invalid OrderType.'), '3023' => array('Functional'=> 'Can’t retrieve dataset. Invalid Order Status .'), '5xxx' => array('Functional'=> 'Provider specific functional errorCodes.'), '9xxx' => array('Functional'=> 'Provider specific technical errorCodes.') ); function __construct() { } private function selectErreurInTab($SoapObj) { foreach ($this->tabType as $champ) { foreach($this->$champ as $chmp => $valeur) { if ($chmp == $SoapObj->ErrorCode) $this->MessageUtilisateur = date('d/m/Y à h:i:s').' ['.$chmp.'] '.$valeur['Functional']."\r\n"; } } return (date('dmY-h:i:s').' ['.$SoapObj->ErrorCode.'] '.$SoapObj->ErrorMessage."\r\n"); } public function _getFormIssuts($soap) { $postField = array(); require_once ('giant/templates/SoapFormIssue.tpl.php'); if(isset($_POST['send'])) { if ($_POST['send']) { echo 'Formulaire...'; $postField['issue[subject]'] = 'Error SOAP'; $postField['issue[description]'] = $_POST['GetLastRequest']; $postField['issue[description]'] .= $_POST['GetLastResponse']; $postField['issue[description]'] .= $_POST['Error']; $urlFormIssue = 'https://www.giant-net.com/projects/gnl/issues/new'; $userAgent = $_SERVER['HTTP_USER_AGENT']; $referer = $urlFormIssue; $curl = curl_init($urlFormIssue); if (preg_match('`^https://`i', $urlFormIssue)) { curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0); } curl_setopt($curl, CURLOPT_PORT, 1); if(curl_setopt($curl, CURLOPT_POSTFIELDS, $postField)) echo 'réussit !'; curl_setopt($curl, CURLOPT_USERAGENT, $userAgent); curl_setopt($curl, CURLOPT_REFERER, $referer); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); $result = curl_exec($curl); curl_close($curl); } } echo $result; exit; } public function _printInLogs($SoapObj, $soapClient = null) { $content = null; if (isset($SoapObj)) { $erreur = self::selectErreurInTab($SoapObj->TechnicalException); if ($erreur) { if (file_put_contents(_LOGS_PROVIDER_.'/logs.txt', $content.$erreur, FILE_APPEND)) { self::sendMailError($erreur); if(empty($this->MessageUtilisateur)) { $this->MessageUtilisateur = $erreur; if (_DEBUG_MODE_ and !empty($soapClient)) { self::_getFormIssuts($soapClient); } } return(EXIT_FAILURE); } } } return (EXIT_SUCCESS); } public function sendMailError($erreur) { $headers ='From: '.EMAIL_SUPPORTDEV."\n"; $headers .='Reply-To:'.EMAIL_SUPPORTDEV."\n"; $headers .='Content-Type: text/plain; charset="UTF-8"'."\n"; $headers .='Content-Transfer-Encoding: 8bit'; $subject = '[Erreur SOAP Giant] '; $content = 'Le '.date('d-m-Y').' Giant a retourné une erreur SOAP à '.date ('h:i:s')."\n"; $content .= 'Erreur : '.$erreur; mail(EMAIL_SUPPORTDEV, $subject, $content, $headers); } public function _getMessage(){ return ($this->MessageUtilisateur); } } ?>