Example #1
0
        public void TestParser()
        {
            string configXml = @"/Resources/config.xml";
            MessageFactory <IsoMessage> mfact = Config(configXml);

            //Headers
            Assert.NotNull(mfact.GetIsoHeader(0x800));
            Assert.NotNull(mfact.GetIsoHeader(0x810));
            Assert.Equal(mfact.GetIsoHeader(0x800), mfact.GetIsoHeader(0x810));

            //Templates
            IsoMessage m200 = mfact.GetMessageTemplate(0x200);

            Assert.NotNull(m200);
            IsoMessage m400 = mfact.GetMessageTemplate(0x400);

            Assert.NotNull(m400);

            for (int i = 2; i < 89; i++)
            {
                IsoValue v = m200.GetField(i);
                if (v == null)
                {
                    Assert.False(m400.HasField(i));
                }
                else
                {
                    Assert.True(m400.HasField(i));
                    Assert.Equal(v, m400.GetField(i));
                }
            }

            Assert.False(m200.HasField(90));
            Assert.True(m400.HasField(90));
            Assert.True(m200.HasField(102));
            Assert.False(m400.HasField(102));

            //Parsing guides
            string     s800 = "0800201080000000000012345611251125";
            string     s810 = "08102010000002000000123456112500";
            IsoMessage m    = mfact.ParseMessage(s800.GetSbytes(), 0);

            Assert.NotNull(m);
            Assert.True(m.HasField(3));
            Assert.True(m.HasField(12));
            Assert.True(m.HasField(17));
            Assert.False(m.HasField(39));
            m = mfact.ParseMessage(s810.GetSbytes(),
                                   0);
            Assert.NotNull(m);
            Assert.True(m.HasField(3));
            Assert.True(m.HasField(12));
            Assert.False(m.HasField(17));
            Assert.True(m.HasField(39));
        }
Example #2
0
 private void TestFields(IsoMessage m,
                         List <int> fields)
 {
     for (var i = 2; i < 128; i++)
     {
         if (fields.Contains(i))
         {
             Assert.True(m.HasField(i));
         }
         else
         {
             Assert.False(m.HasField(i));
         }
     }
 }
Example #3
0
 public void TestBinaryHeader()
 {
     IsoMessage m = mf.NewMessage(0x280);
     Assert.NotNull(m.BinIsoHeader);
     sbyte[] buf = m.WriteData();
     Assert.Equal(4 + 4 + 16 + 2, buf.Length);
     for (int i = 0; i < 4; i++)
     {
         Assert.Equal(buf[i], unchecked((sbyte) 0xff));
     }
     Assert.Equal(buf[4], 0x30);
     Assert.Equal(buf[5], 0x32);
     Assert.Equal(buf[6], 0x38);
     Assert.Equal(buf[7], 0x30);
     //Then parse and check the header is binary 0xffffffff
     m = mf.ParseMessage(buf, 4, true);
     Assert.Null(m.IsoHeader);
     buf = m.BinIsoHeader;
     Assert.NotNull(buf);
     for (int i = 0; i < 4; i++)
     {
         Assert.Equal(buf[i], unchecked((sbyte) 0xff));
     }
     Assert.Equal(0x280, m.Type);
     Assert.True(m.HasField(3));
 }
Example #4
0
        public void TestSimpleCompositeParsers()
        {
            string configXml = @"/Resources/composites.xml";
            MessageFactory <IsoMessage> mfact = Config(configXml);
            IsoMessage m = mfact.ParseMessage("01000040000000000000016one  03two12345.".GetSbytes(), 0);

            Assert.NotNull(m);
            CompositeField f = (CompositeField)m.GetObjectValue(10);

            Assert.NotNull(f);
            Assert.Equal(4, f.Values.Count);
            Assert.Equal("one  ", f.GetObjectValue(0));
            Assert.Equal("two", f.GetObjectValue(1));
            Assert.Equal("12345", f.GetObjectValue(2));
            Assert.Equal(".", f.GetObjectValue(3));

            m = mfact.ParseMessage("01000040000000000000018ALPHA05LLVAR12345X".GetSbytes(), 0);
            Assert.NotNull(m);
            Assert.True(m.HasField(10));
            f = (CompositeField)m.GetObjectValue(10);
            Assert.NotNull(f.GetField(0));
            Assert.NotNull(f.GetField(1));
            Assert.NotNull(f.GetField(2));
            Assert.NotNull(f.GetField(3));
            Assert.Null(f.GetField(4));
            Assert.Equal("ALPHA", f.GetObjectValue(0));
            Assert.Equal("LLVAR", f.GetObjectValue(1));
            Assert.Equal("12345", f.GetObjectValue(2));
            Assert.Equal("X", f.GetObjectValue(3));
        }
