Esempio n. 1
0
        private static void RespondToMneEnquire(string qMessage, string correlationId)
        {
            var queueInfo = new QueueInfo
            {
                Manager        = MNEApplicationConfigurationdetails.ResponseManger,
                Channel        = MNEApplicationConfigurationdetails.ResponseChannel,
                UseManagerName = false,
                Port           = MNEApplicationConfigurationdetails.ResponsePort,
                HostName       = MNEApplicationConfigurationdetails.ResponseHostName,
                QueueName      = MNEApplicationConfigurationdetails.ResponseQueueName,
                CorrelationId  = correlationId,
                Message        = qMessage
            };

            FdrMessaging.SendMessageToQueue(queueInfo);

            try
            {
                var message = Sars.Systems.Serialization.XmlObjectSerializer.GetXmlWithNoDeclaration(qMessage);
                DbWriter.SaveMneResponse(correlationId, message);
            }
            catch (Exception)
            {
                ;
            }
        }
Esempio n. 2
0
 private static void RespondToDocumentNotify(string qMessage, string messageId)
 {
     try
     {
         var queueInfo = new QueueInfo
         {
             Manager        = LMApplicationConfigurationdetails.ResponseManger,
             Channel        = LMApplicationConfigurationdetails.ResponseChannel,
             UseManagerName = false,
             Port           = LMApplicationConfigurationdetails.ResponsePort,
             HostName       = LMApplicationConfigurationdetails.ResponseHostName,
             QueueName      = LMApplicationConfigurationdetails.ResponseQueueName,
             CorrelationId  = messageId,
             Message        = qMessage
         };
         FdrMessaging.SendMessageToQueue(queueInfo);
         try
         {
             FdrCommon.SaveMessage(qMessage, @"\\ptadviis06\TaxDirectives\FDR\FILES\OUT");
         }
         catch (Exception exception)
         {
             FdrCommon.LogEvent(exception, EventLogEntryType.Error);
         }
     }
     catch (Exception exception)
     {
         FdrCommon.LogEvent(exception, EventLogEntryType.Error);
     }
 }
Esempio n. 3
0
        private static void OnMessage(IMessage msg)
        {
            //var corId = FdrCommon.ByteArrayToString(msg.JMSCorrelationIDAsBytes);
            var message = string.Empty;

            try{
                var textMsg = (ITextMessage)msg;
                message = textMsg.Text;
                try{
                    message = FdrCommon.FormatXml(message);
                }
                catch (Exception) {
                    ;
                }
                var dataValidation = IsCbcValid(message);
                var header         = FdrCommon.SelectNode(message, "soap12", "http://www.w3.org/2003/05/soap-envelope", "Header");
                if (header != null)
                {
                    var messageToSend = dataValidation.IsValid ? CreateXml(header.OuterXml) : FdrCommon.CreateFaultXml(header.OuterXml, dataValidation.ErrorXml);
                    var queueInfo     = new QueueInfo {
                        Manager        = CBCApplicationConfigurationdetails.ResponseManger,
                        Channel        = CBCApplicationConfigurationdetails.ResponseChannel,
                        UseManagerName = false,
                        Port           = CBCApplicationConfigurationdetails.ResponsePort,
                        HostName       = CBCApplicationConfigurationdetails.ResponseHostName,
                        QueueName      = CBCApplicationConfigurationdetails.ResponseQueueName,
                        CorrelationId  = msg.JMSMessageID,
                        Message        = messageToSend
                    };
                    FdrMessaging.SendMessageToQueue(queueInfo);
                    if (!dataValidation.IsValid)
                    {
                        return;
                    }
                }
            }
            catch (Exception exception) {
                FdrCommon.LogEvent(exception, EventLogEntryType.Error);
            }
            try{
                if (!string.IsNullOrEmpty(message))
                {
                    SaveIncomingCbcDeclaration(message);
                }
            }
            catch (Exception exception) {
                FdrCommon.LogEvent(exception, EventLogEntryType.Error);
            }
        }