You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ni...@apache.org on 2012/09/18 09:30:48 UTC

svn commit: r1387019 - in /camel/trunk/components: camel-cxf-transport/src/main/java/org/apache/camel/component/cxf/common/message/ camel-cxf/ camel-cxf/src/main/java/org/apache/camel/component/cxf/ camel-cxf/src/test/java/org/apache/camel/component/cx...

Author: ningjiang
Date: Tue Sep 18 07:30:47 2012
New Revision: 1387019

URL: http://svn.apache.org/viewvc?rev=1387019&view=rev
Log:
CAMEL-5622 CxfConsumer should avoid using the async invocation with the decouple endpoints transport

Added:
    camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/wsrm/
    camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/wsrm/HelloWorld.java
    camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/wsrm/HelloWorldImpl.java
    camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/wsrm/MessageLossSimulator.java
    camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/wsrm/MyProcessor.java
    camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/wsrm/WSRMTest.java
    camel/trunk/components/camel-cxf/src/test/resources/HelloWorld.wsdl
    camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/wsrm/
    camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/wsrm/WSRMTest-context.xml
    camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/wsrm/ws_rm.xml
Modified:
    camel/trunk/components/camel-cxf-transport/src/main/java/org/apache/camel/component/cxf/common/message/CxfConstants.java
    camel/trunk/components/camel-cxf/pom.xml
    camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfConsumer.java

