Web service calling business logic
-
Hi all, I need to call a business logic class via web servicing without using reflection. I pass the class name and method as string parameters in the web service. But it doesn't work the conversion from string to an object. If I pass the object class then it works but I don't want to do that as the webservice must run independently The code I use is, [WebMethod] public object ExecuteMethod(string ClassName, string MethodName, params object[] arguments) { object obj = null; Type type = Type.GetType(ClassName); try { obj = type.InvokeMember(MethodName, BindingFlags.Default | BindingFlags.InvokeMethod, null, null, arguments); } catch { throw; } return obj; } Thanks in advance
-
Hi all, I need to call a business logic class via web servicing without using reflection. I pass the class name and method as string parameters in the web service. But it doesn't work the conversion from string to an object. If I pass the object class then it works but I don't want to do that as the webservice must run independently The code I use is, [WebMethod] public object ExecuteMethod(string ClassName, string MethodName, params object[] arguments) { object obj = null; Type type = Type.GetType(ClassName); try { obj = type.InvokeMember(MethodName, BindingFlags.Default | BindingFlags.InvokeMethod, null, null, arguments); } catch { throw; } return obj; } Thanks in advance
-
ClassName
need to be a fully qualified type name. BTW: what you are doing is reflection :)xacc.ide - now with TabsToSpaces support
IronScheme - 1.0 alpha 4a out now (29 May 2008)