Author: scottkurz
Date: Thu Feb 23 18:58:30 2012
New Revision: 1292896

URL: http://svn.apache.org/viewvc?rev=1292896&view=rev
Log:
Fix for TUSCANY-3824.  Thanks Greg.

Modified:
    
tuscany/sca-java-2.x/trunk/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/Interface2WSDLGenerator.java
    
tuscany/sca-java-2.x/trunk/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/WSDLDefinitionGenerator.java
    
tuscany/sca-java-2.x/trunk/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessor.java
    
tuscany/sca-java-2.x/trunk/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/java/org/example/orderservice/OrderServiceBare.java

Modified: 
tuscany/sca-java-2.x/trunk/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/Interface2WSDLGenerator.java
URL: 
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/Interface2WSDLGenerator.java?rev=1292896&r1=1292895&r2=1292896&view=diff
==============================================================================
--- 
tuscany/sca-java-2.x/trunk/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/Interface2WSDLGenerator.java
 (original)
+++ 
tuscany/sca-java-2.x/trunk/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/Interface2WSDLGenerator.java
 Thu Feb 23 18:58:30 2012
@@ -360,9 +360,10 @@ public class Interface2WSDLGenerator {
             javax.wsdl.Operation operation = generateOperation(definition, op, 
helpers, wrappers);
             portType.addOperation(operation);
             String action = ((JavaOperation)op).getAction();
-            if ((action == null || "".equals(action)) && 
!op.isInputWrapperStyle() && op.getInputWrapper() == null) {
-                // Bare style
-                action = "urn:" + op.getName();
+            // Removed improper defaulting of SOAP action when using doc/lit 
BARE.
+            // The correct default is "" (empty string).
+            if (action == null) {
+                action = "";
             }
             BindingOperation bindingOp = 
definitionGenerator.createBindingOperation(definition, operation, action);
             binding.addBindingOperation(bindingOp);

Modified: 
tuscany/sca-java-2.x/trunk/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/WSDLDefinitionGenerator.java
URL: 
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/WSDLDefinitionGenerator.java?rev=1292896&r1=1292895&r2=1292896&view=diff
==============================================================================
--- 
tuscany/sca-java-2.x/trunk/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/WSDLDefinitionGenerator.java
 (original)
+++ 
tuscany/sca-java-2.x/trunk/modules/binding-ws-wsdlgen/src/main/java/org/apache/tuscany/sca/binding/ws/wsdlgen/WSDLDefinitionGenerator.java
 Thu Feb 23 18:58:30 2012
@@ -161,8 +161,12 @@ public class WSDLDefinitionGenerator {
         try {
             for (Iterator oi = portType.getOperations().iterator(); 
oi.hasNext();) {
                 Operation operation = (Operation)oi.next();
+                // Removed improper defaulting of SOAP action.  
createBindingOperations() is called
+                // when binding.ws does not supply a WSDL binding and the 
reference is using interface.wsdl.
+                // In this case there is no source for a user-supplied action.
+                // The correct default is "" (empty string).
                 BindingOperation bindingOperation =
-                    createBindingOperation(definition, operation, "urn:" + 
operation.getName());
+                    createBindingOperation(definition, operation, "");
                 binding.addBindingOperation(bindingOperation);
             }
         } catch (WSDLException e) {

Modified: 
tuscany/sca-java-2.x/trunk/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessor.java
URL: 
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessor.java?rev=1292896&r1=1292895&r2=1292896&view=diff
==============================================================================
--- 
tuscany/sca-java-2.x/trunk/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessor.java
 (original)
+++ 
tuscany/sca-java-2.x/trunk/modules/interface-java-jaxws/src/main/java/org/apache/tuscany/sca/interfacedef/java/jaxws/JAXWSJavaInterfaceProcessor.java
 Thu Feb 23 18:58:30 2012
@@ -175,33 +175,40 @@ public class JAXWSJavaInterfaceProcessor
             // 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.

Modified: 
tuscany/sca-java-2.x/trunk/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/java/org/example/orderservice/OrderServiceBare.java
URL: 
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/java/org/example/orderservice/OrderServiceBare.java?rev=1292896&r1=1292895&r2=1292896&view=diff
==============================================================================
--- 
tuscany/sca-java-2.x/trunk/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/java/org/example/orderservice/OrderServiceBare.java
 (original)
+++ 
tuscany/sca-java-2.x/trunk/testing/itest/ws/holder-ws-service-multiple-outputs/src/main/java/org/example/orderservice/OrderServiceBare.java
 Thu Feb 23 18:58:30 2012
@@ -1,43 +1,45 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.    
- */
-
-package org.example.orderservice;
-
-import javax.jws.WebParam;
-import javax.jws.WebService;
-import javax.jws.soap.SOAPBinding;
-import javax.xml.ws.Holder;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-@WebService
-@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
-public interface OrderServiceBare {
-
-    public Order bareReviewOrder(Order order);
-
-    public void bareReviewOrderInOutHolder(
-        @WebParam(mode = WebParam.Mode.INOUT)
-        Holder<Order> myData);
-    
-    public void bareReviewOrderOutHolder(
-        @WebParam(mode = WebParam.Mode.OUT)
-        Holder<Order> myData);
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+ */
+
+package org.example.orderservice;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.xml.ws.Holder;
+
+import org.oasisopen.sca.annotation.Remotable;
+
+@WebService
+@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
+public interface OrderServiceBare {
+
+    public Order bareReviewOrder(Order order);
+
+    public void bareReviewOrderInOutHolder(
+        @WebParam(mode = WebParam.Mode.INOUT)
+        Holder<Order> myData);
+
+    @WebMethod(action = "bareReviewOrderOutHolder")
+    public void bareReviewOrderOutHolder(
+        @WebParam(mode = WebParam.Mode.OUT)
+        Holder<Order> myData);
+
+}


Reply via email to