예제 #1
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            X509Certificate2 cert = new X509Certificate2();

            cert.Import(Util.GetAssemblyDir(this) + "/../../../sslcerts/client.p12", "", X509KeyStorageFlags.MachineKeySet);
            _certificates.Add(cert);

            Logger.GetInstance().ReplaceOutput(this);

            txtServerHost.Text = "localhost";
            txtServerPort.Text = MessageListener.PORT + "";

            if (!LoadConfig())
            {
                return;
            }

            _exampleMessages.Clear();
            foreach (KeyValuePair <String, EditedItem> kvp in EditedItems.Item)
            {
                MessageCompiler compiler = new MessageCompiler(kvp.Value.DefaultModel);
                compiler.Compile();
                _exampleMessages[kvp.Key] = MessageUtility.HexToReadableString(compiler.CompiledMessage.GetAllBytes(), 100);
            }

            cmbExampleMessages.Items.Clear();
            foreach (String msgName in _exampleMessages.Keys)
            {
                cmbExampleMessages.Items.Add(msgName);
            }
            cmbExampleMessages.SelectedIndex = 0;
        }
예제 #2
0
        static EditedItems()
        {
            Dictionary <String, EditedItem> items = new Dictionary <String, EditedItem>();

            foreach (KeyValuePair <String, EditedItem> kvp in _editedItems)
            {
                MessageCompiler compiler = new MessageCompiler(kvp.Value.DefaultModel);
                compiler.Compile();
                EditedItem editedItem = kvp.Value;
                editedItem.RawMessageString = MessageUtility.HexToReadableString(compiler.CompiledMessage.GetAllBytes());
                items[kvp.Key] = editedItem;
            }
            _editedItems = items;
        }
예제 #3
0
 private Object PrintModel(Object model)
 {
     if (model == null)
     {
         //throw new HttpResponseException(HttpStatusCode.InternalServerError);
         _outputData = "Error: An error occured. Try to check/uncheck 'Use SSL/TLS' option.";
     }
     else
     {
         _outputData = MessageUtility.HexToReadableString(ParsedMessage.AllBytes)
                       + Environment.NewLine + Environment.NewLine
                       + Util.GetReadableStringFromModel(model);
     }
     _iso8583ResponseEvent.Set();
     return(null);
 }
예제 #4
0
 public Object ProcessResponse(Object model)
 {
     if (model == null)
     {
         Console.WriteLine("An error occured!! Cannot get response...");
     }
     else
     {
         Console.WriteLine("==== Begin: Response ====");
         Console.WriteLine(MessageUtility.HexToReadableString(ParsedMessage.AllBytes));
         Console.WriteLine("");
         Console.WriteLine("");
         Console.WriteLine(Util.GetReadableStringFromModel(model));
         Console.WriteLine("==== End: Response ====");
     }
     return(null);
 }
예제 #5
0
 private Object PrintIso8583Response(Object model)
 {
     if (model == null)
     {
         _output += "An error occured!! Cannot get response...";
     }
     else
     {
         _output += "==== Begin: Response ====" + Environment.NewLine
                    + MessageUtility.HexToReadableString(ParsedMessage.AllBytes) + Environment.NewLine
                    + Environment.NewLine
                    + Environment.NewLine
                    + Util.GetReadableStringFromModel(model) + Environment.NewLine
                    + "==== End: Response ====";
     }
     _iso8593ResponseComesEvent.Set();
     return(null);
 }
예제 #6
0
        public Object PrintModel(Object model)
        {
            if (this.InvokeRequired)
            {
                return(this.Invoke(new MessageCallback(this.PrintModel), model));
            }

            if (model == null)
            {
                MessageBox.Show("An error occured. Try to check/uncheck 'Use SSL/TLS' option.");
            }
            else
            {
                //WriteLog("Print response bytes..");
                txtResponse.Text = MessageUtility.HexToReadableString(ParsedMessage.AllBytes)
                                   + Environment.NewLine + Environment.NewLine;
                //WriteLog("End Print response bytes..");

                //WriteLog("Print response model..");
                txtResponse.Text += Util.GetReadableStringFromModel(model);
                //WriteLog("End Print model..");
            }
            return(null);
        }