}
if (!responseMessage.isFault()) {
if (jsonOperation.getOutputWrapper().getDataBinding().equals(JSONDataBinding.NAME)) {
result = responseMessage.getBody();
return new JsonRpc20Response((ObjectNode)JacksonHelper.MAPPER.readTree(result.toString()));
} else {
if (jsonOperation.getOutputType().getLogical().size() == 0) {
// void operation (json-rpc notification)
try {
JsonRpc20Response response = new JsonRpc20Response(request.getId(), null);
return response;
} catch (Exception e) {
throw new ServiceRuntimeException("Unable to create JSON response", e);
}
} else {
// regular operation returning some value
try {
result = responseMessage.getBody();
JsonRpc20Response response = new JsonRpc20Response(request.getId(), (JsonNode)result);
//get response to send to client
return response;
} catch (Exception e) {
throw new ServiceRuntimeException("Unable to create JSON response", e);
}