cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r542652 - in /incubator/cxf/trunk/rt/frontend/jaxws/src: main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java test/java/org/apache/cxf/jaxws/support/JaxWsServiceConfigurationTest.java
Date Tue, 29 May 2007 21:05:08 GMT
Author: gawor
Date: Tue May 29 14:05:07 2007
New Revision: 542652

URL: http://svn.apache.org/viewvc?view=rev&rev=542652
Log:
partName can only be used with rpc or doc/bare services, cleaned up isRPC method and related
tests

Modified:
    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/support/JaxWsServiceConfigurationTest.java

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=542652&r1=542651&r2=542652
==============================================================================
--- 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
Tue May 29 14:05:07 2007
@@ -194,7 +194,9 @@
         String tns = mi.getName().getNamespaceURI();
         String local = null;
         if (param != null) {
-            local = param.partName();
+            if (Boolean.TRUE.equals(isRPC(method)) || isDocumentBare(method)) {
+                local = param.partName();
+            }
             if (local == null || local.length() == 0) {
                 local = param.name();
             }
@@ -355,7 +357,9 @@
             String tns = op.getOutput().getName().getNamespaceURI();
             String local = null;
             if (webResult != null) {
-                local = webResult.partName();
+                if (Boolean.TRUE.equals(isRPC(method)) || isDocumentBare(method)) {
+                    local = webResult.partName();
+                }
                 if (local == null || local.length() == 0) {
                     local = webResult.name();
                 }
@@ -586,15 +590,23 @@
         return "document";
     }
     
-    
+    private boolean isDocumentBare(Method method) {
+        SOAPBinding ann = method.getAnnotation(SOAPBinding.class);
+        if (ann != null) {
+            return ann.style().equals(SOAPBinding.Style.DOCUMENT) 
+                   && ann.parameterStyle().equals(SOAPBinding.ParameterStyle.BARE);
+        }
+        ann = implInfo.getEndpointClass().getAnnotation(SOAPBinding.class);
+        if (ann != null) {
+            return ann.style().equals(SOAPBinding.Style.DOCUMENT) 
+                   && ann.parameterStyle().equals(SOAPBinding.ParameterStyle.BARE);
+        }
+        return false;
+    }
     
     @Override
     public Boolean isRPC(Method method) {
         SOAPBinding ann = implInfo.getEndpointClass().getAnnotation(SOAPBinding.class);
-        if (ann != null) {
-            return ann.style().equals(SOAPBinding.Style.RPC);
-        }
-        ann = method.getAnnotation(SOAPBinding.class);
         if (ann != null) {
             return ann.style().equals(SOAPBinding.Style.RPC);
         }

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/support/JaxWsServiceConfigurationTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/support/JaxWsServiceConfigurationTest.java?view=diff&rev=542652&r1=542651&r2=542652
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/support/JaxWsServiceConfigurationTest.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/support/JaxWsServiceConfigurationTest.java
Tue May 29 14:05:07 2007
@@ -75,11 +75,10 @@
 
     public void testDefaultStyle() throws Exception {
         JaxWsServiceFactoryBean bean = new JaxWsServiceFactoryBean();
-        bean.setServiceClass(Hello.class);
+        bean.setServiceClass(HelloDefault.class);
         JaxWsServiceConfiguration jwsc = (JaxWsServiceConfiguration) bean.getServiceConfigurations().get(0);
         jwsc.setServiceFactory(bean);
 
-        // REVIST: the Hello.class,  is not a valide JAXWS SEI, the Style.RPC can not on
method (JSR-181)
         assertEquals("document", jwsc.getStyle());
         assertNull(jwsc.isWrapped());
     }
@@ -161,16 +160,22 @@
         return serviceInfo;
     }
 
-    // REVISIT this is not a valid JAXWS SEI Style.RPC can not put on method. (JSR-181)
     @WebService(name = "Hello", targetNamespace = "http://cxf.com/")
+    @SOAPBinding(parameterStyle = javax.jws.soap.SOAPBinding.ParameterStyle.BARE, 
+                 style = javax.jws.soap.SOAPBinding.Style.RPC, use = javax.jws.soap.SOAPBinding.Use.LITERAL)
     public interface Hello {
-        @SOAPBinding(parameterStyle = javax.jws.soap.SOAPBinding.ParameterStyle.BARE, 
-                style = javax.jws.soap.SOAPBinding.Style.RPC, use = javax.jws.soap.SOAPBinding.Use.LITERAL)
         @WebMethod(operationName = "sayHi", exclude = false)
         String sayHi();
 
-        @SOAPBinding(parameterStyle = javax.jws.soap.SOAPBinding.ParameterStyle.BARE, 
-                style = javax.jws.soap.SOAPBinding.Style.RPC, use = javax.jws.soap.SOAPBinding.Use.LITERAL)
+        @WebMethod(operationName = "sayHello", exclude = false)
+        String sayHello(String asdf1, String asdf2);
+    }
+
+    @WebService(name = "Hello", targetNamespace = "http://cxf.com/")
+    public interface HelloDefault {
+        @WebMethod(operationName = "sayHi", exclude = false)
+        String sayHi();
+
         @WebMethod(operationName = "sayHello", exclude = false)
         String sayHello(String asdf1, String asdf2);
     }



Mime
View raw message