public static Object callService(String serviceName, String methodName, Object[] methodParams, HttpServletRequest request) throws Exception {
		Debug.logVerbose("[JdonFramework] call the method: " + methodName + " for the service: " + serviceName, module);
		Object result = null;
		try {
			MethodMetaArgs methodMetaArgs = AppUtil.createDirectMethod(methodName, methodParams);

			ServiceFacade serviceFacade = new ServiceFacade();
			ServletContext sc = request.getSession().getServletContext();
			Service service = serviceFacade.getService(new ServletContextWrapper(sc));
			RequestWrapper requestW = RequestWrapperFactory.create(request);
			result = service.execute(serviceName, methodMetaArgs, requestW);
		} catch (Exception ex) {
			Debug.logError("[JdonFramework] serviceAction Error: " + ex, module);
			throw new Exception(" serviceAction Error:" + ex);
		}
		return result;
	}
public static Object callService ( String serviceName , String methodName , Object [ ] methodParams , HttpServletRequest request ) throws Exception { Debug . logVerbose ( "[JdonFramework] call the method: " + methodName + " for the service: " + serviceName , module ) ; Object result = null ; try { MethodMetaArgs methodMetaArgs = AppUtil . createDirectMethod ( methodName , methodParams ) ; ServiceFacade serviceFacade = new ServiceFacade ( ) ; ServletContext sc = request . getSession ( ) . getServletContext ( ) ; Service service = serviceFacade . getService ( new ServletContextWrapper ( sc ) ) ; RequestWrapper requestW = RequestWrapperFactory . create ( request ) ; result = service . execute ( serviceName , methodMetaArgs , requestW ) ; } catch ( Exception ex ) { Debug . logError ( "[JdonFramework] serviceAction Error: " + ex , module ) ; throw new Exception ( " serviceAction Error:" + ex ) ; } return result ; }
Command pattern for service invoke sample: browser url:
/aaa.do?method=xxxxx

xxxxx is the service's method, such as:

public interface TestService{ void xxxxx(EventModel em); }

@see com.jdon.strutsutil.ServiceMethodAction

@param serviceName
the service name in jdonframework.xml
@param methodName
the method name
@param request
@param model
the method parameter must be packed in a ModelIF object. if no
method parameter, set it to null;
@return return the service dealing result
@throws Exception