Beispiel #1
0
        /// <summary>
        /// Envia un DDP Request al DDP
        /// </summary>
        /// <param name="msg"></param>
        private string SendDDPRequest(Message msg)
        {
            DDPServerTypes.DDPRequestType ddpRequest = (DDPServerTypes.DDPRequestType)(msg.Body);

            //Send to ddp
            if (System.Configuration.ConfigurationManager.AppSettings["send2servers"] != "False")
            {
                ddpRequest.test = DataCenterLogic.DDPServerTypes.testType.Item0;
                ddpClient.DDPRequest(ddpRequest);
                log.Info("SendDDPRequest: ddpRequest sent to DDP");
            }

            //Guarda el mensaje en la base de datos
            using (var dao = new DDPRequestSentDataAccess())
            {
                dao.Create(TypeHelper.Map2DB(ddpRequest), 1);
            }
            log.Info("DDPRequest stored");
            return(ddpRequest.MessageId);
        }
Beispiel #2
0
        public Message MakeDDPRequest(DDPServerTypes.DDPRequestType ddpRequest)
        {
            ConfigurationManager configMgr = new ConfigurationManager();

            var ddpverda = new DDPVersionManager();
            var ddpver   = ddpverda.DDPFromDate(DateTime.UtcNow);

            //Fill necesary parameters
            ddpRequest.DDPVersionNum = ddpver.regularVer + ":" + ddpver.inmediateVer;
            ddpRequest.MessageId     = MessageIdManager.Generate();
            ddpRequest.MessageType   = DataCenterLogic.DDPServerTypes.messageTypeType.Item9;
            ddpRequest.Originator    = configMgr.Configuration.DataCenterID;
            //ddpRequest.ReferenceId
            ddpRequest.schemaVersion = decimal.Parse(configMgr.Configuration.SchemaVersion);
            ddpRequest.TimeStamp     = DateTime.UtcNow;

            //Enqueue DDPrequest
            Message msgout = new Message(ddpRequest);

            msgout.Label = "ddpRequest";

            return(msgout);
        }