Exemple #1
0
        static void TestGVA_TicketNum()
        {
            //FFMsg_H2G msg = FreeformEntityFactory.CreateEntity<FFMsg_H2G>(FF_FlowDirection.H2G,
            //                   new FFCreateEntityRequest_H2G()
            //                   {
            //                       //Command = FF_AppId_G2H_Commands.ResponseRequest,
            //                       //MessageType = FF_AppId_G2H_MessageTypes.FreeForm,
            //                       PollCode = FF_AppId_H2G_PollCodes.FreeformResponse,
            //                       SessionID = FF_AppId_SessionIds.Tickets,
            //                       IPAddress = "192.168.10.2",
            //                       SkipTransactionId = true,
            //                   });
            //FFTgt_B2B_GMUVarAction gim = new FFTgt_B2B_GMUVarAction()
            //{
            //    //ActionData = new FFTgt_G2H_GVA_TN_Status()
            //    //{
            //    //    Status = FF_AppId_ResponseStatus_Types.Success,
            //    //}
            //    //ActionData = new FFTgt_G2H_GVA_TN_Request()
            //    ActionData = new FFTgt_H2G_GVA_TN_Response()
            //    {
            //        TicketNumber = "000456",
            //    }
            //};
            //msg.AddTarget(gim);
            var msg = TicketParametersHelper.InitTicketDataRequest(IPADDR);

            byte[] buffer = FreeformEntityFactory.CreateBuffer(FF_FlowDirection.G2H, msg);
            var    msg2   = FreeformEntityFactory.CreateEntity <FFMsg_G2H>(FF_FlowDirection.G2H, buffer);
        }
        protected override bool OnProcessMessageH2GExternal_SIM(FFTgtExecutionContext context, IFreeformEntity_MsgTgt target)
        {
            string ipAddress = context.SourceMessage.IpAddress;

            // rsa enabled
            var msgRSAQuerySystem = PIDHelper.RSAQuerySystemRequest(ipAddress, false);

            // initiate a key exchange (ticket)
            var msgTicket = this.MessageHandlerFactory.SecurityTables.InitKeyExchangeStartG2H_SIM(ipAddress, FF_AppId_SessionIds.Security, this.NewTransactionId);

            // initiate a key exchange (eft)
            var msgEFT = this.MessageHandlerFactory.SecurityTables.InitKeyExchangeStartG2H_SIM(ipAddress, FF_AppId_SessionIds.ECash, this.NewTransactionId);

            // ticket parameter request
            var msgTicketParameters = TicketParametersHelper.InitTicketDataRequest(ipAddress);

            context.FreeformTargets.AddRange(new IFreeformEntity[] {
                msgRSAQuerySystem,
                msgTicket,
                msgEFT,
                msgTicketParameters
            });
            return(true);
        }