cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r532834 - in /incubator/cxf/trunk/rt: bindings/soap/src/main/java/org/apache/cxf/binding/soap/ frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/ frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ frontend/jaxws/src/test/java/org/ap...
Date Thu, 26 Apr 2007 18:28:39 GMT
Author: gawor
Date: Thu Apr 26 11:28:37 2007
New Revision: 532834

URL: http://svn.apache.org/viewvc?view=rev&rev=532834
Log:
handle WebParam.action annotation attribute

Modified:
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingConfiguration.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/CodeFirstTest.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/service/Hello.java
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/AbstractServiceConfiguration.java
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingConfiguration.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingConfiguration.java?view=diff&rev=532834&r1=532833&r2=532834
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingConfiguration.java
(original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingConfiguration.java
Thu Apr 26 11:28:37 2007
@@ -42,7 +42,12 @@
     }
 
     public String getSoapAction(OperationInfo op) {
-        return defaultSoapAction;
+        String action = (String)op.getProperty("action");
+        if (action == null) {
+            return defaultSoapAction;
+        } else {
+            return action;
+        }
     }
 
     public String getTransportURI() {

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java?view=diff&rev=532834&r1=532833&r2=532834
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java
Thu Apr 26 11:28:37 2007
@@ -531,5 +531,15 @@
         return !method.isAnnotationPresent(Oneway.class);
     }
     
-    
+    @Override 
+    public String getAction(OperationInfo op, Method method) {
+        method = getDeclaredMethod(method);
+        WebMethod wm = method.getAnnotation(WebMethod.class);
+        if (wm != null) {
+            return wm.action();
+        } else {
+            return "";
+        }
+    }
+           
 }

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/CodeFirstTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/CodeFirstTest.java?view=diff&rev=532834&r1=532833&r2=532834
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/CodeFirstTest.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/CodeFirstTest.java
Thu Apr 26 11:28:37 2007
@@ -69,6 +69,10 @@
 
         assertValid("/wsdl:definitions/wsdl:message[@name='getGreetingsResponse']"
                     + "/wsdl:part[@element='ns1:getGreetingsResponse'][@name='return']",
+                    wsdl);    
+
+        assertValid("/wsdl:definitions/wsdl:binding/wsdl:operation[@name='getGreetings']"
+                    + "/wsdlsoap:operation[@soapAction='myaction']",
                     wsdl);        
     }
 

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/service/Hello.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/service/Hello.java?view=diff&rev=532834&r1=532833&r2=532834
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/service/Hello.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/service/Hello.java
Thu Apr 26 11:28:37 2007
@@ -32,7 +32,7 @@
         return text;
     }
     
-    @WebMethod
+    @WebMethod(action = "myaction")
     public List<String> getGreetings() {
         List<String> strings = new ArrayList<String>();
         strings.add("Hello");

Modified: incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/AbstractServiceConfiguration.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/AbstractServiceConfiguration.java?view=diff&rev=532834&r1=532833&r2=532834
==============================================================================
--- incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/AbstractServiceConfiguration.java
(original)
+++ incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/AbstractServiceConfiguration.java
Thu Apr 26 11:28:37 2007
@@ -89,7 +89,7 @@
         return null;
     }
 
-    public String getAction(OperationInfo op) {
+    public String getAction(OperationInfo op, Method method) {
         return null;
     }
 

Modified: incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java?view=diff&rev=532834&r1=532833&r2=532834
==============================================================================
--- incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
(original)
+++ incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
Thu Apr 26 11:28:37 2007
@@ -344,6 +344,8 @@
 
     protected OperationInfo createOperation(ServiceInfo serviceInfo, InterfaceInfo intf,
Method m) {
         OperationInfo op = intf.addOperation(getOperationName(intf, m));
+        op.setProperty("action", getAction(op, m));
+        
         if (isWrapped(m)) {
             UnwrappedOperationInfo uOp = new UnwrappedOperationInfo(op);
             op.setUnwrappedOperation(uOp);
@@ -983,15 +985,15 @@
         throw new IllegalStateException("ServiceConfiguration must provide a value!");
     }
 
-    protected String getAction(OperationInfo op) {
+    protected String getAction(OperationInfo op, Method method) {
         for (Iterator itr = serviceConfigurations.iterator(); itr.hasNext();) {
             AbstractServiceConfiguration c = (AbstractServiceConfiguration)itr.next();
-            String s = c.getAction(op);
+            String s = c.getAction(op, method);
             if (s != null) {
                 return s;
             }
         }
-        throw new IllegalStateException("ServiceConfiguration must provide a value!");
+        return "";
     }
 
     public boolean isHeader(Method method, int j) {



Mime
View raw message