Ejemplo n.º 1
0
        public ActionResult ProcessRequest(MetaBlogRequest metaBlogRequest)
        {
            Type type = GetType();

            var xml = type.InvokeMember(metaBlogRequest.MethodCall, BindingFlags.Instance | BindingFlags.Public | BindingFlags.InvokeMethod, null, this,
                              new object[] {metaBlogRequest.Params});

            return new ContentResult() {Content = xml.ToString(), ContentType = "text/xml"};
        }
Ejemplo n.º 2
0
        public object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext)
        {
            if (controllerContext == null)
            {
                throw new ArgumentNullException("controllerContext");
            }

            try
            {
                var model = new MetaBlogRequest(controllerContext.HttpContext.Request.InputStream);

                return model;
            }
            catch (Exception)
            {
                throw new HttpException("Invalid Request");
            }
        }