Example #1
0
        static void TestSerialization()
        {
            NGinnBPM.MessageBus.Impl.JsonMessageSerializer ser = new NGinnBPM.MessageBus.Impl.JsonMessageSerializer();
            MessageWrapper mw = new MessageWrapper();

            mw.Headers["Correlation-Id"] = "9389328492834.1";
            mw.Headers["Deliver-At"]     = DateTime.Now.AddDays(1).ToString();
            mw.Body = new Ping {
                Id = "ala ma kota"
            };
            StringWriter sw = new StringWriter();

            ser.Serialize(mw, sw);
            log.Info("Serialized: {0}", sw.ToString());
            MessageWrapper mw2 = (MessageWrapper)ser.Deserialize(new StringReader(sw.ToString()));

            log.Info("MW2: {0}", mw2);
        }
Example #2
0
        static void TestSerialization()
        {
            NGinnBPM.MessageBus.Impl.JsonMessageSerializer ser = new NGinnBPM.MessageBus.Impl.JsonMessageSerializer();
            MessageWrapper mw = new MessageWrapper();
            mw.Headers["Correlation-Id"] = "9389328492834.1";
            mw.Headers["Deliver-At"] = DateTime.Now.AddDays(1).ToString();
            mw.Body = new Ping { Id = "ala ma kota" };
            StringWriter sw = new StringWriter();
            ser.Serialize(mw, sw);
            log.Info("Serialized: {0}", sw.ToString());
            MessageWrapper mw2 = (MessageWrapper) ser.Deserialize(new StringReader(sw.ToString()));

            log.Info("MW2: {0}", mw2);
        }