// No arguments to getCurrentTime() method, so
// nothing to deserialize from request
// Get local OSGi ITimeService
ITimeService timeService = HttpServiceComponent.getDefault()
.getService(ITimeService.class);
// Call local service to get the time
Long currentTime = timeService.getCurrentTime();
// Serialize response
try {
resp.getOutputStream().print(new JSONObject().put("time", currentTime).toString());
} catch (JSONException e) {