Example #5
0
        private void CheckBin(sbyte[] txt,
                              sbyte[] bin,
                              int field)
        {
            IsoMessage t = txtfact.ParseMessage(txt, 0);
            IsoMessage b = binfact.ParseMessage(bin, 0);

            Assert.True(t.HasField(field));
            Assert.True(b.HasField(field));
            Assert.Empty(((sbyte[])t.GetObjectValue(field)));
            Assert.Empty(((sbyte[])b.GetObjectValue(field)));
        }
Example #6
0
        public void TestSimpleCompositeTemplate()
        {
            string configXml = @"/Resources/composites.xml";
            MessageFactory <IsoMessage> mfact = Config(configXml);
            IsoMessage m = mfact.NewMessage(0x100);

            //Simple composite
            Assert.NotNull(m);
            Assert.False(m.HasField(1));
            Assert.False(m.HasField(2));
            Assert.False(m.HasField(3));
            Assert.False(m.HasField(4));
            CompositeField f = (CompositeField)m.GetObjectValue(10);

            Assert.NotNull(f);
            Assert.Equal(f.GetObjectValue(0), "abcde");
            Assert.Equal(f.GetObjectValue(1), "llvar");
            Assert.Equal(f.GetObjectValue(2), "12345");
            Assert.Equal(f.GetObjectValue(3), "X");
            Assert.False(m.HasField(4));
        }
Example #7
0
        private void CheckString(sbyte[] txt, sbyte[] bin, int field)
        {
            IsoMessage t = txtfact.ParseMessage(txt, 0);
            IsoMessage b = binfact.ParseMessage(bin, 0);

            Assert.True(t.HasField(field));
            Assert.True(b.HasField(field));
            string value  = (string)(t.GetObjectValue(field));
            string valueb = (string)(b.GetObjectValue(field));

            Assert.True(value.IsEmpty());
            Assert.True(valueb.IsEmpty());
        }
Example #8
0
        private void NestedCompositeTemplate(int type, int fnum)
        {
            string configXml = @"/Resources/composites.xml";
            MessageFactory <IsoMessage> mfact = Config(configXml);
            IsoMessage m = mfact.NewMessage(type);

            Assert.NotNull(m);
            Assert.False(m.HasField(1));
            Assert.False(m.HasField(2));
            Assert.False(m.HasField(3));
            Assert.False(m.HasField(4));
            CompositeField f = (CompositeField)m.GetObjectValue(fnum);

            Assert.Equal(f.GetObjectValue(0), "fghij");
            Assert.Equal(f.GetObjectValue(2), "67890");
            Assert.Equal(f.GetObjectValue(3), "Y");
            f = (CompositeField)f.GetObjectValue(1);
            Assert.Equal(f.GetObjectValue(0), "KL");
            Assert.Equal(f.GetObjectValue(1), "mn");
            f = (CompositeField)f.GetObjectValue(2);
            Assert.Equal(f.GetObjectValue(0), "123");
            Assert.Equal(f.GetObjectValue(1), "45");
        }
Example #9
0
        public void TestL4bin()
        {
            sbyte[] fieldData = new sbyte[1000];
            mfact.UseBinaryMessages = true;
            IsoMessage m = mfact.NewMessage(0x100);

            m.SetValue(3, fieldData, IsoType.LLLLBIN, 0);
            fieldData = m.WriteData();
            //2 for message header
            //8 bitmap
            //3 for field 2 (from template)
            //1002 for field 3
            Assert.Equal(1015, fieldData.Length);
            m = mfact.ParseMessage(fieldData, 0);
            Assert.True(m.HasField(3));
            fieldData = m.GetObjectValue(3) as sbyte[];
            Assert.Equal(1000, fieldData.Length);
        }
