Exemplo n.º 1
0
 /**
  * sendMessage method defined by NP wsdl
  * called by external providers to send transaction messages to internal
  * the call to internal will be forward by forking
  * 
  * @param		Array $params
  * @return		array "NP_ACK" or string
  */
 public function sendMessage($params)
 {
     Application_Model_General::virtualSleep();
     $reqModel = new Application_Model_Request($params);
     //prepares data for sending internal the message
     $ack = $reqModel->Execute();
     // log all received calls if request log enabled
     if (Application_Model_General::getSettings('EnableRequestLog')) {
         Application_Model_General::logRequestResponse($params, $ack, $reqModel->getRequest()->getHeaderField('REQUEST_ID'), '[Input] ');
     }
     if ($ack === FALSE || strpos(strtolower($ack), "ack") === FALSE) {
         $ack = "Ack00";
     }
     return array('NP_ACK' => array('ACK_CODE' => $ack, 'ACK_DATE' => Application_Model_General::getDateTimeIso()));
 }
Exemplo n.º 2
0
 function sendSoap($client)
 {
     try {
         $soapArray = $this->responseArray();
         $retryNo = Application_Model_General::checkIfRetry($this->request->getHeaderField('REQUEST_ID'), $this->request->getHeaderField('MSG_TYPE'));
         if (!empty($retryNo)) {
             $soapArray['NP_MESSAGE']['HEADER']['RETRY_NO'] = $retryNo;
         }
         $ret = $client->sendMessage($soapArray);
         // log all sending calls
         if (Application_Model_General::getSettings('EnableRequestLog')) {
             Application_Model_General::logRequestResponse($soapArray, $ret, $this->request->getHeaderField("REQUEST_ID"), '[Output] ');
         }
     } catch (SoapFault $e) {
         $ret = FALSE;
     }
     return $ret;
 }