cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r949119 - in /cxf/trunk: rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/ tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/ tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/processor/ tools/javato/ws/src/t...
Date Fri, 28 May 2010 07:09:55 GMT
Author: ema
Date: Fri May 28 07:09:54 2010
New Revision: 949119

URL: http://svn.apache.org/viewvc?rev=949119&view=rev
Log:
[CXF-2831]:Compute wsa action value for empty FaultAction;Added wsam and wsad action value
for back compatibility

Modified:
    cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
    cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/AddNumbersImpl.java
    cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java
    cxf/trunk/tools/javato/ws/src/test/resources/org/apache/cxf/tools/java2wsdl/processor/expected/add_numbers_expected.wsdl

Modified: cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java?rev=949119&r1=949118&r2=949119&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
(original)
+++ cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBean.java
Fri May 28 07:09:54 2010
@@ -489,21 +489,28 @@ public class JaxWsServiceFactoryBean ext
         if (action == null && addressing != null) {
             operation.getInput().addExtensionAttribute(JAXWSAConstants.WSAM_ACTION_QNAME,
                                                        computeAction(operation, "Request"));
+            operation.getInput().addExtensionAttribute(JAXWSAConstants.WSAW_ACTION_QNAME,
+                                                       computeAction(operation, "Request"));
             operation.getOutput().addExtensionAttribute(JAXWSAConstants.WSAM_ACTION_QNAME,
                                                        computeAction(operation, "Response"));
+            operation.getOutput().addExtensionAttribute(JAXWSAConstants.WSAW_ACTION_QNAME,
+                                                        computeAction(operation, "Response"));
 
         } else {
             MessageInfo input = operation.getInput();
             if (!StringUtils.isEmpty(action.input())) {
                 input.addExtensionAttribute(JAXWSAConstants.WSAW_ACTION_QNAME, action.input());
+                input.addExtensionAttribute(JAXWSAConstants.WSAM_ACTION_QNAME, action.input());
             } else {
                 input.addExtensionAttribute(JAXWSAConstants.WSAM_ACTION_QNAME, computeAction(operation,
                                                                                         
    "Request"));
+                
             }
 
             MessageInfo output = operation.getOutput();
             if (output != null && !StringUtils.isEmpty(action.output())) {
                 output.addExtensionAttribute(JAXWSAConstants.WSAW_ACTION_QNAME, action.output());
+                output.addExtensionAttribute(JAXWSAConstants.WSAM_ACTION_QNAME, action.output());
             } else if (output != null) {
                 output.addExtensionAttribute(JAXWSAConstants.WSAM_ACTION_QNAME, computeAction(operation,
                                                                                         
     "Response"));
@@ -513,15 +520,21 @@ public class JaxWsServiceFactoryBean ext
             if (faultActions != null && faultActions.length > 0 && operation.getFaults()
!= null) {
                 for (FaultAction faultAction : faultActions) {
                     FaultInfo faultInfo = getFaultInfo(operation, faultAction.className());
-                    faultInfo.addExtensionAttribute(JAXWSAConstants.WSAW_ACTION_QNAME, faultAction.value());
-                    faultInfo.addExtensionAttribute(JAXWSAConstants.WSAM_ACTION_QNAME, faultAction.value());
-                    if (operation.isUnwrappedCapable()) {
-                        faultInfo = getFaultInfo(operation.getUnwrappedOperation(), faultAction.className());
+                    if (!StringUtils.isEmpty(faultAction.value())) {
                         faultInfo.addExtensionAttribute(JAXWSAConstants.WSAW_ACTION_QNAME,
faultAction
                             .value());
                         faultInfo.addExtensionAttribute(JAXWSAConstants.WSAM_ACTION_QNAME,
faultAction
                             .value());
                     }
+                    if (operation.isUnwrappedCapable()) {
+                        faultInfo = getFaultInfo(operation.getUnwrappedOperation(), faultAction.className());
+                        if (!StringUtils.isEmpty(faultAction.value())) {
+                            faultInfo.addExtensionAttribute(JAXWSAConstants.WSAW_ACTION_QNAME,
faultAction
+                                .value());
+                            faultInfo.addExtensionAttribute(JAXWSAConstants.WSAM_ACTION_QNAME,
faultAction
+                                .value());
+                        }
+                    }
                 }
             }
         }

Modified: cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/AddNumbersImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/AddNumbersImpl.java?rev=949119&r1=949118&r2=949119&view=diff
==============================================================================
--- cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/AddNumbersImpl.java
(original)
+++ cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/AddNumbersImpl.java
Fri May 28 07:09:54 2010
@@ -46,6 +46,14 @@ public class AddNumbersImpl {
     public int addNumbers3(int number1, int number2) throws AddNumbersException {
         return execute(number1, number2);
     }
+    
+    @Action(input = "http://cxf.apache.org/input4", output = "http://cxf.apache.org/output4",
+            fault = {@FaultAction(className = AddNumbersException.class, 
+                                  value = "") })
+    public int addNumbers4(int number1, int number2) throws AddNumbersException {
+        return execute(number1, number2);
+    }
+    
 
     int execute(int number1, int number2) throws AddNumbersException {
         if (number1 < 0 || number2 < 0) {

Modified: cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java?rev=949119&r1=949118&r2=949119&view=diff
==============================================================================
--- cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java
(original)
+++ cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2wsdl/processor/JavaToProcessorTest.java
Fri May 28 07:09:54 2010
@@ -502,12 +502,18 @@ public class JavaToProcessorTest extends
         }
         File wsdlFile = new File(output, "add_numbers.wsdl");
         assertTrue("Generate Wsdl Fail", wsdlFile.exists());
-        //To test there is wsam:action generated for the 
+        // To test there is wsam:action generated for the
         String wsdlString = getStringFromFile(wsdlFile);
+        assertTrue("The wsam and wsaw action are not both generated", wsdlString
+            .indexOf("wsam:Action=\"http://cxf.apache.org/fault3\"" 
+                     + "  wsaw:Action=\"http://cxf.apache.org/fault3\"") > -1);
         assertTrue("The wsaAction is not generated for NOActionAnotation method", wsdlString
             .indexOf("http://fortest.tools.cxf.apache.org/AddNumbersImpl/addNumbers2Request")
> -1);
         assertTrue("The wsaAction is not generated for NOActionAnotation method", wsdlString
             .indexOf("http://fortest.tools.cxf.apache.org/AddNumbersImpl/addNumbers2Response")
> -1);
+        assertTrue("The wsaAction computed for empty FaultAction is not correct", wsdlString
+            .indexOf("http://fortest.tools.cxf.apache.org/"
+                     + "AddNumbersImpl/addNumbers4/Fault/AddNumbersException") > -1);
         URI expectedFile = getClass().getResource("expected/add_numbers_expected.wsdl").toURI();
         assertWsdlEquals(new File(expectedFile), wsdlFile);
     }

Modified: cxf/trunk/tools/javato/ws/src/test/resources/org/apache/cxf/tools/java2wsdl/processor/expected/add_numbers_expected.wsdl
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/javato/ws/src/test/resources/org/apache/cxf/tools/java2wsdl/processor/expected/add_numbers_expected.wsdl?rev=949119&r1=949118&r2=949119&view=diff
==============================================================================
--- cxf/trunk/tools/javato/ws/src/test/resources/org/apache/cxf/tools/java2wsdl/processor/expected/add_numbers_expected.wsdl
(original)
+++ cxf/trunk/tools/javato/ws/src/test/resources/org/apache/cxf/tools/java2wsdl/processor/expected/add_numbers_expected.wsdl
Fri May 28 07:09:54 2010
@@ -7,6 +7,8 @@
   <xs:element name="addNumbers2Response" type="tns:addNumbers2Response"/>
   <xs:element name="addNumbers3" type="tns:addNumbers3"/>
   <xs:element name="addNumbers3Response" type="tns:addNumbers3Response"/>
+  <xs:element name="addNumbers4" type="tns:addNumbers4"/>
+  <xs:element name="addNumbers4Response" type="tns:addNumbers4Response"/>
   <xs:element name="addNumbersResponse" type="tns:addNumbersResponse"/>
   <xs:complexType name="addNumbers">
     <xs:sequence>
@@ -19,6 +21,17 @@
       <xs:element name="return" type="xs:int"/>
     </xs:sequence>
   </xs:complexType>
+  <xs:complexType name="addNumbers4">
+    <xs:sequence>
+      <xs:element name="arg0" type="xs:int"/>
+      <xs:element name="arg1" type="xs:int"/>
+    </xs:sequence>
+  </xs:complexType>
+  <xs:complexType name="addNumbers4Response">
+    <xs:sequence>
+      <xs:element name="return" type="xs:int"/>
+    </xs:sequence>
+  </xs:complexType>
   <xs:complexType name="addNumbers3">
     <xs:sequence>
       <xs:element name="arg0" type="xs:int"/>
@@ -71,31 +84,47 @@
     <wsdl:part name="parameters" element="tns:addNumbers3">
     </wsdl:part>
   </wsdl:message>
+  <wsdl:message name="addNumbers4">
+    <wsdl:part name="parameters" element="tns:addNumbers4">
+    </wsdl:part>
+  </wsdl:message>
   <wsdl:message name="addNumbers3Response">
     <wsdl:part name="parameters" element="tns:addNumbers3Response">
     </wsdl:part>
   </wsdl:message>
+  <wsdl:message name="addNumbers4Response">
+    <wsdl:part name="parameters" element="tns:addNumbers4Response">
+    </wsdl:part>
+  </wsdl:message>
   <wsdl:portType name="AddNumbersImpl">
     <wsdl:operation name="addNumbers">
-      <wsdl:input name="addNumbers" message="tns:addNumbers" wsaw:Action="http://cxf.apache.org/input">
+      <wsdl:input name="addNumbers" message="tns:addNumbers" wsam:Action="http://cxf.apache.org/input"
wsaw:Action="http://cxf.apache.org/input">
     </wsdl:input>
-      <wsdl:output name="addNumbersResponse" message="tns:addNumbersResponse" wsaw:Action="http://cxf.apache.org/output">
+      <wsdl:output name="addNumbersResponse" message="tns:addNumbersResponse" wsam:Action="http://cxf.apache.org/output"
wsaw:Action="http://cxf.apache.org/output">
     </wsdl:output>
       <wsdl:fault name="AddNumbersException" message="tns:AddNumbersException" wsam:Action="http://fortest.tools.cxf.apache.org/AddNumbersImpl/addNumbers/Fault/AddNumbersException">
     </wsdl:fault>
     </wsdl:operation>
+    <wsdl:operation name="addNumbers4">
+      <wsdl:input name="addNumbers4" message="tns:addNumbers4" wsam:Action="http://cxf.apache.org/input4"
wsaw:Action="http://cxf.apache.org/input4">
+    </wsdl:input>
+      <wsdl:output name="addNumbers4Response" message="tns:addNumbers4Response" wsam:Action="http://cxf.apache.org/output4"
wsaw:Action="http://cxf.apache.org/output4">
+    </wsdl:output>
+      <wsdl:fault name="AddNumbersException" message="tns:AddNumbersException" wsam:Action="http://fortest.tools.cxf.apache.org/AddNumbersImpl/addNumbers4/Fault/AddNumbersException">
+    </wsdl:fault>
+    </wsdl:operation>
     <wsdl:operation name="addNumbers3">
-      <wsdl:input name="addNumbers3" message="tns:addNumbers3" wsaw:Action="http://cxf.apache.org/input3">
+      <wsdl:input name="addNumbers3" message="tns:addNumbers3" wsam:Action="http://cxf.apache.org/input3"
wsaw:Action="http://cxf.apache.org/input3">
     </wsdl:input>
-      <wsdl:output name="addNumbers3Response" message="tns:addNumbers3Response" wsaw:Action="http://cxf.apache.org/output3">
+      <wsdl:output name="addNumbers3Response" message="tns:addNumbers3Response" wsam:Action="http://cxf.apache.org/output3"
wsaw:Action="http://cxf.apache.org/output3">
     </wsdl:output>
       <wsdl:fault name="AddNumbersException" message="tns:AddNumbersException" wsam:Action="http://cxf.apache.org/fault3"
wsaw:Action="http://cxf.apache.org/fault3">
     </wsdl:fault>
     </wsdl:operation>
     <wsdl:operation name="addNumbers2">
-      <wsdl:input name="addNumbers2" message="tns:addNumbers2" wsam:Action="http://fortest.tools.cxf.apache.org/AddNumbersImpl/addNumbers2Request">
+      <wsdl:input name="addNumbers2" message="tns:addNumbers2" wsam:Action="http://fortest.tools.cxf.apache.org/AddNumbersImpl/addNumbers2Request"
wsaw:Action="http://fortest.tools.cxf.apache.org/AddNumbersImpl/addNumbers2Request">
     </wsdl:input>
-      <wsdl:output name="addNumbers2Response" message="tns:addNumbers2Response" wsam:Action="http://fortest.tools.cxf.apache.org/AddNumbersImpl/addNumbers2Response">
+      <wsdl:output name="addNumbers2Response" message="tns:addNumbers2Response" wsam:Action="http://fortest.tools.cxf.apache.org/AddNumbersImpl/addNumbers2Response"
wsaw:Action="http://fortest.tools.cxf.apache.org/AddNumbersImpl/addNumbers2Response">
     </wsdl:output>
     </wsdl:operation>
   </wsdl:portType>
@@ -115,6 +144,18 @@
         <soap:fault name="AddNumbersException" use="literal"/>
       </wsdl:fault>
     </wsdl:operation>
+    <wsdl:operation name="addNumbers4">
+      <soap:operation soapAction="" style="document"/>
+      <wsdl:input name="addNumbers4">
+        <soap:body use="literal"/>
+      </wsdl:input>
+      <wsdl:output name="addNumbers4Response">
+        <soap:body use="literal"/>
+      </wsdl:output>
+      <wsdl:fault name="AddNumbersException">
+        <soap:fault name="AddNumbersException" use="literal"/>
+      </wsdl:fault>
+    </wsdl:operation>
     <wsdl:operation name="addNumbers3">
       <soap:operation soapAction="" style="document"/>
       <wsdl:input name="addNumbers3">



Mime
View raw message