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 2008/02/13 10:14:35 UTC

svn commit: r627319 - in /activemq/camel/trunk/components/camel-cxf/src: main/java/org/apache/camel/component/cxf/ main/java/org/apache/camel/component/cxf/util/ test/java/org/apache/camel/component/cxf/ test/resources/org/apache/camel/component/cxf/

Author: ningjiang
Date: Wed Feb 13 01:14:25 2008
New Revision: 627319

URL: http://svn.apache.org/viewvc?rev=627319&view=rev
Log:
CAMEL-332 added the WebServiceProvider support for the cxf endpoint, also added a unit test for it

Added:
    activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfSoapMessageProviderTest.java   (with props)
    activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/ParameterProcessor.java   (with props)
    activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/SoapMessageProvider.java   (with props)
    activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/SoapTargetBean.java   (with props)
    activemq/camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/GreetMeDocLiteralResp.xml   (with props)
    activemq/camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/SoapMessageProviderContext.xml   (with props)
    activemq/camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/sayHiDocLiteralResp.xml   (with props)
Modified:
    activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CamelInvoker.java
    activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfConsumer.java
    activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/DataFormat.java
    activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/util/CxfEndpointUtils.java

Modified: activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CamelInvoker.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CamelInvoker.java?rev=627319&r1=627318&r2=627319&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CamelInvoker.java (original)
+++ activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CamelInvoker.java Wed Feb 13 01:14:25 2008
@@ -46,9 +46,11 @@
 public class CamelInvoker implements Invoker  {
     private static final Logger LOG = Logger.getLogger(CamelInvoker.class.getName());
     private CxfConsumer cxfConsumer;
+
     public CamelInvoker(CxfConsumer consumer) {
         cxfConsumer = consumer;
     }
+
     /**
     * This method is called when the incoming message is to
     * be passed into the camel processor. The return value is the response
@@ -84,6 +86,7 @@
         return outMessage;
     }
 
+
     public Message getCxfMessage(CxfExchange result, Exchange exchange) {
         Message outMessage = null;
         if (result.isFailed()) {
@@ -131,36 +134,41 @@
     }
 
     /**
-     * This method is called when the incoming pojo invocation is called
+     * This method is called when the incoming pojo or WebServiceProvider invocation is called
      * from the service invocation interceptor. The return value is the response
      * from the processor
      * @param inMessage
      * @return outMessage
      */
     public Object invoke(Exchange exchange, Object o) {
-        BindingOperationInfo bop = exchange.get(BindingOperationInfo.class);
-        MethodDispatcher md = (MethodDispatcher)
-            exchange.get(Service.class).get(MethodDispatcher.class.getName());
-        Method m = md.getMethod(bop);
-        List<Object> params = new ArrayList<Object>();
+
+        CxfEndpoint endpoint = (CxfEndpoint) cxfConsumer.getEndpoint();
+
+        Object params = null;
+
+
         if (o instanceof List) {
             params = CastUtils.cast((List<?>)o);
         } else if (o != null) {
             params = new MessageContentsList(o);
         }
 
-        CxfEndpoint endpoint = (CxfEndpoint) cxfConsumer.getEndpoint();
 
         CxfExchange cxfExchange = endpoint.createExchange(exchange.getInMessage());
+
+        BindingOperationInfo bop = exchange.get(BindingOperationInfo.class);
+        MethodDispatcher md = (MethodDispatcher)
+            exchange.get(Service.class).get(MethodDispatcher.class.getName());
+        Method m = md.getMethod(bop);
+
+
         if (bop.getOperationInfo().isOneWay()) {
-        	cxfExchange.setPattern(ExchangePattern.InOnly);
+            cxfExchange.setPattern(ExchangePattern.InOnly);
         } else {
-        	cxfExchange.setPattern(ExchangePattern.InOut);
+            cxfExchange.setPattern(ExchangePattern.InOut);
         }
         cxfExchange.getIn().setHeader(CxfConstants.OPERATION_NAME, m.getName());
         cxfExchange.getIn().setBody(params);
-
-
         try {
             cxfConsumer.getProcessor().process(cxfExchange);
         } catch (Exception ex) {
@@ -168,19 +176,15 @@
             throw new Fault(ex);
         }
 
-        Object result;
+        Object result = null;
         if (cxfExchange.isFailed()) {
             Exception ex= (Exception)cxfExchange.getFault().getBody();
             throw new Fault(ex);
         } else {
             result = cxfExchange.getOut().getBody();
-            if(result instanceof Object[]) {
-                return (Object[])result;
-            }
         }
 
         return result;
-
     }
 
 }

