diff options
author | scottkurz <scottkurz@13f79535-47bb-0310-9956-ffa450edef68> | 2011-01-20 14:57:06 +0000 |
---|---|---|
committer | scottkurz <scottkurz@13f79535-47bb-0310-9956-ffa450edef68> | 2011-01-20 14:57:06 +0000 |
commit | de7789044d196dfadab3b8ddfddf2f26f7a1bbd8 (patch) | |
tree | a2eef7b87fb6b98af951c68a188ceb9ac5977f47 /sca-java-2.x/trunk/modules/interface-java-jaxws/src/main | |
parent | 81ab42fb0730a787d799c870e09726ec1fb82116 (diff) |
Fix for TUSCANY-3819 (still need to cleanup bare case, wsdlgen).
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1061329 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/interface-java-jaxws/src/main')
2 files changed, 42 insertions, 25 deletions
diff --git a/sca-java-2.x/trunk/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSAsyncInterfaceProcessor.java b/sca-java-2.x/trunk/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSAsyncInterfaceProcessor.java index a57a0b4678..315054fc82 100644 --- a/sca-java-2.x/trunk/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSAsyncInterfaceProcessor.java +++ b/sca-java-2.x/trunk/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSAsyncInterfaceProcessor.java @@ -82,7 +82,7 @@ public class JAXWSAsyncInterfaceProcessor implements JavaInterfaceVisitor { */ private static boolean isJAXWSAsyncPoolingOperation(Operation operation, Operation asyncOperation) { - if (asyncOperation.getOutputType().getLogical().get(0) == null || Response.class != asyncOperation.getOutputType().getLogical().get(0).getPhysical()) { + if (asyncOperation.getOutputType().getLogical().size() == 0 || Response.class != asyncOperation.getOutputType().getLogical().get(0).getPhysical()) { // The return type is not Response<T> return false; } @@ -149,7 +149,7 @@ public class JAXWSAsyncInterfaceProcessor implements JavaInterfaceVisitor { */ private static boolean isJAXWSAsyncCallbackOperation(Operation operation, Operation asyncOperation) { - if (asyncOperation.getOutputType().getLogical().get(0) == null || Future.class != asyncOperation.getOutputType().getLogical().get(0).getPhysical()) { + if (asyncOperation.getOutputType().getLogical().size() == 0 || Future.class != asyncOperation.getOutputType().getLogical().get(0).getPhysical()) { // The return type is not Future<?> return false; } diff --git a/sca-java-2.x/trunk/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessor.java b/sca-java-2.x/trunk/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessor.java index 74b2b53543..da70b3ffba 100644 --- a/sca-java-2.x/trunk/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessor.java +++ b/sca-java-2.x/trunk/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessor.java @@ -276,27 +276,11 @@ public class JAXWSJavaInterfaceProcessor implements JavaInterfaceVisitor { }); QName outputWrapper = outputWrapperDT.getLogical().getElementName(); - List<ElementInfo> inputElements = new ArrayList<ElementInfo>(); - for (int i = 0; i < method.getParameterTypes().length; i++) { - WebParam param = getAnnotation(method, i, WebParam.class); - ns = param != null ? param.targetNamespace() : ""; - // Default to "" for doc-lit-wrapped && non-header - ns = getValue(ns, documentStyle && (param == null || !param.header()) ? "" : tns); - name = param != null ? param.name() : ""; - name = getValue(name, "arg" + i); - QName element = new QName(ns, name); - Object logical = operation.getInputType().getLogical().get(i).getLogical(); - QName type = null; - if (logical instanceof XMLType) { - ((XMLType)logical).setElementName(element); - type = ((XMLType)logical).getTypeName(); - } - inputElements.add(new ElementInfo(element, new TypeInfo(type, false, null))); - if (param != null) { - operation.getParameterModes().set(i, getParameterMode(param.mode())); - } - } - + + // + // Since JAX-WS specifies that the output wrapper bean consists of the return type output first followed + // by any other outputs carried in Holder(s), let's look at the output first. + // List<ElementInfo> outputElements = new ArrayList<ElementInfo>(); WebResult result = method.getAnnotation(WebResult.class); // Default to "" for doc-lit-wrapped && non-header @@ -306,7 +290,8 @@ public class JAXWSJavaInterfaceProcessor implements JavaInterfaceVisitor { name = getValue(name, "return"); QName element = new QName(ns, name); - if ((operation.getOutputType() != null) && ( operation.getOutputType().getLogical().get(0) != null)) { + // This must be a check for void? + if ((operation.getOutputType() != null) && (operation.getOutputType().getLogical().size() != 0)) { Object logical = operation.getOutputType().getLogical().get(0).getLogical(); QName type = null; if (logical instanceof XMLType) { @@ -315,7 +300,39 @@ public class JAXWSJavaInterfaceProcessor implements JavaInterfaceVisitor { } outputElements.add(new ElementInfo(element, new TypeInfo(type, false, null))); } - + + List<ElementInfo> inputElements = new ArrayList<ElementInfo>(); + for (int i = 0; i < method.getParameterTypes().length; i++) { + WebParam param = getAnnotation(method, i, WebParam.class); + ns = param != null ? param.targetNamespace() : ""; + // Default to "" for doc-lit-wrapped && non-header + ns = getValue(ns, documentStyle && (param == null || !param.header()) ? "" : tns); + name = param != null ? param.name() : ""; + name = getValue(name, "arg" + i); + element = new QName(ns, name); + Object logical = operation.getInputType().getLogical().get(i).getLogical(); + QName type = null; + if (logical instanceof XMLType) { + ((XMLType)logical).setElementName(element); + type = ((XMLType)logical).getTypeName(); + } + + if (param != null) { + ParameterMode mode = getParameterMode(param.mode()); + operation.getParameterModes().set(i, mode); + } + ParameterMode mode = operation.getParameterModes().get(i); + + if (mode.equals(ParameterMode.INOUT)) { + inputElements.add(new ElementInfo(element, new TypeInfo(type, false, null))); + outputElements.add(new ElementInfo(element, new TypeInfo(type, false, null))); + } else if (mode.equals(ParameterMode.OUT)) { + outputElements.add(new ElementInfo(element, new TypeInfo(type, false, null))); + } else { + inputElements.add(new ElementInfo(element, new TypeInfo(type, false, null))); + } + } + String db = inputWrapperDT != null ? inputWrapperDT.getDataBinding() : JAXB_DATABINDING; WrapperInfo wrapperInfo = new WrapperInfo(db, new ElementInfo(inputWrapper, null), new ElementInfo(outputWrapper, null), |