Index: tests/camel-itest/src/test/java/org/apache/camel/itest/customerrelations/CustomerServicesTest.java =================================================================== --- tests/camel-itest/src/test/java/org/apache/camel/itest/customerrelations/CustomerServicesTest.java (revision 676981) +++ tests/camel-itest/src/test/java/org/apache/camel/itest/customerrelations/CustomerServicesTest.java (working copy) @@ -16,7 +16,19 @@ */ package org.apache.camel.itest.customerrelations; +import java.lang.reflect.Proxy; +import java.util.List; +import java.util.Map; + import junit.framework.TestCase; + +import org.apache.cxf.helpers.CastUtils; +import org.apache.cxf.interceptor.Fault; +import org.apache.cxf.jaxws.EndpointImpl; +import org.apache.cxf.jaxws.JaxWsClientProxy; +import org.apache.cxf.message.Message; +import org.apache.cxf.phase.AbstractPhaseInterceptor; +import org.apache.cxf.phase.Phase; import org.springframework.context.support.ClassPathXmlApplicationContext; public class CustomerServicesTest extends TestCase { @@ -29,10 +41,19 @@ new String[] {"spring-config/server-applicationContext.xml"}); Object server = serverContext.getBean("org.apache.camel.itest.customerrelations.CustomerServiceV1"); assertNotNull("We should get server here", server); - + + // add an interceptor to verify headers + EndpointImpl.class.cast(server).getServer().getEndpoint().getInInterceptors() + .add(new HeaderChecker(Phase.PRE_STREAM)); + clientContext = new ClassPathXmlApplicationContext( new String[] {"spring-config/client-applicationContext.xml"}); CustomerServiceV1 customerService = (CustomerServiceV1) clientContext.getBean("org.apache.camel.itest.customerrelations.CustomerServiceV1"); + + // add an interceptor to verify headers + JaxWsClientProxy.class.cast(Proxy.getInvocationHandler(customerService)) + .getClient().getInInterceptors().add(new HeaderChecker(Phase.PRE_STREAM)); + Customer customer = customerService.getCustomer("12345"); assertNotNull("We should get Customer here", customer); } finally { @@ -44,5 +65,17 @@ } } } - + + class HeaderChecker extends AbstractPhaseInterceptor { + public HeaderChecker(String phase) { + super(phase); + } + + public void handleMessage(Message message) throws Fault { + Map> headers + = CastUtils.cast((Map)message.get(Message.PROTOCOL_HEADERS)); + assertNotNull(headers); + assertEquals("\"getCustomer\"", headers.get("SOAPAction").get(0)); + } + } } Index: tests/camel-itest/src/test/resources/spring-config/client-applicationContext.xml =================================================================== --- tests/camel-itest/src/test/resources/spring-config/client-applicationContext.xml (revision 676981) +++ tests/camel-itest/src/test/resources/spring-config/client-applicationContext.xml (working copy) @@ -22,30 +22,20 @@ http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd http://cxf.apache.org/transports/camel http://cxf.apache.org/transports/camel.xsd"> - + + + - - - - - - - - http://cxf.apache.org/transports/camel - - - - + address="camel://direct:clientOutbound"> + @@ -61,7 +51,7 @@ xmlns="http://activemq.apache.org/camel/schema/spring"> - + Index: tests/camel-itest/src/test/resources/spring-config/server-applicationContext.xml =================================================================== --- tests/camel-itest/src/test/resources/spring-config/server-applicationContext.xml (revision 676981) +++ tests/camel-itest/src/test/resources/spring-config/server-applicationContext.xml (working copy) @@ -29,8 +29,7 @@ - + @@ -38,22 +37,12 @@ - - - - - - http://cxf.apache.org/transports/camel - - - - @@ -73,7 +62,7 @@ + uri="direct:serverInbound" />