Modified: activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfConsumer.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfConsumer.java?rev=627319&r1=627318&r2=627319&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfConsumer.java (original)
+++ activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfConsumer.java Wed Feb 13 01:14:25 2008
@@ -18,6 +18,8 @@
 
 import java.net.URI;
 
+import javax.xml.ws.WebServiceProvider;
+
 import org.apache.camel.Processor;
 import org.apache.camel.component.cxf.spring.CxfEndpointBean;
 import org.apache.camel.component.cxf.util.CxfEndpointUtils;
@@ -37,64 +39,66 @@
 
 /**
  * A consumer of exchanges for a service in CXF
- * 
+ *
  * @version $Revision$
  */
 public class CxfConsumer extends DefaultConsumer<CxfExchange> {
-    private CxfEndpoint endpoint;    
+    private CxfEndpoint endpoint;
     private Server server;
-    
 
     public CxfConsumer(CxfEndpoint endpoint, Processor processor) throws Exception {
-       
-        super(endpoint, processor);        
-        this.endpoint = endpoint;        
-        
+
+        super(endpoint, processor);
+        this.endpoint = endpoint;
+        boolean isWebServiceProvider = false;
         try {
-            // now we just use the default bus here   
+            // now we just use the default bus here
             Bus bus = BusFactory.getDefaultBus();
             ServerFactoryBean svrBean = null;
+
             if (endpoint.isSpringContextEndpoint()) {
                 CxfEndpointBean endpointBean = endpoint.getCxfEndpointBean();
                 svrBean = CxfEndpointUtils.getServerFactoryBean(endpointBean.getServiceClass());
-                endpoint.configure(svrBean);               
+                isWebServiceProvider = CxfEndpointUtils.hasAnnotation(endpointBean.getServiceClass(), WebServiceProvider.class);
+                endpoint.configure(svrBean);
                 CxfEndpointBean cxfEndpointBean = endpoint.getCxfEndpointBean();
                 if (cxfEndpointBean.getServiceName() != null) {
                     svrBean.setServiceName(cxfEndpointBean.getServiceName());
-                } 
+                }
                 if (cxfEndpointBean.getEndpointName() != null) {
                     svrBean.setEndpointName(cxfEndpointBean.getEndpointName());
-                } 
-                
-            } else { // setup the serverFactoryBean with the URI paraments           
-                Class serviceClass = ClassLoaderUtils.loadClass(endpoint.getServiceClass(), this.getClass()); 
-                svrBean = CxfEndpointUtils.getServerFactoryBean(serviceClass);                           
+                }
+
+            } else { // setup the serverFactoryBean with the URI paraments
+                Class serviceClass = ClassLoaderUtils.loadClass(endpoint.getServiceClass(), this.getClass());
+                svrBean = CxfEndpointUtils.getServerFactoryBean(serviceClass);
+                isWebServiceProvider = CxfEndpointUtils.hasAnnotation(serviceClass, WebServiceProvider.class);
                 svrBean.setAddress(endpoint.getAddress());
                 svrBean.setServiceClass(serviceClass);
                 if (endpoint.getServiceName() != null) {
-                    svrBean.setServiceName(CxfEndpointUtils.getServiceName(endpoint));                
+                    svrBean.setServiceName(CxfEndpointUtils.getServiceName(endpoint));
                 }
                 if (endpoint.getPortName() != null) {
                     svrBean.setEndpointName(CxfEndpointUtils.getPortName(endpoint));
-                }    
-                if (endpoint.getWsdlURL() != null) {                
+                }
+                if (endpoint.getWsdlURL() != null) {
                     svrBean.setWsdlURL(endpoint.getWsdlURL());
                 }
             }
             DataFormat dataFormat = CxfEndpointUtils.getDataFormat(endpoint);
-            if (dataFormat.equals(DataFormat.POJO)) {
-                svrBean.setInvoker(new CamelInvoker(this));
+            if (dataFormat.equals(DataFormat.POJO) || isWebServiceProvider) {
+            	svrBean.setInvoker(new CamelInvoker(this));
             }
             svrBean.setBus(bus);
             svrBean.setStart(false);
-            server = svrBean.create();            
-            if (!dataFormat.equals(DataFormat.POJO)) {
+            server = svrBean.create();
+            if(!dataFormat.equals(DataFormat.POJO) && !isWebServiceProvider) {
                 CxfMessageObserver observer = new CxfMessageObserver(this, server.getEndpoint(), bus , dataFormat);
-                //set the message observer for the Message and PayLoad mode message 
+                //set the message observer for the Message and PayLoad mode message
                 ServerImpl serverImpl = (ServerImpl)server;
                 serverImpl.setMessageObserver(observer);
-            } 
-            
+            }
+
         } catch (Exception ex) {
             // create Consumer endpoint failed
             ex.printStackTrace();
@@ -103,8 +107,8 @@
 
     @Override
     protected void doStart() throws Exception {
-        super.doStart();        
-        
+        super.doStart();
+
         server.start();
     }
 
@@ -113,10 +117,10 @@
         server.stop();
         super.doStop();
     }
-    
+
     public CxfEndpoint getEndpoint() {
         return endpoint;
     }
 
-    
+
 }