Example #10
0
        public void PrintMessage(IsoMessage m)
        {
            Transaction transObj = new Transaction();

            if (m == null)
            {
                transObj.WriteLog("Mensaje nulo!");
                return;
            }
            transObj.WriteLog("TYPE: " + m.Type.ToString("x"));
            for (int i = 2; i < 128; i++)
            {
                if (m.HasField(i))
                {
                    transObj.WriteLog("F " + i.ToString() + ": " + m.GetObjectValue(i) + " -> '" + m.GetField(i).ToString() + "'");
                }
            }
        }
Example #11
0
        public void TestNestedCompositeParser()
        {
            string configXml = @"/Resources/composites.xml";
            MessageFactory <IsoMessage> mfact = Config(configXml);
            IsoMessage m = mfact.ParseMessage("01010040000000000000019ALPHA11F1F205F03F4X".GetSbytes(), 0);

            Assert.NotNull(m);
            Assert.True(m.HasField(10));
            CompositeField f = (CompositeField)m.GetObjectValue(10);

            Assert.NotNull(f.GetField(0));
            Assert.NotNull(f.GetField(1));
            Assert.NotNull(f.GetField(2));
            Assert.Null(f.GetField(3));
            Assert.Equal("ALPHA", f.GetObjectValue(0));
            Assert.Equal("X", f.GetObjectValue(2));
            f = (CompositeField)f.GetObjectValue(1);
            Assert.Equal("F1", f.GetObjectValue(0));
            Assert.Equal("F2", f.GetObjectValue(1));
            f = (CompositeField)f.GetObjectValue(2);
            Assert.Equal("F03", f.GetObjectValue(0));
            Assert.Equal("F4", f.GetObjectValue(1));
        }
Example #12
0
        private static void ParseTemplates <T>(XmlNodeList nodes,
                                               MessageFactory <T> mfact) where T : IsoMessage
        {
            List <XmlElement> subs = null;

            for (var i = 0; i < nodes.Count; i++)
            {
                var elem = (XmlElement)nodes.Item(i);
                if (elem == null)
                {
                    continue;
                }
                var type = ParseType(elem.GetAttribute("type"));
                if (type == -1)
                {
                    throw new IOException("Invalid ISO8583 type for template: " + elem.GetAttribute("type"));
                }
                if (!elem.GetAttribute("extends").IsEmpty())
                {
                    subs ??= new List <XmlElement>(nodes.Count - i);
                    subs.Add(elem);
                    continue;
                }

                var m = (T) new IsoMessage();
                m.Type     = type;
                m.Encoding = mfact.Encoding;
                var fields = elem.GetElementsByTagName("field");

                for (var j = 0; j < fields.Count; j++)
                {
                    var f = (XmlElement)fields.Item(j);
                    if (f?.ParentNode != elem)
                    {
                        continue;
                    }
                    var num = int.Parse(f.GetAttribute("num"));

                    var v = GetTemplateField(
                        f,
                        mfact,
                        true);

                    if (v != null)
                    {
                        v.Encoding = mfact.Encoding;
                    }

                    m.SetField(
                        num,
                        v);
                }

                mfact.AddMessageTemplate(m);
            }

            if (subs == null)
            {
                return;
            }

            foreach (var elem in subs)
            {
                var type = ParseType(elem.GetAttribute("type"));
                var @ref = ParseType(elem.GetAttribute("extends"));

                if (@ref == -1)
                {
                    throw new ArgumentException(
                              "Message template " + elem.GetAttribute("type") +
                              " extends invalid template " + elem.GetAttribute("extends"));
                }

                IsoMessage tref = mfact.GetMessageTemplate(@ref);

                if (tref == null)
                {
                    throw new ArgumentException(
                              "Message template " + elem.GetAttribute("type") +
                              " extends nonexistent template " + elem.GetAttribute("extends"));
                }

                var m = (T) new IsoMessage();

                m.Type     = type;
                m.Encoding = mfact.Encoding;

                for (var i = 2; i <= 128; i++)
                {
                    if (tref.HasField(i))
                    {
                        m.SetField(
                            i,
                            (IsoValue)tref.GetField(i).Clone());
                    }
                }

                var fields = elem.GetElementsByTagName("field");

                for (var j = 0; j < fields.Count; j++)
                {
                    var f   = (XmlElement)fields.Item(j);
                    var num = int.Parse(f?.GetAttribute("num") ?? string.Empty);

                    if (f?.ParentNode != elem)
                    {
                        continue;
                    }

                    var v = GetTemplateField(
                        f,
                        mfact,
                        true);

                    if (v != null)
                    {
                        v.Encoding = mfact.Encoding;
                    }

                    m.SetField(
                        num,
                        v);
                }

                mfact.AddMessageTemplate(m);
            }
        }
