cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From egl...@apache.org
Subject svn commit: r538905 - in /incubator/cxf/trunk/rt/frontend: jaxws/src/test/java/org/apache/cxf/jaxws/spring/ simple/src/main/java/org/apache/cxf/frontend/
Date Thu, 17 May 2007 13:16:42 GMT
Author: eglynn
Date: Thu May 17 06:16:38 2007
New Revision: 538905

URL: http://svn.apache.org/viewvc?view=rev&rev=538905
Log:
Fix for interceptor injection into <jaxws:client> beans.


Modified:
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/SpringBeansTest.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/clients.xml
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/endpoints.xml
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientProxyFactoryBean.java

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/SpringBeansTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/SpringBeansTest.java?view=diff&rev=538905&r1=538904&r2=538905
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/SpringBeansTest.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/SpringBeansTest.java
Thu May 17 06:16:38 2007
@@ -117,6 +117,8 @@
                 logging = true;
             }
         }
+        assertTrue(saaj);
+        assertTrue(logging);
     }
     
     @Test
@@ -152,5 +154,30 @@
         assertNotNull("expected ConduitSelector", client.getConduitSelector());
         assertTrue("unexpected ConduitSelector",
                    client.getConduitSelector() instanceof NullConduitSelector);
+        
+        List<Interceptor> inInterceptors = client.getInInterceptors();
+        boolean saaj = false;
+        boolean logging = false;
+        for (Interceptor<?> i : inInterceptors) {
+            if (i instanceof SAAJInInterceptor) {
+                saaj = true;
+            } else if (i instanceof LoggingInInterceptor) {
+                logging = true;
+            }
+        }
+        assertTrue(saaj);
+        assertTrue(logging);
+        
+        saaj = false;
+        logging = false;
+        for (Interceptor<?> i : client.getOutInterceptors()) {
+            if (i instanceof SAAJOutInterceptor) {
+                saaj = true;
+            } else if (i instanceof LoggingOutInterceptor) {
+                logging = true;
+            }
+        }
+        assertTrue(saaj);
+        assertTrue(logging);
     }
 }

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/clients.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/clients.xml?view=diff&rev=538905&r1=538904&r2=538905
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/clients.xml
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/clients.xml
Thu May 17 06:16:38 2007
@@ -39,11 +39,22 @@
       </property>
   </bean>
   
+  <bean id="saajIn" class="org.apache.cxf.binding.soap.saaj.SAAJInInterceptor"/>
+  <bean id="saajOut" class="org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor"/>
+  
   <jaxws:client id="client1" 
     serviceClass="org.apache.hello_world_soap_http.Greeter"
     address="http://localhost:9000/foo"
     serviceName="s:SOAPService"
     xmlns:s="http://apache.org/hello_world_soap_http">
+    <jaxws:inInterceptors>
+	  <bean class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
+	  <ref bean="saajIn"/>
+	</jaxws:inInterceptors>
+	<jaxws:outInterceptors>
+	  <bean class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
+	  <ref bean="saajOut"/>
+	</jaxws:outInterceptors>
     <jaxws:conduitSelector>
       <bean class="org.apache.cxf.endpoint.NullConduitSelector"/>
     </jaxws:conduitSelector>

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/endpoints.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/endpoints.xml?view=diff&rev=538905&r1=538904&r2=538905
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/endpoints.xml
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/endpoints.xml
Thu May 17 06:16:38 2007
@@ -72,17 +72,19 @@
     implementor="#greeter" address="http://localhost:8080/simpleWithAddress"
     wsdlLocation="wsdl/hello_world.wsdl"/>
     
+  <bean id="saajIn" class="org.apache.cxf.binding.soap.saaj.SAAJInInterceptor"/>
+  <bean id="saajOut" class="org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor"/>
       
   <jaxws:endpoint id="epWithInterceptors" 
     implementor="org.apache.cxf.jaxws.service.Hello"
     address="http://localhost:8080/test">
 	<jaxws:inInterceptors>
 	  <bean class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
-	  <bean class="org.apache.cxf.binding.soap.saaj.SAAJInInterceptor"/>
+	  <ref bean="saajIn"/>
 	</jaxws:inInterceptors>
 	<jaxws:outInterceptors>
+	  <ref bean="saajOut"/>
 	  <bean class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
-	  <bean class="org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor"/>
 	</jaxws:outInterceptors>
   </jaxws:endpoint>
 

Modified: incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientProxyFactoryBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientProxyFactoryBean.java?view=diff&rev=538905&r1=538904&r2=538905
==============================================================================
--- incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientProxyFactoryBean.java
(original)
+++ incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientProxyFactoryBean.java
Thu May 17 06:16:38 2007
@@ -80,6 +80,18 @@
         }
 
         Client c = clientFactoryBean.create();
+        if (getInInterceptors() != null) {
+            c.getInInterceptors().addAll(getInInterceptors());
+        }
+        if (getOutInterceptors() != null) {
+            c.getOutInterceptors().addAll(getOutInterceptors());
+        }
+        if (getInFaultInterceptors() != null) {
+            c.getInFaultInterceptors().addAll(getInFaultInterceptors());
+        }
+        if (getOutFaultInterceptors() != null) {
+            c.getOutFaultInterceptors().addAll(getOutFaultInterceptors());
+        }
 
         ClientProxy handler = clientClientProxy(c);
 



Mime
View raw message