diff options
author | scottkurz <scottkurz@13f79535-47bb-0310-9956-ffa450edef68> | 2012-02-23 18:58:30 +0000 |
---|---|---|
committer | scottkurz <scottkurz@13f79535-47bb-0310-9956-ffa450edef68> | 2012-02-23 18:58:30 +0000 |
commit | f46dc97c15a4b8fd0a58a96a4f7080ae8648c0a8 (patch) | |
tree | 6967c9092b69456f3a9cdd899010fde51558c4a5 /sca-java-2.x/trunk/modules/interface-java-jaxws/src/main/java/org | |
parent | db53a81138ed703d9be0cb32a0c23c8ea6e8c58e (diff) |
Fix for TUSCANY-3824. Thanks Greg.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1292896 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/interface-java-jaxws/src/main/java/org')
-rw-r--r-- | sca-java-2.x/trunk/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessor.java | 47 |
1 files changed, 27 insertions, 20 deletions
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 3fc646cdfa..2e6b19b451 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 @@ -175,33 +175,40 @@ public class JAXWSJavaInterfaceProcessor implements JavaInterfaceVisitor { // Handle BARE mapping if (bare) { for (int i = 0; i < method.getParameterTypes().length; i++) { + String ns = tns; + // Default to <operationName> for doc-bare + String name = (documentStyle ? operationName : "arg" + i); WebParam param = getAnnotation(method, i, WebParam.class); if (param != null) { - String ns = getValue(param.targetNamespace(), tns); - // Default to <operationName> for doc-bare - String name = getValue(param.name(), documentStyle ? operationName : "arg" + i); - QName element = new QName(ns, name); - Object logical = operation.getInputType().getLogical().get(i).getLogical(); - if (logical instanceof XMLType) { - ((XMLType)logical).setElementName(element); - } + if (!"".equals(param.targetNamespace())) + ns = param.targetNamespace(); + if (!"".equals(param.name())) + name = param.name(); operation.getParameterModes().set(i, getParameterMode(param.mode())); } - ParameterMode mode = operation.getParameterModes().get(i); + QName element = new QName(ns, name); + Object logical = operation.getInputType().getLogical().get(i).getLogical(); + if (logical instanceof XMLType) { + ((XMLType)logical).setElementName(element); + } } - - WebResult result = method.getAnnotation(WebResult.class); - if (result != null) { - String ns = getValue(result.targetNamespace(), tns); + + if (!operation.hasReturnTypeVoid()) { + String ns = tns; // Default to <operationName>Response for doc-bare - String name = getValue(result.name(), documentStyle ? operationName + "Response" : "return"); + String name = (documentStyle ? operationName + "Response" : "return"); + WebResult result = method.getAnnotation(WebResult.class); + if (result != null) { + if (!"".equals(result.targetNamespace())) + ns = result.targetNamespace(); + if (!"".equals(result.name())) + name = result.name(); + } QName element = new QName(ns, name); - if (!operation.hasReturnTypeVoid()) { - List<DataType> outputDataTypes = operation.getOutputType().getLogical(); - DataType returnDataType = outputDataTypes.get(0); - if (returnDataType instanceof XMLType) { - ((XMLType)returnDataType).setElementName(element); - } + List<DataType> outputDataTypes = operation.getOutputType().getLogical(); + DataType returnDataType = outputDataTypes.get(0); + if (returnDataType instanceof XMLType) { + ((XMLType)returnDataType).setElementName(element); } } // Rather than relying on null wrapper, we use a flag with a clearer meaning. |