Example #13
0
        private void TestParsed(IsoMessage m)
        {
            Assert.Equal(m.Type,
                         0x600);
            Assert.Equal(decimal.Parse("1234.00"),
                         m.GetObjectValue(4));
            Assert.True(m.HasField(7),
                        "No field 7!");
            Assert.Equal("000123",
                         m.GetField(11).ToString()); // Wrong Trace
            var buf = (sbyte[])m.GetObjectValue(41);

            sbyte[] exp =
            {
                unchecked ((sbyte)0xab),
                unchecked ((sbyte)0xcd),
                unchecked ((sbyte)0xef),
                0,
                0,
                0,
                0,
                0
            };
            Assert.Equal(8,
                         buf.Length); //Field 41 wrong length

            Assert.Equal(exp,
                         buf); //"Field 41 wrong value"

            buf = (sbyte[])m.GetObjectValue(42);
            exp = new sbyte[]
            {
                0x0a,
                unchecked ((sbyte)0xbc),
                unchecked ((sbyte)0xde),
                0
            };
            Assert.Equal(4,
                         buf.Length); // "field 42 wrong length"
            Assert.Equal(exp,
                         buf);        // "Field 42 wrong value"
            Assert.True(((string)m.GetObjectValue(43)).StartsWith("Field of length 40",
                                                                  StringComparison.Ordinal));

            buf = (sbyte[])m.GetObjectValue(62);
            exp = new sbyte[]
            {
                1,
                0x23,
                0x45,
                0x67,
                unchecked ((sbyte)0x89),
                unchecked ((sbyte)0xab),
                unchecked ((sbyte)0xcd),
                unchecked ((sbyte)0xef),
                0x62,
                1,
                0x23,
                0x45,
                0x67,
                unchecked ((sbyte)0x89),
                unchecked ((sbyte)0xab),
                unchecked ((sbyte)0xcd)
            };
            Assert.Equal(exp,
                         buf);
            buf    = (sbyte[])m.GetObjectValue(64);
            exp[8] = 0x64;
            Assert.Equal(exp,
                         buf);
            buf = (sbyte[])m.GetObjectValue(63);
            exp = new sbyte[]
            {
                0,
                0x12,
                0x34,
                0x56,
                0x78,
                0x63
            };
            Assert.Equal(exp,
                         buf);
            buf    = (sbyte[])m.GetObjectValue(65);
            exp[5] = 0x65;
            Assert.Equal(exp,
                         buf);
        }
