summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/binding-jsonrpc-runtime
diff options
context:
space:
mode:
Diffstat (limited to 'sca-java-2.x/trunk/modules/binding-jsonrpc-runtime')
-rw-r--r--sca-java-2.x/trunk/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCServiceServlet.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/sca-java-2.x/trunk/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCServiceServlet.java b/sca-java-2.x/trunk/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCServiceServlet.java
index 9c379bd4e9..1e4292e66a 100644
--- a/sca-java-2.x/trunk/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCServiceServlet.java
+++ b/sca-java-2.x/trunk/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCServiceServlet.java
@@ -344,7 +344,13 @@ public class JSONRPCServiceServlet extends JSONRPCServlet {
try {
result = responseMessage.getBody();
JSONObject jsonResponse = new JSONObject();
- jsonResponse.put("result", result);
+ //JSONObject put will remove the entry if it's value is null
+ //and per javadoc, we should pass JSONObject.NULL
+ if(result == null) {
+ jsonResponse.put("result", JSONObject.NULL);
+ } else {
+ jsonResponse.put("result", result);
+ }
jsonResponse.putOpt("id", id);
//get response to send to client
return jsonResponse.toString().getBytes("UTF-8");