Пример #1
0
 public static function notRegisteredError($originalSourceId, $originalMsgId)
 {
     $categoryCode = "5";
     $sifCode = "1";
     $shortDesc = "Registration Error";
     $longDesc = "Agent Not Registerd";
     $timestamp = Utility::createTimestamp();
     $msgId = Utility::createMessageId();
     XmlHelper::buildErrorMessage($categoryCode, $sifCode, $shortDesc, $longDesc, $msgId, $timestamp, $originalSourceId, $originalMsgId);
 }
Пример #2
0
 static function systemError($xml)
 {
     try {
         if ($xml != '' or $xml != null) {
             $dom = new DomDocument();
             $dom->loadXML($xml);
             $header = $dom->getElementsByTagName('SIF_Header')->item(0);
             $msgIdNode = $header->getElementsByTagName('SIF_MsgId')->item(0);
             $sourceIdNode = $header->getElementsByTagName('SIF_SourceId')->item(0);
             $originalMsgId = isset($msgIdNode->nodeValue) ? $msgIdNode->nodeValue : '';
             $originalSourceId = isset($sourceIdNode->nodeValue) ? $sourceIdNode->nodeValue : '';
             $longDesc = "Event was not updated as recieved.";
         } else {
             $originalMsgId = '';
             $originalSourceId = '';
             $longDesc = "Event was not updated as recieved. XML not found.";
         }
     } catch (Exception $e) {
         $originalMsgId = '';
         $originalSourceId = '';
         $longDesc = "Event was not updated as recieved. XML not found.";
     }
     $categoryCode = "11";
     $sifCode = "1";
     $shortDesc = "Generic Error";
     $timestamp = Utility::createTimestamp();
     $msgId = Utility::createMessageId();
     XmlHelper::buildErrorMessage($categoryCode, $sifCode, $shortDesc, $longDesc, $msgId, $timestamp, $originalSourceId, $originalMsgId, false);
 }
Пример #3
0
 static function systemError($xml)
 {
     try {
         if ($xml != '' or $xml != null) {
             $dom = new DomDocument();
             try {
                 $dom->loadXML($xml);
             } catch (Exception $e) {
                 $originalMsgId = '';
                 $originalSourceId = '';
                 $longDesc = "Premature end of Data.";
                 $categoryCode = "11";
                 $sifCode = "1";
                 $shortDesc = "Generic Error";
                 $timestamp = Utility::createTimestamp();
                 $msgId = Utility::createMessageId();
                 XmlHelper::buildErrorMessage($categoryCode, $sifCode, $shortDesc, $longDesc, $msgId, $timestamp, $originalSourceId, $originalMsgId, false);
                 exit;
             }
             $headerNode = $dom->getElementsByTagName('SIF_Header');
             if ($headerNode->length != 0) {
                 $header = $headerNode->item(0);
             } else {
                 $originalMsgId = '';
                 $originalSourceId = '';
                 $longDesc = "SIF_Header failed: possible a premature end of data caused this.";
                 $categoryCode = "11";
                 $sifCode = "1";
                 $shortDesc = "Generic Error";
                 $timestamp = Utility::createTimestamp();
                 $msgId = Utility::createMessageId();
                 XmlHelper::buildErrorMessage($categoryCode, $sifCode, $shortDesc, $longDesc, $msgId, $timestamp, $originalSourceId, $originalMsgId, false);
                 exit;
             }
             $SIF_MsgIdNode = $header->getElementsByTagName('SIF_MsgId');
             if ($SIF_MsgIdNode->length != 0) {
                 $msgIdNode = $header->getElementsByTagName('SIF_MsgId')->item(0);
             } else {
                 $originalMsgId = '';
                 $originalSourceId = '';
                 $longDesc = "SIF_MsgId - has issues.";
                 $categoryCode = "11";
                 $sifCode = "1";
                 $shortDesc = "Generic Error";
                 $timestamp = Utility::createTimestamp();
                 $msgId = Utility::createMessageId();
                 XmlHelper::buildErrorMessage($categoryCode, $sifCode, $shortDesc, $longDesc, $msgId, $timestamp, $originalSourceId, $originalMsgId, false);
                 exit;
             }
             $sourceIdNode = $header->getElementsByTagName('SIF_SourceId')->item(0);
             $originalMsgId = isset($msgIdNode->nodeValue) ? $msgIdNode->nodeValue : '';
             $originalSourceId = isset($sourceIdNode->nodeValue) ? $sourceIdNode->nodeValue : '';
             $longDesc = "Event was not updated as recieved.";
         } else {
             $originalMsgId = '';
             $originalSourceId = '';
             $longDesc = "Event was not updated as recieved. XML not found.";
         }
     } catch (Exception $e) {
         $originalMsgId = '';
         $originalSourceId = '';
         $longDesc = "Event was not updated as recieved. XML not found.";
     }
     $categoryCode = "11";
     $sifCode = "1";
     $shortDesc = "Generic Error";
     $timestamp = Utility::createTimestamp();
     $msgId = Utility::createMessageId();
     XmlHelper::buildErrorMessage($categoryCode, $sifCode, $shortDesc, $longDesc, $msgId, $timestamp, $originalSourceId, $originalMsgId, false);
 }
Пример #4
0
 public static function invalidObject($originalSourceId, $originalMsgId, $objectName)
 {
     $categoryCode = "8";
     $sifCode = "3";
     $shortDesc = "Request Error";
     $longDesc = "Invalid object (" . $objectName . ").";
     $timestamp = Utility::createTimestamp();
     $msgId = Utility::createMessageId();
     XmlHelper::buildErrorMessage($categoryCode, $sifCode, $shortDesc, $longDesc, $msgId, $timestamp, $originalSourceId, $originalMsgId);
 }
Пример #5
0
 public static function notProviderError($originalSourceId, $originalMsgId)
 {
     $categoryCode = "6";
     $sifCode = "5";
     $shortDesc = "Not Provider";
     $longDesc = "Not the provider of the object.";
     $timestamp = Utility::createTimestamp();
     $msgId = Utility::createMessageId();
     XmlHelper::buildErrorMessage($categoryCode, $sifCode, $shortDesc, $longDesc, $msgId, $timestamp, $originalSourceId, $originalMsgId);
 }