code: public static OpResultInfo invokeOpByName(String name, String opName, String[] argTypes, String[] args)
        throws JMException
     {
        MBeanServer server = getMBeanServer();
        ObjectName objName = new ObjectName(name);
        int length = argTypes != null ? argTypes.length : 0;
        Object[] typedArgs = new Object[length];
  
        for (int p = 0; p < typedArgs.length; p++)
        {
           String arg = args[p];
           try
           {
              Object argValue = PropertyEditors.convertValue(arg, argTypes[p]);
              typedArgs[p] = argValue;
           }
           catch (ClassNotFoundException e)
           {
              if (trace)
                 log.trace("Failed to load class for arg" + p, e);
              throw new ReflectionException(e, "Failed to load class for arg" + p);
           }
           catch (java.beans.IntrospectionException e)
           {
              // If the type is not java.lang.Object throw an exception
              if (!argTypes[p].equals("java.lang.Object"))
                 throw new javax.management.IntrospectionException("Failed to find PropertyEditor for type: " +
                                                                   argTypes[p]);
              // Just use the String arg
              typedArgs[p] = arg;
              continue;
           }
        }
  
        Object opReturn = server.invoke(objName, opName, typedArgs, argTypes);
        return new OpResultInfo(opName, argTypes, args, opReturn);
     }
docs: Invoke an operation by name
  @param name The bean name
  @param opName The operation name
  @param argTypes The argument types
  @param args The arguments
  @return The result
  @exception JMException Thrown if an error occurs