From da521c2a4e5904efcec4c702d4c90e18e0e8745d Mon Sep 17 00:00:00 2001 From: bdaniel Date: Sun, 14 Nov 2010 22:34:32 +0000 Subject: TUSCANY-3664 Add support for multiple operation output types git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1035091 13f79535-47bb-0310-9956-ffa450edef68 --- .../binding/jsonrpc/provider/JSONRPCDatabindingHelper.java | 14 ++++++++------ .../binding/jsonrpc/provider/JSONRPCServiceServlet.java | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) (limited to 'sca-java-2.x/trunk/modules/binding-jsonrpc-runtime/src') diff --git a/sca-java-2.x/trunk/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCDatabindingHelper.java b/sca-java-2.x/trunk/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCDatabindingHelper.java index f9b37f30b2..fc43835b9b 100644 --- a/sca-java-2.x/trunk/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCDatabindingHelper.java +++ b/sca-java-2.x/trunk/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCDatabindingHelper.java @@ -52,12 +52,14 @@ public class JSONRPCDatabindingHelper { } } } - DataType outputType = operation.getOutputType(); - if (outputType != null) { - if (!SimpleJavaDataBinding.NAME.equals(outputType.getDataBinding()) || - outputType.getPhysical() == BigDecimal.class ) { - outputType.setDataBinding(JSONDataBinding.NAME); - } + + for (DataType outputType : operation.getOutputType().getLogical() ) { + if (outputType != null) { + if (!SimpleJavaDataBinding.NAME.equals(outputType.getDataBinding()) || + outputType.getPhysical() == BigDecimal.class ) { + outputType.setDataBinding(JSONDataBinding.NAME); + } + } } } } 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 1e4292e66a..7ecfa83893 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 @@ -328,7 +328,7 @@ public class JSONRPCServiceServlet extends JSONRPCServlet { result = responseMessage.getBody(); return result.toString().getBytes("UTF-8"); } else { - if (jsonOperation.getOutputType() == null) { + if (jsonOperation.getOutputType().getLogical().get(0) == null) { // void operation (json-rpc notification) try { JSONObject jsonResponse = new JSONObject(); -- cgit v1.2.3