public void HttpRequestHandler(object request) { HttpApplication httpApp = request as HttpApplication; HttpContext httpcontext = httpApp.Context; HttpRequest httpReq = httpApp.Request; HttpResponse httpResp = httpApp.Response; httpAppPath = httpApp.Server.MapPath("~/bin/"); string repQuery = httpReq.Form.Get("method").ToString(); if (String.IsNullOrEmpty(repQuery)) { return; } AssemblyParamsEvent assemblyhanlder = Assemblyconfig.GetAssemblyParamsByName(repQuery); RequestAssemblyEvent requestevent = new RequestAssemblyEvent(httpcontext, this.HttpRequestAssembly, assemblyhanlder); requestevent.InvokeRequestAssembly(); httpResp.Clear(); httpResp.ContentType = "text/xml"; httpResp.Charset = "utf-8"; httpResp.Write(requestevent.XmlResp); httpResp.End(); }
public RequestAssemblyEvent(HttpContext httpcontext, OnAssemblyEvent requestassembly, AssemblyParamsEvent assemblyparams) { _context = httpcontext; _request = httpcontext.Request; _method = _request.Form.Get("method").ToString(); _handler = requestassembly; _paramsevent = assemblyparams; }
public object HttpRequestAssembly(string method, AssemblyParamsEvent assemblyevent, object[] args) { Object ret = new Object(); Assembly asm = Assembly.LoadFile(httpAppPath + assemblyevent.AssemblyPath); Type type = asm.GetType(assemblyevent.AssemblyType, true); Object obj = Activator.CreateInstance(type, new object[] { httpAppPath }, null); MethodInfo md = type.GetMethod(assemblyevent.RequestMethod); ret = md.Invoke(obj, args); return(ret); }
public object HttpRequestAssembly(string method, AssemblyParamsEvent assemblyevent,object[] args) { Object ret = new Object(); Assembly asm = Assembly.LoadFile(httpAppPath + assemblyevent.AssemblyPath); Type type = asm.GetType(assemblyevent.AssemblyType, true); Object obj = Activator.CreateInstance(type, new object[] { httpAppPath }, null); MethodInfo md = type.GetMethod(assemblyevent.RequestMethod); ret = md.Invoke(obj, args); return ret; }