summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/interface-wsdl/src
diff options
context:
space:
mode:
authorbdaniel <bdaniel@13f79535-47bb-0310-9956-ffa450edef68>2010-11-14 22:31:42 +0000
committerbdaniel <bdaniel@13f79535-47bb-0310-9956-ffa450edef68>2010-11-14 22:31:42 +0000
commit5670f96c39fb938bfc6951dcb87d623a2d03bf8d (patch)
tree3c8a65b905e4ccf77d32c75c541d22d06cbf73f6 /sca-java-2.x/trunk/modules/interface-wsdl/src
parenteec2e27511654d899e2fcc81172dd97d490f6699 (diff)
TUSCANY-3664 Add support for multiple operation output types
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1035089 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r--sca-java-2.x/trunk/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLOperationIntrospectorImpl.java31
-rw-r--r--sca-java-2.x/trunk/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLInterfaceIntrospectorTestCase.java2
-rw-r--r--sca-java-2.x/trunk/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLOperationIntrospectorTestCase.java5
3 files changed, 25 insertions, 13 deletions
diff --git a/sca-java-2.x/trunk/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLOperationIntrospectorImpl.java b/sca-java-2.x/trunk/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLOperationIntrospectorImpl.java
index 3fd476c46f..67191cd43d 100644
--- a/sca-java-2.x/trunk/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLOperationIntrospectorImpl.java
+++ b/sca-java-2.x/trunk/modules/interface-wsdl/src/main/java/org/apache/tuscany/sca/interfacedef/wsdl/impl/WSDLOperationIntrospectorImpl.java
@@ -149,24 +149,35 @@ public class WSDLOperationIntrospectorImpl {
* @throws NotSupportedWSDLException
*/
@SuppressWarnings("unchecked")
- public DataType<XMLType> getOutputType() throws InvalidWSDLException {
+ public DataType<List<DataType>> getOutputType() throws InvalidWSDLException {
if (outputType == null) {
Output output = operation.getOutput();
Message outputMsg = (output == null) ? null : output.getMessage();
- List outputParts = (outputMsg == null) ? null : outputMsg.getOrderedParts(null);
+ operation.getInput();
+ List<Part> outputParts = (outputMsg == null) ? null : outputMsg.getOrderedParts(null);
+ ArrayList<DataType> partTypes = new ArrayList<DataType>();
if (outputParts != null && outputParts.size() > 0) {
- if (outputParts.size() > 1) {
- // We don't support output with multiple parts
- if (logger.isLoggable(Level.WARNING)) {
- logger.warning("Multi-part output is not supported, please use BARE parameter style.");
- }
- // throw new InvalidWSDLException("Multi-part output is not supported");
+// if (outputParts.size() > 1) {
+// // We don't support output with multiple parts
+// if (logger.isLoggable(Level.WARNING)) {
+// logger.warning("Multi-part output is not supported, please use BARE parameter style.");
+// }
+// // throw new InvalidWSDLException("Multi-part output is not supported");
+// }
+ for ( Part part : outputParts ) {
+ DataType partType = new WSDLPart(part, Object.class).getDataType();
+ partTypes.add(partType);
}
- Part part = (Part)outputParts.get(0);
- outputType = new WSDLPart(part, Object.class).getDataType();
+
// outputType.setMetadata(WSDLOperation.class.getName(), this);
+ } else {
+ partTypes.add(null);
}
+
+
+ outputType =
+ new DataTypeImpl<List<DataType>>(dataBinding, Object[].class, partTypes);
}
return outputType;
}
diff --git a/sca-java-2.x/trunk/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLInterfaceIntrospectorTestCase.java b/sca-java-2.x/trunk/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLInterfaceIntrospectorTestCase.java
index 1e66f7c4e4..5b7a5ec966 100644
--- a/sca-java-2.x/trunk/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLInterfaceIntrospectorTestCase.java
+++ b/sca-java-2.x/trunk/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLInterfaceIntrospectorTestCase.java
@@ -73,7 +73,7 @@ public class WSDLInterfaceIntrospectorTestCase extends AbstractWSDLTestCase {
Assert.assertEquals("getLastTradePrice", operation.getName());
DataType<List<DataType>> inputType = operation.getInputType();
Assert.assertEquals(1, inputType.getLogical().size());
- DataType<XMLType> returnType = operation.getOutputType();
+ DataType<List<DataType>> returnType = operation.getOutputType();
Assert.assertNotNull(returnType);
Assert.assertEquals(0, operation.getFaultTypes().size());
// Assert.assertEquals(1,
diff --git a/sca-java-2.x/trunk/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLOperationIntrospectorTestCase.java b/sca-java-2.x/trunk/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLOperationIntrospectorTestCase.java
index c4549f8180..f16ab9c73a 100644
--- a/sca-java-2.x/trunk/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLOperationIntrospectorTestCase.java
+++ b/sca-java-2.x/trunk/modules/interface-wsdl/src/test/java/org/apache/tuscany/sca/interfacedef/wsdl/introspect/WSDLOperationIntrospectorTestCase.java
@@ -67,9 +67,10 @@ public class WSDLOperationIntrospectorTestCase extends AbstractWSDLTestCase {
DataType<XMLType> type = inputType.getLogical().get(0);
Assert.assertEquals(new QName("http://example.com/stockquote.xsd", "getLastTradePrice"), type.getLogical().getElementName());
- DataType<XMLType> outputType = op.getOutputType();
+ DataType<List<DataType>> outputType = op.getOutputType();
+ DataType<XMLType> logical = outputType.getLogical().get(0);
Assert.assertEquals(new QName("http://example.com/stockquote.xsd", "getLastTradePriceResponse"),
- outputType.getLogical().getElementName());
+ logical.getLogical().getElementName());
Assert.assertTrue(op.isWrapperStyle());
DataType<List<DataType>> unwrappedInputType = op.getWrapper().getUnwrappedInputType();