summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/protocol/JsonRpc20Response.java
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--sca-java-2.x/trunk/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/protocol/JsonRpc20Response.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/sca-java-2.x/trunk/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/protocol/JsonRpc20Response.java b/sca-java-2.x/trunk/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/protocol/JsonRpc20Response.java
index df6f1b9f5b..e6f8282faf 100644
--- a/sca-java-2.x/trunk/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/protocol/JsonRpc20Response.java
+++ b/sca-java-2.x/trunk/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/protocol/JsonRpc20Response.java
@@ -30,8 +30,16 @@ public class JsonRpc20Response extends JsonRpc20Result {
this.result = result;
}
+ public JsonRpc20Response(JSONObject response) {
+ super(response);
+ this.result = response.opt("result");
+ }
+
public JSONObject toJSONObject() throws JSONException {
- JSONObject response = new JSONObject();
+ if (response != null) {
+ return response;
+ }
+ response = new JSONObject();
response.put("jsonrpc", "2.0");
response.put("id", id);
response.put("result", result);