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; }
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; }
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); }
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); }
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); }
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); }