Modified: activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/DataFormat.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/DataFormat.java?rev=627319&r1=627318&r2=627319&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/DataFormat.java (original)
+++ activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/DataFormat.java Wed Feb 13 01:14:25 2008
@@ -41,5 +41,20 @@
      * must be included in the endpoint.  Streaming is not available for this
      * data format.
      */
-    POJO
+    POJO,
+    
+    /**
+     * For UNKNOWN cases.
+     */
+    UNKNOWN;
+    
+    
+        
+    public static DataFormat asEnum(String value) {
+    	try {
+    		return valueOf(value.toUpperCase());
+    	} catch (Exception e) {
+    		return UNKNOWN;
+    	}
+    }
 }

Modified: activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/util/CxfEndpointUtils.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/util/CxfEndpointUtils.java?rev=627319&r1=627318&r2=627319&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/util/CxfEndpointUtils.java (original)
+++ activemq/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/util/CxfEndpointUtils.java Wed Feb 13 01:14:25 2008
@@ -16,12 +16,14 @@
  */
 package org.apache.camel.component.cxf.util;
 
+import java.lang.annotation.Annotation;
 import java.net.URI;
 import java.net.URL;
 import java.util.logging.Logger;
 
 import javax.jws.WebService;
 import javax.xml.namespace.QName;
+import javax.xml.ws.WebServiceProvider;
 
 import org.apache.camel.CamelException;
 import org.apache.camel.component.cxf.CxfEndpoint;
