MethodCallResult ReserializeException(string ex)
 {
     var ser = new XmlMethodCallSerializer ();
     var ms = new MemoryStream ();
     ser.SerializeException(ms, ex);
     ms.Seek (0, SeekOrigin.Begin);
     return ser.DeserializeResult(ms, typeof (string));
 }
 MethodCallResult Reserialize(object obj, Type expectedType)
 {
     var ser = new XmlMethodCallSerializer ();
     var ms = new MemoryStream();
     ser.SerializeResult(ms, obj);
     ms.Seek(0, SeekOrigin.Begin);
     return ser.DeserializeResult(ms, expectedType);
 }
        MethodCallResult ReserializeException(string ex)
        {
            var ser = new XmlMethodCallSerializer();
            var ms  = new MemoryStream();

            ser.SerializeException(ms, ex);
            ms.Seek(0, SeekOrigin.Begin);
            return(ser.DeserializeResult(ms, typeof(string)));
        }
        MethodCallResult Reserialize(object obj, Type expectedType)
        {
            var ser = new XmlMethodCallSerializer();
            var ms  = new MemoryStream();

            ser.SerializeResult(ms, obj);
            ms.Seek(0, SeekOrigin.Begin);
            return(ser.DeserializeResult(ms, expectedType));
        }
        public void TestSerializeAndDeserialize()
        {
            var proxy = new Proxy();
            var tproxy = ProxyGen.CreateInstance<IFoo>(proxy);
            tproxy.Test(1, new List<string> {"2", "3"});
            var ser = new XmlMethodCallSerializer();
            var binder = new DefaultMethodBinder();
            var ms = new MemoryStream();

            ser.SerializeCall(ms, binder, "Target", proxy.LastCall);
            ms.Seek(0, SeekOrigin.Begin);

            var call = ser.DeserializeCall(ms, binder, new TargetSelector(new Target()));
            call.Method.Invoke(call.Target, call.Arguments);
        }
        public void TestSerializeAndDeserialize()
        {
            var proxy  = new Proxy();
            var tproxy = ProxyGen.CreateInstance <IFoo>(proxy);

            tproxy.Test(1, new List <string> {
                "2", "3"
            });
            var ser    = new XmlMethodCallSerializer();
            var binder = new DefaultMethodBinder();
            var ms     = new MemoryStream();

            ser.SerializeCall(ms, binder, "Target", proxy.LastCall);
            ms.Seek(0, SeekOrigin.Begin);

            var call = ser.DeserializeCall(ms, binder, new TargetSelector(new Target()));

            call.Method.Invoke(call.Target, call.Arguments);
        }