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 --- .../sca/binding/rest/provider/RESTBindingInvoker.java | 2 +- .../json/provider/JSONWireFormatServiceProvider.java | 12 +++++++----- .../xml/provider/XMLWireFormatServiceProvider.java | 8 +++++--- 3 files changed, 13 insertions(+), 9 deletions(-) (limited to 'sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java') diff --git a/sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/RESTBindingInvoker.java b/sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/RESTBindingInvoker.java index 1673f3aefa..2463883b80 100644 --- a/sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/RESTBindingInvoker.java +++ b/sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/RESTBindingInvoker.java @@ -140,7 +140,7 @@ public class RESTBindingInvoker implements Invoker { } if (operation.getOutputType() != null) { - responseType = operation.getOutputType().getPhysical(); + responseType = operation.getOutputType().getLogical().get(0).getPhysical(); } else { responseType = null; } diff --git a/sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/wireformat/json/provider/JSONWireFormatServiceProvider.java b/sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/wireformat/json/provider/JSONWireFormatServiceProvider.java index fcb311a105..754fdfc73e 100644 --- a/sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/wireformat/json/provider/JSONWireFormatServiceProvider.java +++ b/sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/wireformat/json/provider/JSONWireFormatServiceProvider.java @@ -124,11 +124,13 @@ public class JSONWireFormatServiceProvider implements WireFormatProvider { // handle output types if (configureOutput) { - DataType outputType = operation.getOutputType(); - if (outputType != null) { - if (!SimpleJavaDataBinding.NAME.equals(outputType.getDataBinding())) { - outputType.setDataBinding(JSONDataBinding.NAME); - } + List outputTypes = operation.getOutputType().getLogical(); + for ( DataType outputType : outputTypes) { + if (outputType != null) { + if (!SimpleJavaDataBinding.NAME.equals(outputType.getDataBinding())) { + outputType.setDataBinding(JSONDataBinding.NAME); + } + } } } } diff --git a/sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/wireformat/xml/provider/XMLWireFormatServiceProvider.java b/sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/wireformat/xml/provider/XMLWireFormatServiceProvider.java index 32d718b509..01b439961c 100644 --- a/sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/wireformat/xml/provider/XMLWireFormatServiceProvider.java +++ b/sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/wireformat/xml/provider/XMLWireFormatServiceProvider.java @@ -127,9 +127,11 @@ public class XMLWireFormatServiceProvider implements WireFormatProvider { // handle output types if (configureOutput) { - DataType outputType = operation.getOutputType(); - if (outputType != null) { - outputType.setDataBinding(XMLStringDataBinding.NAME); + List outputTypes = operation.getOutputType().getLogical(); + for ( DataType outputType : outputTypes ) { + if (outputType != null) { + outputType.setDataBinding(XMLStringDataBinding.NAME); + } } } } -- cgit v1.2.3