@@ -105,21 +107,27 @@
     }
 
     public static boolean hasWebServiceAnnotation(Class<?> cls) {
-        if (cls == null) {
+        return (hasAnnotation(cls, WebService.class) || hasAnnotation(cls, WebServiceProvider.class));
+    }
+
+    public static boolean hasAnnotation(Class<?> cls, Class<? extends Annotation> annotation) {
+        if (cls == null || cls == Object.class) {
             return false;
         }
-        if (null != cls.getAnnotation(WebService.class)) {
+        
+        if (null != cls.getAnnotation(annotation)) {
             return true;
         }
-        for (Class<?> inf : cls.getInterfaces()) {
-            if (null != inf.getAnnotation(WebService.class)) {
-                return true;
+        
+        for (Class<?> interfaceClass : cls.getInterfaces()) {
+            if (null != interfaceClass.getAnnotation(annotation)) {
+            	return true;
             }
         }
-
-        return hasWebServiceAnnotation(cls.getSuperclass());
+        return hasAnnotation(cls.getSuperclass(), annotation);
     }
     
+    
     public static ServerFactoryBean getServerFactoryBean(Class<?> cls) throws CamelException {
         ServerFactoryBean serverFactory  = null;
         try { 
@@ -213,17 +221,18 @@
         
     public static DataFormat getDataFormat(CxfEndpoint endpoint) throws CamelException {
         String dataFormatString = endpoint.getDataFormat();
-        DataFormat retval = DataFormat.POJO; 
+        if (dataFormatString == null) {
+        	return DataFormat.POJO;
+        }
+                
+        DataFormat retval = DataFormat.asEnum(dataFormatString); 
         
-        if (dataFormatString != null) {
-            try {
-                retval = DataFormat.valueOf(dataFormatString.toUpperCase());
-            } catch (IllegalArgumentException iae) {
-                throw new CamelException(new Message("INVALID_MESSAGE_FORMAT_XXXX", LOG, dataFormatString).toString()
-                                         , iae);
-            }
+        if (retval == DataFormat.UNKNOWN) {
+        	throw new CamelException(new Message("INVALID_MESSAGE_FORMAT_XXXX", LOG, dataFormatString).toString());
         }
+        
         return retval;
     }
 }
+
 

Added: activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfSoapMessageProviderTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfSoapMessageProviderTest.java?rev=627319&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfSoapMessageProviderTest.java (added)
+++ activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfSoapMessageProviderTest.java Wed Feb 13 01:14:25 2008
@@ -0,0 +1,72 @@
+/**
+ * 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;
+
+import java.lang.reflect.UndeclaredThrowableException;
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.spring.processor.SpringTestHelper;
+
+import org.apache.hello_world_soap_http.Greeter;
+import org.apache.hello_world_soap_http.SOAPService;
+
+
+public class CxfSoapMessageProviderTest extends ContextTestSupport {
+
+    @Override
+    protected CamelContext createCamelContext() throws Exception {
+        return SpringTestHelper.createSpringCamelContext(this, "org/apache/camel/component/cxf/SoapMessageProviderContext.xml");
+    }
+
+    public void testSOAPMessageModeDocLit() throws Exception {
+
+        QName serviceName =
+            new QName("http://apache.org/hello_world_soap_http", "SOAPProviderService");
+        QName portName =
+            new QName("http://apache.org/hello_world_soap_http", "SoapProviderPort");
+
+        URL wsdl = getClass().getResource("/wsdl/hello_world.wsdl");
+        assertNotNull(wsdl);
+
+        SOAPService service = new SOAPService(wsdl, serviceName);
+        assertNotNull(service);
+
+        String response1 = new String("TestSOAPOutputPMessage");
+        String response2 = new String("Bonjour");
+        try {
+            Greeter greeter = service.getPort(portName, Greeter.class);
+            for (int idx = 0; idx < 2; idx++) {
+                String greeting = greeter.greetMe("Milestone-" + idx);
+                assertNotNull("no response received from service", greeting);
+                assertEquals(response1, greeting);
+
+                String reply = greeter.sayHi();
+                assertNotNull("no response received from service", reply);
+                assertEquals(response2, reply);
+            }
+        } catch (UndeclaredThrowableException ex) {
+            throw (Exception)ex.getCause();
+        }
+    }
+
+
+
+}

Propchange: activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfSoapMessageProviderTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfSoapMessageProviderTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/ParameterProcessor.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/ParameterProcessor.java?rev=627319&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/ParameterProcessor.java (added)
+++ activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/ParameterProcessor.java Wed Feb 13 01:14:25 2008
@@ -0,0 +1,17 @@
+package org.apache.camel.component.cxf;
+
+import java.util.List;
+
+import javax.xml.soap.SOAPMessage;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+
+public class ParameterProcessor implements Processor {
+
+    public void process(Exchange exchange) throws Exception {
+        SOAPMessage soapMessage = (SOAPMessage)exchange.getIn().getBody(List.class).get(0);
+        exchange.getIn().setBody(soapMessage);
+    }
+
+}

Propchange: activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/ParameterProcessor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/ParameterProcessor.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/SoapMessageProvider.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/SoapMessageProvider.java?rev=627319&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/SoapMessageProvider.java (added)
+++ activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/SoapMessageProvider.java Wed Feb 13 01:14:25 2008
@@ -0,0 +1,21 @@
+package org.apache.camel.component.cxf;
+
+import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.Provider;
+import javax.xml.ws.Service;
+import javax.xml.ws.ServiceMode;
+import javax.xml.ws.WebServiceProvider;
+
+@WebServiceProvider(portName = "SoapProviderPort", serviceName = "SOAPProviderService",
+                    targetNamespace = "http://apache.org/hello_world_soap_http",
+ wsdlLocation = "/wsdl/hello_world.wsdl")
+
+@ServiceMode(value = Service.Mode.MESSAGE)
+public class SoapMessageProvider implements Provider<SOAPMessage> {
+
+    public SOAPMessage invoke(SOAPMessage request) {
+        //request should not come here as camel route would intercept the call before this is invoked.
+        throw new UnsupportedOperationException("Placeholder method");
+    }
+
+}

Propchange: activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/SoapMessageProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/SoapMessageProvider.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/SoapTargetBean.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/SoapTargetBean.java?rev=627319&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/SoapTargetBean.java (added)
+++ activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/SoapTargetBean.java Wed Feb 13 01:14:25 2008
@@ -0,0 +1,54 @@
+package org.apache.camel.component.cxf;
+
+import java.io.InputStream;
+
+import javax.xml.namespace.QName;
+import javax.xml.soap.MessageFactory;
+
+import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPMessage;
+
+import org.w3c.dom.Node;
+
+public class SoapTargetBean {
+    private static QName sayHi = new QName("http://apache.org/hello_world_soap_http", "sayHi");
+    private static QName greetMe = new QName("http://apache.org/hello_world_soap_http", "greetMe");
+    private SOAPMessage sayHiResponse;
+    private SOAPMessage greetMeResponse;
+
+    public SoapTargetBean() {
+
+        try {
+            MessageFactory factory = MessageFactory.newInstance();
+            InputStream is = getClass().getResourceAsStream("sayHiDocLiteralResp.xml");
+            sayHiResponse =  factory.createMessage(null, is);
+            is.close();
+            is = getClass().getResourceAsStream("GreetMeDocLiteralResp.xml");
+            greetMeResponse =  factory.createMessage(null, is);
+            is.close();
+        } catch (Exception ex) {
+            ex.printStackTrace();
+        }
+    }
+
+    public SOAPMessage invoke(SOAPMessage request) {
+        SOAPMessage response = null;
+        try {
+            SOAPBody body = request.getSOAPBody();
+            Node n = body.getFirstChild();
+
+            while (n.getNodeType() != Node.ELEMENT_NODE) {
+                n = n.getNextSibling();
+            }
+            if (n.getLocalName().equals(sayHi.getLocalPart())) {
+                response = sayHiResponse;
+            } else if (n.getLocalName().equals(greetMe.getLocalPart())) {
+                response = greetMeResponse;
+            }
+        } catch (Exception ex) {
+            ex.printStackTrace();
+        }
+        return response;
+    }
+
+}

Propchange: activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/SoapTargetBean.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/SoapTargetBean.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: activemq/camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/GreetMeDocLiteralResp.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/GreetMeDocLiteralResp.xml?rev=627319&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/GreetMeDocLiteralResp.xml (added)
+++ activemq/camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/GreetMeDocLiteralResp.xml Wed Feb 13 01:14:25 2008
@@ -0,0 +1,20 @@
+<?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.
+-->
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><SOAP-ENV:Body><ns4:greetMeResponse xmlns:ns4="http://apache.org/hello_world_soap_http/types"><ns4:responseType>TestSOAPOutputPMessage</ns4:responseType></ns4:greetMeResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>

Propchange: activemq/camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/GreetMeDocLiteralResp.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/GreetMeDocLiteralResp.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: activemq/camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/GreetMeDocLiteralResp.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: activemq/camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/SoapMessageProviderContext.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/SoapMessageProviderContext.xml?rev=627319&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/SoapMessageProviderContext.xml (added)
+++ activemq/camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/SoapMessageProviderContext.xml Wed Feb 13 01:14:25 2008
@@ -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://activemq.apache.org/camel/schema/cxfEndpoint"
+       xsi:schemaLocation="
+       http://www.springframework.org/schema/beans
+       http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+       http://activemq.apache.org/camel/schema/cxfEndpoint
+       http://activemq.apache.org/camel/schema/cxf/cxfEndpoint.xsd
+       http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd
+    ">
+
+
+    <!--
+    If you want to run this example in Tomcat container which need to used servlet transoprt,
+    please repalce the cxf-extension-http-jetty.xml with cxf-servlet.xml
+    -->
+
+    <import resource="classpath:META-INF/cxf/cxf.xml"/>
+	<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
+	<import resource="classpath:META-INF/cxf/cxf-extension-http-jetty.xml" />
+
+    <bean id = "targetBean" class="org.apache.camel.component.cxf.SoapTargetBean" />
+    <bean id = "parameterProcessor" class="org.apache.camel.component.cxf.ParameterProcessor"/>
+
+   	<cxf:cxfEndpoint id="soapMessageEndpoint"
+	        serviceClass="org.apache.camel.component.cxf.SoapMessageProvider"
+			address="http://localhost:9003/SoapContext/SoapProviderPort"
+   	/>
+
+
+   <camelContext id="test_context" xmlns="http://activemq.apache.org/camel/schema/spring">
+       <route>
+            <from uri="cxf:bean:soapMessageEndpoint"/>
+            <process ref="parameterProcessor" />
+            <to uri="bean:targetBean?methodName=invoke"/>
+        </route>
+   </camelContext>
+
+</beans>

Propchange: activemq/camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/SoapMessageProviderContext.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/SoapMessageProviderContext.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: activemq/camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/SoapMessageProviderContext.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: activemq/camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/sayHiDocLiteralResp.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/sayHiDocLiteralResp.xml?rev=627319&view=auto
==============================================================================
--- activemq/camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/sayHiDocLiteralResp.xml (added)
+++ activemq/camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/sayHiDocLiteralResp.xml Wed Feb 13 01:14:25 2008
@@ -0,0 +1,20 @@
+<?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.
+-->
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><SOAP-ENV:Body><ns4:sayHiResponse xmlns:ns4="http://apache.org/hello_world_soap_http/types" xmlns:ns5="http://www.w3.org/2005/02/addressing/wsdl"><ns4:responseType>Bonjour</ns4:responseType></ns4:sayHiResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>

Propchange: activemq/camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/sayHiDocLiteralResp.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/sayHiDocLiteralResp.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: activemq/camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/sayHiDocLiteralResp.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml