Hi folks, I have hundreds of methods exposed on the app server via remoting. Is there a way for a client to dynamically invoke any one of these methods if I know the class name, method name and have a string containing the serialized objects to be passed as the method params? I would also like to retrieve the object the method returned, as a serialized string. Thanks.
Well, create a remoted object that takes the class, method, and the string array containing the arguments. You can use the activator class to create an instance of the object that you needed it to create, and use reflection on that object to invoke the method. As for the return, you could use the XmlSerializer to serialize the object being returned as a string. "R3al1ty" wrote in message news:6e63b758-cd21-448d-af54-cfc3610e931c@j33g2000pri.googlegroups.com... > Hi folks, > > I have hundreds of methods exposed on the app server via remoting. Is > there a way for a client to dynamically invoke any one of these > methods if I know the class name, method name and have a string > containing the serialized objects to be passed as the method params? I > would also like to retrieve the object the method returned, as a > serialized string. > > Thanks.
Sorry, I should have been more detailed. Performance is a key concern, which is why we did not want to use Reflection. On those lines, how expensive is even the Remoting part of things when it creates a remote object? Thanks
You have no choice in the matter whether you want to use reflection to invoke the method. The objects themselves I'm not sure how much more overhead is required for the objects when they're remoted, never bothered to look. When I need to remote something, I just do it. If you're worried about performance with Reflection, cache the MethodInfo instances for the type in a collection (as an example I'd probably use a dictionary with the name of the method being the key). However if you're also remoting overloads you'll need to add more data to the key to ensure they're kept unique. Performance on the remoting side of things depends on the type of remoting you're using for an object. Single call is going to reduce performance a lot more than singleton would. It really all depends on what your application is needing. "R3al1ty" wrote in message news:f1a9e952-f3bf-45f6-bd3b-304bdde0f97d@w34g2000prm.googlegroups.com... > Sorry, I should have been more detailed. Performance is a key concern, > which is why we did not want to use Reflection. On those lines, how > expensive is even the Remoting part of things when it creates a remote > object? > > Thanks
I'll keep these points in mind, thanks!
Not a problem, good luck with your project :o) "R3al1ty" wrote in message news:a1de1cbd-7a95-4493-b547-49aef1cad8de@c19g2000prf.googlegroups.com... > I'll keep these points in mind, thanks!