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.') ); 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 _printInLogs($SoapObj) { if (isset($SoapObj)) { if (($erreur = self::selectErreurInTab($SoapObj->TechnicalException))) { if (file_put_contents(_LOGS_PROVIDER_.'/logs.txt', $content.$erreur, FILE_APPEND)) { self::sendMailError($erreur); if(empty($this->MessageUtilisateur)) $this->MessageUtilisateur = $erreur; 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); } } ?>