Example #14
0
        //private static bool SendMessage(string MSISDN, Int32 Amount, string Counter)
        public bool SendMessage(string MSISDN, Int32 Amount, string Counter, ref OutputVTload OutputVTObj)
        {
            //Send ISO message to VietTel Topup Gateway
            //ChungNN 02/2009 --------
            //----------------------------------------
            TransferProcess transObj       = new TransferProcess();
            bool            blnReturnValue = false;

            try
            {
                Encrypt.DigitalSign SignObj = new DigitalSign(AppConfiguration.AppPath + AppConfiguration.ViettelCerFilePath, AppConfiguration.AppPath + AppConfiguration.AppRSAPrivateKeyFilePath, AppConfiguration.AppRSAPrivateKeyPassword);
                string strDigitalSign       = string.Empty;


                MessageFactory mfact = ConfigParser.CreateFromFile(AppConfiguration.AppPath + AppConfiguration.ViettelConfig_ISOFile);
                mfact.AssignDate = true;
                //mfact.TraceGenerator = new i
                IsoMessage m = null;
                TcpClient  sock;

                byte[] lenbuf = new byte[1024];
                try
                {
                    sock = new TcpClient(AppConfiguration.ViettelServerAddress, AppConfiguration.ViettelServerPort);
                }
                catch
                {
                    return(blnReturnValue);
                    //throw (ex);
                }
                if ((sock == null) || !sock.Connected)
                {
                    return(blnReturnValue);
                }

                //if (MSISDN.Substring(0, 2) != "84")
                //    MSISDN = "84" + MSISDN;

                //fill ISO8583 message fields
                m = mfact.NewMessage(0x200);
                mfact.Setfield(2, MSISDN, ref m);
                mfact.Setfield(3, 0, ref m);
                mfact.Setfield(4, Amount, ref m);
                mfact.Setfield(7, DateTime.Now.ToString("yyyyMMddHHMMss"), ref m);
                mfact.Setfield(11, Counter, ref m);
                mfact.Setfield(63, AppConfiguration.ViettelClientID, ref m);

                //create Digital Signature
                if (m.HasField(2) && m.GetField(2) != null)
                {
                    strDigitalSign += m.GetField(2).ToString();
                }
                if (m.HasField(3) && m.GetField(3) != null)
                {
                    strDigitalSign += m.GetField(3).ToString();
                }
                if (m.HasField(4) && m.GetField(4) != null)
                {
                    strDigitalSign += m.GetField(4).ToString();
                }
                if (m.HasField(7) && m.GetField(7) != null)
                {
                    strDigitalSign += m.GetField(7).ToString();
                }
                if (m.HasField(11) && m.GetField(11) != null)
                {
                    strDigitalSign += m.GetField(11).ToString();
                }
                if (m.HasField(63) && m.GetField(63) != null)
                {
                    strDigitalSign += m.GetField(63).ToString();
                }

                OutputVTObj.request_transaction_time = m.GetField(7).ToString();
                //verify du lieu nhan dc tu server
                //SignObj._VerifyData("123456", strOub);

                //sign du lieu truoc khi gui di
                SignObj._signData(strDigitalSign, ref strDigitalSign);

                mfact.Setfield(64, strDigitalSign, ref m);
                m.Write(sock.GetStream(), 4, false);

                //<field num="2" type="LLVAR" length="0" />     <!--MSISDN-->
                //<field num="3" type="NUMERIC" length="6" />     <!--Processing Code-->
                //<field num="4" type="NUMERIC" length="12" />    <!--Transaction Amount-->
                //<field num="7" type="NUMERIC" length="14"/>     <!--Transmission Date & Time-->
                //<field num="11" type="NUMERIC" length="15" />   <!--System Trace Audit Number-->
                //<field num="39" type="NUMERIC" length="2" />    <!--Response Code-->
                //<field num="63" type="LLVAR" length="0" />      <!--Client ID-->
                //<field num="64" type="LLLVAR" length="0" />     <!--Message Signature-->

                //send ISO8583 message
                //Console.Out.Write(Encoding.ASCII.GetString(m.getByte(4, false)));

                Thread.Sleep(AppConfiguration.ViettelTimeout);

                while ((sock != null) && sock.Connected == true)
                {
                    try
                    {
                        Thread.Sleep(1000);
                        if (sock.GetStream().Read(lenbuf, 0, 4) == 4)
                        {
                            int size, k;
                            size = 0;

                            for (k = 0; k < 4; k++)
                            {
                                size = size + (int)(lenbuf[k] - 48) * (int)(Math.Pow(10, 3 - k));
                            }

                            byte[] buf = new byte[size + 1];
                            //We're not expecting ETX in this case
                            sock.GetStream().Read(buf, 0, buf.Length);

                            //Console.Out.Write(Encoding.ASCII.GetString(buf));
                            IsoMessage incoming = mfact.ParseMessage(buf, 0);

                            if (Convert.ToInt16(incoming.GetField(39).Value) == 0)
                            {
                                blnReturnValue = true;
                                //Ghi giao dich phuc vu doi soat
                                OutputVTObj.response_transaction_time = incoming.GetField(7).ToString();  //Response Transmission Time
                                OutputVTObj.response_code             = incoming.GetField(39).ToString(); //Response Code
                            }
                            else
                            {
                                //Ghi giao dich phuc vu doi soat
                                OutputVTObj.response_transaction_time = incoming.GetField(7).ToString();  //Response Transmission Time
                                OutputVTObj.response_code             = incoming.GetField(39).ToString(); //Response Code
                                blnReturnValue = true;
                            }
                        }
                        else
                        {
                            OutputVTObj.response_transaction_time = ""; //Response Transmission Time
                            OutputVTObj.response_code             = ""; //Response Code
                            blnReturnValue = false;
                        }
                    }
                    catch
                    {
                        //Console.Out.Write(ex.ToString());
                        blnReturnValue = false;
                    }
                }
            }
            catch //(Exception ex)
            {
                blnReturnValue = false;
            }

            return(blnReturnValue);
        }
