try {
JSONObject jsonResponse = new JSONObject();
// result = wire.invoke(jsonOperation, args);
result = jsonOperation.invoke(this.serviceInstance, parameters);
JavaBean2JSON transform = new JavaBean2JSON();
try {
// FIXME: this only checks for String and not primitive types
if (!(result instanceof java.lang.String)) {
jsonResponse.put("result", transform.toJSON(result));
} else {
jsonResponse.put("result", result);
}
jsonResponse.putOpt("id", id);