Modified: camel/trunk/components/camel-cxf-transport/src/main/java/org/apache/camel/component/cxf/common/message/CxfConstants.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf-transport/src/main/java/org/apache/camel/component/cxf/common/message/CxfConstants.java?rev=1387019&r1=1387018&r2=1387019&view=diff
==============================================================================
--- camel/trunk/components/camel-cxf-transport/src/main/java/org/apache/camel/component/cxf/common/message/CxfConstants.java (original)
+++ camel/trunk/components/camel-cxf-transport/src/main/java/org/apache/camel/component/cxf/common/message/CxfConstants.java Tue Sep 18 07:30:47 2012
@@ -54,6 +54,11 @@ public final class CxfConstants {
     public static final String CAMEL_CXF_RS_OPERATION_RESOURCE_INFO_STACK = "CamelCxfRsOperationResourceInfoStack";
     public static final String CAMEL_CXF_ATTACHMENTS = "CamelAttachments";
     public static final String CAMEL_CXF_RS_THROW_EXCEPTION_ON_FAILURE = "CamelCxfRsThrowExceptionOnFailure";
+    
+    public static final String WSA_HEADERS_INBOUND = "javax.xml.ws.addressing.context.inbound";
+
+    public static final String WSA_HEADERS_OUTBOUND = "javax.xml.ws.addressing.context.outbound";
+
 
     private CxfConstants() {
         // Utility class

Modified: camel/trunk/components/camel-cxf/pom.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/pom.xml?rev=1387019&r1=1387018&r2=1387019&view=diff
==============================================================================
--- camel/trunk/components/camel-cxf/pom.xml (original)
+++ camel/trunk/components/camel-cxf/pom.xml Tue Sep 18 07:30:47 2012
@@ -186,6 +186,14 @@
       <version>${cxf-version}</version>
       <scope>test</scope>
     </dependency>
+    
+    <!-- this dependency is just for testing -->
+    <dependency>
+      <groupId>org.apache.cxf</groupId>
+      <artifactId>cxf-rt-ws-rm</artifactId>
+      <version>${cxf-version}</version>
+      <scope>test</scope>
+    </dependency>
 
     <dependency>
       <groupId>org.springframework</groupId>

Modified: camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfConsumer.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfConsumer.java?rev=1387019&r1=1387018&r2=1387019&view=diff
==============================================================================
--- camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfConsumer.java (original)
+++ camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfConsumer.java Tue Sep 18 07:30:47 2012
@@ -36,6 +36,8 @@ import org.apache.cxf.message.Exchange;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.service.invoker.Invoker;
 import org.apache.cxf.service.model.BindingOperationInfo;
+import org.apache.cxf.ws.addressing.AddressingProperties;
+import org.apache.cxf.ws.addressing.ContextUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -63,7 +65,8 @@ public class CxfConsumer extends Default
             public Object invoke(Exchange cxfExchange, Object o) {
                 LOG.trace("Received CXF Request: {}", cxfExchange);                
                 Continuation continuation;
-                if (!endpoint.isSynchronous() && (continuation = getContinuation(cxfExchange)) != null) {
+                if (!endpoint.isSynchronous() && isAsyncInvocationSupported(cxfExchange)
+                    && (continuation = getContinuation(cxfExchange)) != null) {
                     LOG.trace("Calling the Camel async processors.");
                     return asyncInvoke(cxfExchange, continuation);
                 } else {
@@ -241,6 +244,23 @@ public class CxfConsumer extends Default
         super.doStop();
     }
     
+    protected boolean isAsyncInvocationSupported(Exchange cxfExchange) {
+        Message cxfMessage = cxfExchange.getInMessage();
+        AddressingProperties addressingProperties = (AddressingProperties) cxfMessage.get(CxfConstants.WSA_HEADERS_INBOUND);
+        if (addressingProperties != null 
+               && !ContextUtils.isGenericAddress(addressingProperties.getReplyTo())) {
+            //it's decoupled endpoint, so already switch thread and
+            //use executors, which means underlying transport won't 
+            //be block, so we shouldn't rely on continuation in 
+            //this case, as the SuspendedInvocationException can't be 
+            //caught by underlying transport. So we should use the SyncInvocation this time
+            return false;
+        }
+        // we assume it should support AsyncInvocation out of box
+        return true;
+        
+    }
+    
     public Server getServer() {
         return server;
     }

Added: camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/wsrm/HelloWorld.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/wsrm/HelloWorld.java?rev=1387019&view=auto
==============================================================================
--- camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/wsrm/HelloWorld.java (added)
+++ camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/wsrm/HelloWorld.java Tue Sep 18 07:30:47 2012
@@ -0,0 +1,25 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.cxf.wsrm;
+
+import javax.jws.WebService;
+
+@WebService(targetNamespace = "http://camel.apache.org/cxf/wsrm")
+public interface HelloWorld {
+    String sayHi(String text);
+}
+

Added: camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/wsrm/HelloWorldImpl.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/wsrm/HelloWorldImpl.java?rev=1387019&view=auto
==============================================================================
--- camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/wsrm/HelloWorldImpl.java (added)
+++ camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/wsrm/HelloWorldImpl.java Tue Sep 18 07:30:47 2012
@@ -0,0 +1,33 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.cxf.wsrm;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class HelloWorldImpl implements HelloWorld {
+    private static Logger logger = LoggerFactory.getLogger(HelloWorldImpl.class);
+
+    public String sayHi(String text) {
+        logger.info("***** Entering Implementation Code ******");
+        
+        logger.info("***** Leaving Implementation Code ******");
+        return "Hello " + text;
+
+    }
+}
+

Added: camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/wsrm/MessageLossSimulator.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/wsrm/MessageLossSimulator.java?rev=1387019&view=auto
==============================================================================
--- camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/wsrm/MessageLossSimulator.java (added)
+++ camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/wsrm/MessageLossSimulator.java Tue Sep 18 07:30:47 2012
@@ -0,0 +1,129 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.cxf.wsrm;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.math.BigInteger;
+import java.util.ListIterator;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.apache.cxf.interceptor.Fault;
+import org.apache.cxf.interceptor.InterceptorChain;
+import org.apache.cxf.interceptor.MessageSenderInterceptor;
+import org.apache.cxf.io.AbstractWrappedOutputStream;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.phase.AbstractPhaseInterceptor;
+import org.apache.cxf.phase.Phase;
+import org.apache.cxf.phase.PhaseInterceptor;
+import org.apache.cxf.ws.addressing.AddressingProperties;
+import org.apache.cxf.ws.rm.RMContextUtils;
+
+/**
+ * 
+ */
+public class MessageLossSimulator extends AbstractPhaseInterceptor<Message> {
+
+    private static final Logger LOG = Logger.getLogger(MessageLossSimulator.class.getName());
+    private int appMessageCount; 
+    
+    public MessageLossSimulator() {
+        super(Phase.PREPARE_SEND);
+        addBefore(MessageSenderInterceptor.class.getName());
+    }
+
+    
+    public void handleMessage(Message message) throws Fault {
+        AddressingProperties maps =
+            RMContextUtils.retrieveMAPs(message, false, true);
+        // RMContextUtils.ensureExposedVersion(maps);
+        String action = null;
+        if (maps != null && null != maps.getAction()) {
+            action = maps.getAction().getValue();
+        }
+        if (RMContextUtils.isRMProtocolMessage(action)) { 
+            return;
+        }
+        appMessageCount++;
+        // do not discard odd-numbered messages
+        if (0 != (appMessageCount % 2)) {
+            return;
+        }
+        
+        // discard even-numbered message
+        InterceptorChain chain = message.getInterceptorChain();
+        ListIterator it = chain.getIterator();
+        while (it.hasNext()) {
+            PhaseInterceptor pi = (PhaseInterceptor)it.next();
+            if (MessageSenderInterceptor.class.getName().equals(pi.getId())) {
+                chain.remove(pi);
+                LOG.fine("Removed MessageSenderInterceptor from interceptor chain.");
+                break;
+            }
+        }
+        
+        message.setContent(OutputStream.class, new WrappedOutputStream(message));  
+
+        message.getInterceptorChain().add(new AbstractPhaseInterceptor<Message>(Phase.PREPARE_SEND_ENDING) {
+
+            public void handleMessage(Message message) throws Fault {
+                try {
+                    message.getContent(OutputStream.class).close();
+                } catch (IOException e) {
+                    throw new Fault(e);
+                }
+            }
+            
+        });   
+    }
+    
+    private class WrappedOutputStream extends AbstractWrappedOutputStream {
+
+        private Message outMessage;
+
+        public WrappedOutputStream(Message m) {
+            this.outMessage = m;
+        }
+
+        @Override
+        protected void onFirstWrite() throws IOException {
+            if (LOG.isLoggable(Level.FINE)) {
+                Long nr = RMContextUtils.retrieveRMProperties(outMessage, true)
+                    .getSequence().getMessageNumber();
+                LOG.fine("Losing message " + nr);
+            }
+            wrappedStream = new DummyOutputStream();
+        }
+    }    
+
+            
+    
+    private class DummyOutputStream extends OutputStream {
+
+        @Override
+        public void write(int b) throws IOException {
+            // TODO Auto-generated method stub
+            
+        }
+        
+    }
+    
+    
+    
+}

Added: camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/wsrm/MyProcessor.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/wsrm/MyProcessor.java?rev=1387019&view=auto
==============================================================================
--- camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/wsrm/MyProcessor.java (added)
+++ camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/wsrm/MyProcessor.java Tue Sep 18 07:30:47 2012
@@ -0,0 +1,37 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.cxf.wsrm;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ *
+ */
+public class MyProcessor implements Processor {
+    private static Logger logger = LoggerFactory.getLogger(MyProcessor.class);
+    
+    public void process(Exchange exchange) throws Exception {
+        logger.info("***** Entering Processor *******");
+        String name = exchange.getIn().getBody(String.class);
+        exchange.getOut().setBody("Hello " + name);
+        logger.info("***** Leaving Processor *******");
+    }
+
+}

Added: camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/wsrm/WSRMTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/wsrm/WSRMTest.java?rev=1387019&view=auto
==============================================================================
--- camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/wsrm/WSRMTest.java (added)
+++ camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/wsrm/WSRMTest.java Tue Sep 18 07:30:47 2012
@@ -0,0 +1,79 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.cxf.wsrm;
+
+import java.net.URL;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.component.cxf.CXFTestSupport;
+import org.apache.cxf.bus.spring.SpringBusFactory;
+import org.apache.cxf.common.classloader.ClassLoaderUtils;
+import org.apache.cxf.frontend.ClientFactoryBean;
+import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
+import org.junit.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
+
+import static org.junit.Assert.assertEquals;
+/**
+ *
+ * @version 
+ */
+@ContextConfiguration
+public class WSRMTest extends AbstractJUnit4SpringContextTests {
+    
+    protected static int port1 = CXFTestSupport.getPort2(); 
+    protected static int port2 = CXFTestSupport.getPort3();
+    
+    @Autowired
+    protected CamelContext context;
+    
+    protected String getClientAddress() {
+        return "http://localhost:" + port1 + "/wsrm/HelloWorld";
+    }
+
+    @Test
+    public void testWSAddressing() throws Exception {
+        JaxWsProxyFactoryBean proxyFactory = new  JaxWsProxyFactoryBean();
+        ClientFactoryBean clientBean = proxyFactory.getClientFactoryBean();
+        clientBean.setAddress(getClientAddress());
+        clientBean.setServiceClass(HelloWorld.class);
+        clientBean.setWsdlURL(WSRMTest.class.getResource("/HelloWorld.wsdl").toString());
+        SpringBusFactory bf = new SpringBusFactory();
+        URL cxfConfig = null;
+
+        if (getCxfClientConfig() != null) {
+            cxfConfig = ClassLoaderUtils.getResource(getCxfClientConfig(), this.getClass());
+            System.out.println("cxfConfig" + cxfConfig);
+        }
+        proxyFactory.setBus(bf.createBus(cxfConfig));
+        proxyFactory.getOutInterceptors().add(new MessageLossSimulator());
+        HelloWorld client = (HelloWorld) proxyFactory.create();
+        String result = client.sayHi("world!");
+        assertEquals("Get a wrong response", "Hello world!", result);
+    }
+   
+    /**
+     * @return
+     */
+    protected String getCxfClientConfig() {
+        return "ws_rm.xml";
+    }
+    
+
+}

Added: camel/trunk/components/camel-cxf/src/test/resources/HelloWorld.wsdl
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/resources/HelloWorld.wsdl?rev=1387019&view=auto
==============================================================================
--- camel/trunk/components/camel-cxf/src/test/resources/HelloWorld.wsdl (added)
+++ camel/trunk/components/camel-cxf/src/test/resources/HelloWorld.wsdl Tue Sep 18 07:30:47 2012
@@ -0,0 +1,71 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+-->
+<wsdl:definitions name="HelloWorldImplService" targetNamespace="http://camel.apache.org/cxf/wsrm" xmlns:ns1="http://schemas.xmlsoap.org/soap/http" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://camel.apache.org/cxf/wsrm" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+  <wsdl:types>
+    <xs:schema attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://camel.apache.org/cxf/wsrm" xmlns="http://camel.apache.org/cxf/wsrm" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+      <xs:complexType name="sayHi">
+        <xs:sequence>
+          <xs:element minOccurs="0" name="arg0" type="xs:string"/>
+        </xs:sequence>
+      </xs:complexType>
+      <xs:complexType name="sayHiResponse">
+        <xs:sequence>
+          <xs:element minOccurs="0" name="return" type="xs:string"/>
+        </xs:sequence>
+      </xs:complexType>
+      <xs:element name="sayHi" nillable="true" type="sayHi"/>
+      <xs:element name="sayHiResponse" nillable="true" type="sayHiResponse"/>
+    </xs:schema>
+  </wsdl:types>
+  <wsdl:message name="sayHi">
+    <wsdl:part element="tns:sayHi" name="parameters">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="sayHiResponse">
+    <wsdl:part element="tns:sayHiResponse" name="parameters">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:portType name="HelloWorld">
+    <wsdl:operation name="sayHi">
+      <wsdl:input message="tns:sayHi" name="sayHi">
+      </wsdl:input>
+      <wsdl:output message="tns:sayHiResponse" name="sayHiResponse">
+      </wsdl:output>
+    </wsdl:operation>
+  </wsdl:portType>
+  <wsdl:binding name="HelloWorldServiceSoapBinding" type="tns:HelloWorld">
+    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+    <wsdl:operation name="sayHi">
+      <soap:operation soapAction="" style="document"/>
+      <wsdl:input name="sayHi">
+        <soap:body use="literal"/>
+      </wsdl:input>
+      <wsdl:output name="sayHiResponse">
+        <soap:body use="literal"/>
+      </wsdl:output>
+    </wsdl:operation>
+  </wsdl:binding>
+  <wsdl:service name="HelloWorldService">
+    <wsdl:port binding="tns:HelloWorldServiceSoapBinding" name="HelloWorldPort">
+      <soap:address location="http://localhost:9191/HelloWorld"/>
+      <wswa:UsingAddressing xmlns:wswa="http://www.w3.org/2005/02/addressing/wsdl"/>
+    </wsdl:port>
+  </wsdl:service>
+</wsdl:definitions>

Added: camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/wsrm/WSRMTest-context.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/wsrm/WSRMTest-context.xml?rev=1387019&view=auto
==============================================================================
--- camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/wsrm/WSRMTest-context.xml (added)
+++ camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/wsrm/WSRMTest-context.xml Tue Sep 18 07:30:47 2012
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements. See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership. The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License. You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied. See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+<!-- START SNIPPET: beans -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xmlns:jaxws="http://cxf.apache.org/jaxws"
+        xmlns:cxf="http://cxf.apache.org/core"
+        xmlns:camelcxf="http://camel.apache.org/schema/cxf"
+        xmlns:camel="http://camel.apache.org/schema/spring"
+        xmlns:wsa="http://cxf.apache.org/ws/addressing"
+        xmlns:http="http://cxf.apache.org/transports/http/configuration"
+        xmlns:wsrm-policy="http://schemas.xmlsoap.org/ws/2005/02/rm/policy"
+        xmlns:wsrm-mgr="http://cxf.apache.org/ws/rm/manager"
+        xsi:schemaLocation="
+          http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
+          http://camel.apache.org/schema/cxf http://camel.apache.org/schema/cxf/camel-cxf.xsd
+          http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
+          http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+          http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd
+          http://schemas.xmlsoap.org/ws/2005/02/rm/policy http://schemas.xmlsoap.org/ws/2005/02/rm/wsrm-policy.xsd
+          http://cxf.apache.org/ws/rm/manager http://cxf.apache.org/schemas/configuration/wsrm-manager.xsd
+          http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
+          
+    <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
+    
+
+    <import resource="classpath:META-INF/cxf/cxf.xml" />
+	 
+    <camel:camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
+    	<camel:route>
+      		<camel:from uri="cxf:bean:helloWorld" />
+		        <camel:process ref="myProcessor" />
+	    </camel:route>
+    </camel:camelContext>                    
+    
+    <camelcxf:cxfEndpoint id="helloWorld" address="http://localhost:${CXFTestSupport.port2}/wsrm/HelloWorld" 
+        wsdlURL="classpath:HelloWorld.wsdl"   	
+	    serviceClass="org.apache.camel.component.cxf.wsrm.HelloWorldImpl"
+	    serviceName="s:HelloWorldService"
+	    endpointName="s:HelloWorldPort"
+	    xmlns:s="http://camel.apache.org/cxf/wsrm" >
+	    <camelcxf:inInterceptors>
+		    <ref bean="logInbound" />
+		</camelcxf:inInterceptors>
+		<camelcxf:outInterceptors>
+		    <ref bean="loggingOutInterceptor" />
+		</camelcxf:outInterceptors>
+		<camelcxf:features>
+			<wsa:addressing/>
+	        <wsrm-mgr:reliableMessaging>
+	            <wsrm-policy:RMAssertion>
+	                <wsrm-policy:BaseRetransmissionInterval Milliseconds="4000"/>           
+	                <wsrm-policy:AcknowledgementInterval Milliseconds="2000"/>          
+	            </wsrm-policy:RMAssertion>
+	            <wsrm-mgr:destinationPolicy>
+	                <wsrm-mgr:acksPolicy intraMessageThreshold="0" />
+	            </wsrm-mgr:destinationPolicy>
+	        </wsrm-mgr:reliableMessaging>
+	    </camelcxf:features>
+	</camelcxf:cxfEndpoint>
+                        
+	<bean id="myProcessor" class="org.apache.camel.component.cxf.wsrm.MyProcessor"/> 
+	
+	<bean id="loggingOutInterceptor" class="org.apache.cxf.interceptor.LoggingOutInterceptor" />
+	<bean id="logInbound" class="org.apache.cxf.interceptor.LoggingInInterceptor" />  
+       
+    <http:conduit name="{http://camel.apache.org/cxf/wsrm}HelloWorldPort.http-conduit">
+        <http:client AllowChunking="false" DecoupledEndpoint="http://localhost:${CXFTestSupport.port3}/wsrm/decoupled_endpoint"/>
+    </http:conduit>
+</beans>
+<!-- END SNIPPET: beans -->

Added: camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/wsrm/ws_rm.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/wsrm/ws_rm.xml?rev=1387019&view=auto
==============================================================================
--- camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/wsrm/ws_rm.xml (added)
+++ camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/wsrm/ws_rm.xml Tue Sep 18 07:30:47 2012
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+ 
+  http://www.apache.org/licenses/LICENSE-2.0
+ 
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:cxf="http://cxf.apache.org/core"
+       xmlns:wsa="http://cxf.apache.org/ws/addressing"
+       xmlns:http="http://cxf.apache.org/transports/http/configuration"
+       xmlns:wsrm-policy="http://schemas.xmlsoap.org/ws/2005/02/rm/policy"
+       xmlns:wsrm-mgr="http://cxf.apache.org/ws/rm/manager"
+       xsi:schemaLocation="
+       http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
+       http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd
+       http://schemas.xmlsoap.org/ws/2005/02/rm/policy http://schemas.xmlsoap.org/ws/2005/02/rm/wsrm-policy.xsd
+       http://cxf.apache.org/ws/rm/manager http://cxf.apache.org/schemas/configuration/wsrm-manager.xsd
+       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+       
+    <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
+ 
+    <cxf:bus>
+        <cxf:features>
+            <cxf:logging/>
+            <wsa:addressing/>
+            <wsrm-mgr:reliableMessaging>
+                <wsrm-policy:RMAssertion>
+                    <wsrm-policy:BaseRetransmissionInterval Milliseconds="4000"/>           
+                    <wsrm-policy:AcknowledgementInterval Milliseconds="2000"/>          
+                </wsrm-policy:RMAssertion>
+                <wsrm-mgr:destinationPolicy>
+                    <wsrm-mgr:acksPolicy intraMessageThreshold="0" />
+                </wsrm-mgr:destinationPolicy>
+            </wsrm-mgr:reliableMessaging>
+        </cxf:features>
+    </cxf:bus>
+    
+    <http:conduit name="{http://camel.apache.org/cxf/wsrm}HelloWorldPort.http-conduit">
+      <http:client AllowChunking="false" DecoupledEndpoint="http://localhost:${CXFTestSupport.port3}/wsrm/decoupled_endpoint"/>
+    </http:conduit>
+</beans>
+