Example #15
0
        /// <summary>
        /// POS download softpin
        /// ChungNN 03/2009
        /// </summary>
        /// <param name="request">IsoMessage</param>
        /// <returns>IsoMessage</returns>
        public IsoMessage Download(IsoMessage request)
        {
            topupObj = new TopupInterface();

            //create response message
            mfact = new MessageFactory();
            mfact = ConfigParser.CreateFromFile(AppConfiguration.App_Path + AppConfiguration.POSConfig_ISOFile);
            IsoMessage response            = mfact.CreateResponse(request);
            bool       blnDownloadTemplate = !request.HasField(48);
            string     strRequest          = request.GetField(11).Value.ToString();
            int        nMerchant_ID        = int.Parse(request.GetField(2).Value.ToString());
            int        nPos_ID             = int.Parse(request.GetField(52).Value.ToString());

            //if exist session
            if (!Common.ServiceSessionManager.GetSessionInstance().IsExistedSession(nPos_ID.ToString(), strRequest))
            {
                mfact.Setfield(39, "01", ref response);
                transObj.WriteLog("->download fail, session not exist");
            }
            else
            {
                //Download template
                if (blnDownloadTemplate)
                {
                    try
                    {
                        //get request values
                        topupObj = new TopupInterface();
                        BatchBuyObject buyObj = new BatchBuyObject();

                        //String[] arrRequestValues = request.GetField(48).Value.ToString().Split(AppConfiguration.POS_Seperator_Char);
                        //string strCategoryName = arrRequestValues[0];
                        //string strServiceProviderName = arrRequestValues[1];
                        //int nProductValue = int.Parse(arrRequestValues[2]);
                        //int nStockQuantity = int.Parse(arrRequestValues[3]);
                        //int nDownloadQuantity = int.Parse(arrRequestValues[4]);

                        object[] SoftpinStock = new object[1];

                        StockObject stockObj = new StockObject();
                        stockObj.ProductValue        = 10000;
                        stockObj.CategoryName        = "Thẻ ĐTDĐ";
                        stockObj.ServiceProviderName = "Vinaphone";
                        stockObj.StockQuantity       = 0;
                        SoftpinStock[0] = stockObj;

                        buyObj = topupObj.PosDownloadSoftpinTemplate(nPos_ID, nMerchant_ID, strRequest, SoftpinStock);

                        if (buyObj.ErrorCode == 0)
                        {
                            mfact.Setfield(39, "00", ref response);
                            transObj.WriteLog("->download template successfull");
                        }
                        else
                        {
                            mfact.Setfield(39, "01", ref response);
                            transObj.WriteLog("->download template fail");
                        }
                    }
                    catch (Exception ex)
                    {
                        transObj.WriteLog("->download template execption =" + ex.ToString());
                        throw (ex);
                    }
                }
                //Download single
                else
                {
                    try
                    {
                        //get request values
                        topupObj = new TopupInterface();
                        BatchBuyObject buyObj = new BatchBuyObject();

                        String[] arrRequestValues       = request.GetField(48).Value.ToString().Split(AppConfiguration.POS_Seperator_Char);
                        string   strCategoryName        = arrRequestValues[0];
                        string   strServiceProviderName = arrRequestValues[1];
                        int      nProductValue          = int.Parse(arrRequestValues[2]);
                        int      nStockQuantity         = int.Parse(arrRequestValues[3]);
                        int      nDownloadQuantity      = int.Parse(arrRequestValues[4]);

                        buyObj = topupObj.PosDownloadSingleSoftpin(nPos_ID, nMerchant_ID, strRequest, strCategoryName, strServiceProviderName, nProductValue, nStockQuantity, nDownloadQuantity);

                        if (buyObj.ErrorCode == 0)
                        {
                            mfact.Setfield(39, "00", ref response);
                            transObj.WriteLog("->download single successfull");
                        }
                        else
                        {
                            mfact.Setfield(39, "01", ref response);
                            transObj.WriteLog("->download single fail");
                        }

                        //create response message
                        mfact    = new MessageFactory();
                        mfact    = ConfigParser.CreateFromFile(AppConfiguration.App_Path + AppConfiguration.POSConfig_ISOFile);
                        response = mfact.CreateResponse(request);
                    }
                    catch (Exception ex)
                    {
                        transObj.WriteLog("->download single execption =" + ex.ToString());
                        throw (ex);
                    }
                }
            }

            return(response);
        }