Author: ningjiang
Date: Tue Nov 17 14:32:09 2009
New Revision: 881304

URL: http://svn.apache.org/viewvc?rev=881304&view=rev
Log:
CAMEL-2162 Get camel-example-cxf to work within Servicemix4

Added:
    
camel/trunk/examples/camel-example-cxf/src/main/java/org/apache/camel/example/cxf/jaxrs/Client.java
   (with props)
    
camel/trunk/examples/camel-example-cxf/src/main/resources/META-INF/spring/CamelCXFProviderRouteConfig.xml
    
camel/trunk/examples/camel-example-cxf/src/main/resources/META-INF/spring/CamelTransportSpringConfig.xml
   (with props)
    
camel/trunk/examples/camel-example-cxf/src/main/resources/META-INF/spring/CxfRouteCamelContext.xml
   (with props)
    
camel/trunk/examples/camel-example-cxf/src/main/resources/META-INF/spring/JAXRSCamelContext.xml
   (with props)
Modified:
    camel/trunk/examples/camel-example-cxf/README.txt
    camel/trunk/examples/camel-example-cxf/pom.xml
    
camel/trunk/examples/camel-example-cxf/src/main/java/org/apache/camel/example/camel/transport/CamelTransportExample.java
    
camel/trunk/examples/camel-example-cxf/src/main/java/org/apache/camel/example/camel/transport/Client.java
    
camel/trunk/examples/camel-example-cxf/src/main/java/org/apache/camel/example/cxf/CamelCxfExample.java
    
camel/trunk/examples/camel-example-cxf/src/main/java/org/apache/camel/example/cxf/Client.java
    
camel/trunk/examples/camel-example-cxf/src/main/java/org/apache/camel/example/cxf/provider/Client.java
    
camel/trunk/examples/camel-example-cxf/src/test/java/org/apache/camel/example/cxf/jaxrs/JAXRSClientServerTest.java

Modified: camel/trunk/examples/camel-example-cxf/README.txt
URL: 
http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-cxf/README.txt?rev=881304&r1=881303&r2=881304&view=diff
==============================================================================
--- camel/trunk/examples/camel-example-cxf/README.txt (original)
+++ camel/trunk/examples/camel-example-cxf/README.txt Tue Nov 17 14:32:09 2009
@@ -19,6 +19,14 @@
 To run the example of showing how to create CXF JAXRS endpoint
   mvn exec:java -PJAXRS
 
+To run the example within ServiceMix 4
+ First, you need to install the camel-cxf, camel-jetty features into 
ServiceMix4
+ Then install this bundle into ServiceMix, and use those java client to call 
the services
+ mvn exec:java -PHttpToJMS.Client
+ mvn exec:java -PCamelTransport.Client
+ mvn exec:java -PWebServiceProvider.Client
+ mvn exec:java -PJAXRS.Client
+ 
 
 To run the example with Ant
   a. You need to have Apache ActiveMQ , Apache CXF, Spring and Jetty 
installed. They can be

Modified: camel/trunk/examples/camel-example-cxf/pom.xml
URL: 
http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-cxf/pom.xml?rev=881304&r1=881303&r2=881304&view=diff
==============================================================================
--- camel/trunk/examples/camel-example-cxf/pom.xml (original)
+++ camel/trunk/examples/camel-example-cxf/pom.xml Tue Nov 17 14:32:09 2009
@@ -36,10 +36,21 @@
    <properties>
      <camel.osgi.export.pkg>
        org.apache.camel.example.cxf.*;${camel.osgi.version},
-       org.apache.camel.example.camel.transport.*;${camel.osgi.version}        
+       org.apache.camel.example.camel.transport.*;${camel.osgi.version}
      </camel.osgi.export.pkg>
-     
<camel.osgi.import.pkg>org.apache.activemq.xbean,org.apache.activemq.broker,org.apache.activemq.pool,*</camel.osgi.import.pkg>
-  </properties>
+     <camel.osgi.import.pkg>
+        META-INF.cxf,
+        
org.apache.activemq.xbean,org.apache.activemq.broker,org.apache.activemq.pool,*</camel.osgi.import.pkg>
+     <camel.osgi.private.pkg>
+        org.apache.camel.example.jms,
+        org.apache.hello_world_soap_http,
+        org.apache.hello_world_soap_http.types
+     </camel.osgi.private.pkg>
+     <!-- to avoid us import bunch of cxf package -->
+     <camel.osgi.dynamic>
+      *
+     </camel.osgi.dynamic>
+   </properties>
 
   <dependencies>
     <dependency>
@@ -145,7 +156,35 @@
                        <!-- Starting the camel-cxf example of JAXRS -->
                        
<target.main.class>org.apache.camel.example.cxf.jaxrs.CamelRouterBuilder</target.main.class>
                </properties>
-       </profile>      
+       </profile>
+       <profile>
+               <id>HttpToJMS.Client</id>
+               <properties>
+                       <!-- Starting the camel-cxf example client of routing 
the SOAP over http message to SOAP over JMS Server -->
+                       
<target.main.class>org.apache.camel.example.cxf.Client</target.main.class>
+               </properties>
+       </profile>
+       <profile>
+               <id>CamelTransport.Client</id>
+               <properties>
+                       <!-- Starting the camel-cxf example client of using 
Camel transport of CXF -->
+                       
<target.main.class>org.apache.camel.example.camel.transport.Client</target.main.class>
+               </properties>
+       </profile>
+       <profile>
+               <id>WebServiceProvider.Client</id>
+               <properties>
+                       <!-- Starting the camel-cxf example client of how to 
use the JAXWS WebServiceProvider API -->
+                       
<target.main.class>org.apache.camel.example.cxf.provider.Client</target.main.class>
+               </properties>
+       </profile>
+       <profile>
+               <id>JAXRS.Client</id>
+               <properties>
+                       <!-- Starting the camel-cxf example client of JAXRS -->
+                       
<target.main.class>org.apache.camel.example.cxf.jaxrs.Client</target.main.class>
+               </properties>
+       </profile>      
   </profiles>
 
   <build>

Modified: 
camel/trunk/examples/camel-example-cxf/src/main/java/org/apache/camel/example/camel/transport/CamelTransportExample.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-cxf/src/main/java/org/apache/camel/example/camel/transport/CamelTransportExample.java?rev=881304&r1=881303&r2=881304&view=diff
==============================================================================
--- 
camel/trunk/examples/camel-example-cxf/src/main/java/org/apache/camel/example/camel/transport/CamelTransportExample.java
 (original)
+++ 
camel/trunk/examples/camel-example-cxf/src/main/java/org/apache/camel/example/camel/transport/CamelTransportExample.java
 Tue Nov 17 14:32:09 2009
@@ -31,7 +31,7 @@
             // start the endpoints
             server.start();
             // set the client's service access point
-            Client client = new 
Client("http://localhost:9091/GreeterContext/GreeterPort";);
+            Client client = new 
Client("http://127.0.0.1:9091/GreeterContext/GreeterPort";);
             // invoking the services
             client.invoke();
 

Modified: 
camel/trunk/examples/camel-example-cxf/src/main/java/org/apache/camel/example/camel/transport/Client.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-cxf/src/main/java/org/apache/camel/example/camel/transport/Client.java?rev=881304&r1=881303&r2=881304&view=diff
==============================================================================
--- 
camel/trunk/examples/camel-example-cxf/src/main/java/org/apache/camel/example/camel/transport/Client.java
 (original)
+++ 
camel/trunk/examples/camel-example-cxf/src/main/java/org/apache/camel/example/camel/transport/Client.java
 Tue Nov 17 14:32:09 2009
@@ -49,6 +49,13 @@
     public Greeter getProxy() {
         return port;
     }
+    
+    public static void main(String args[]) throws Exception {
+        // set the client's service access point
+        Client client = new 
Client("http://localhost:9091/GreeterContext/GreeterPort";);
+        // invoking the services
+        client.invoke();
+    }
 
     public void invoke() throws Exception {
 

Modified: 
camel/trunk/examples/camel-example-cxf/src/main/java/org/apache/camel/example/cxf/CamelCxfExample.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-cxf/src/main/java/org/apache/camel/example/cxf/CamelCxfExample.java?rev=881304&r1=881303&r2=881304&view=diff
==============================================================================
--- 
camel/trunk/examples/camel-example-cxf/src/main/java/org/apache/camel/example/cxf/CamelCxfExample.java
 (original)
+++ 
camel/trunk/examples/camel-example-cxf/src/main/java/org/apache/camel/example/cxf/CamelCxfExample.java
 Tue Nov 17 14:32:09 2009
@@ -29,7 +29,7 @@
  */
 public final class CamelCxfExample {
     private static final String ROUTER_ADDRESS = 
"http://localhost:9001/SoapContext/SoapPort";;
-    private static final String SERVICE_ADDRESS = 
"http://localhost:9000/SoapContext/SoapPort";;
+    private static final String SERVICE_ADDRESS = 
"http://localhost:9003/SoapContext/SoapPort";;
     private static final String SERVICE_CLASS = 
"serviceClass=org.apache.hello_world_soap_http.Greeter";
     private static final String WSDL_LOCATION = 
"wsdlURL=wsdl/hello_world.wsdl";
     private static final String SERVICE_NAME = 
"serviceName={http://apache.org/hello_world_soap_http}SOAPService";;

Modified: 
camel/trunk/examples/camel-example-cxf/src/main/java/org/apache/camel/example/cxf/Client.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-cxf/src/main/java/org/apache/camel/example/cxf/Client.java?rev=881304&r1=881303&r2=881304&view=diff
==============================================================================
--- 
camel/trunk/examples/camel-example-cxf/src/main/java/org/apache/camel/example/cxf/Client.java
 (original)
+++ 
camel/trunk/examples/camel-example-cxf/src/main/java/org/apache/camel/example/cxf/Client.java
 Tue Nov 17 14:32:09 2009
@@ -55,7 +55,12 @@
         return port;
     }
 
-
+    public static void main(String args[]) throws Exception {
+        // set the client's service access point
+        Client client = new 
Client("http://localhost:9001/SoapContext/SoapPort?wsdl";);
+        // invoking the services
+        client.invoke();
+    }
 
     public void invoke() throws Exception {
 

Added: 
camel/trunk/examples/camel-example-cxf/src/main/java/org/apache/camel/example/cxf/jaxrs/Client.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-cxf/src/main/java/org/apache/camel/example/cxf/jaxrs/Client.java?rev=881304&view=auto
==============================================================================
--- 
camel/trunk/examples/camel-example-cxf/src/main/java/org/apache/camel/example/cxf/jaxrs/Client.java
 (added)
+++ 
camel/trunk/examples/camel-example-cxf/src/main/java/org/apache/camel/example/cxf/jaxrs/Client.java
 Tue Nov 17 14:32:09 2009
@@ -0,0 +1,63 @@
+/**
+ * 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.example.cxf.jaxrs;
+
+import org.apache.camel.example.cxf.jaxrs.resources.Book;
+import org.apache.camel.example.cxf.jaxrs.resources.BookNotFoundFault;
+import org.apache.camel.example.cxf.jaxrs.resources.BookStore;
+
+public class Client {
+    
+    void invoke() throws BookNotFoundFault {
+        // JAXWSClient invocation
+        JAXWSClient jaxwsClient = new JAXWSClient();
+        BookStore bookStore = jaxwsClient.getBookStore();
+        
+        bookStore.addBook(new Book("Camel User Guide", 234L));
+        Book book = bookStore.getBook(123L);
+        System.out.println("Get the book with id 123. " + book);       
+      
+        try {
+            book = bookStore.getBook(124L);
+            System.out.println("Get the book with id 124. " + book); 
+        } catch (Exception exception) {
+            System.out.println("Get the exception " + exception);
+        }
+        
+        // JAXRSClient invocation
+        JAXRSClient jaxrsClient = new JAXRSClient();
+        bookStore =  jaxrsClient.getBookStore();
+        
+        bookStore.addBook(new Book("Camel User Guide", 124L));
+        book = bookStore.getBook(124L);
+        System.out.println("Get the book with id 124. " + book);
+        
+        try {
+            book = bookStore.getBook(126L);
+            System.out.println("Get the book with id 126. " + book); 
+        } catch (Exception exception) {
+            System.out.println("Get the exception " + exception);
+        }
+    }
+    
+    public static void main(String args[]) throws Exception {
+        Client client = new Client();
+        client.invoke();
+    }
+
+}

Propchange: 
camel/trunk/examples/camel-example-cxf/src/main/java/org/apache/camel/example/cxf/jaxrs/Client.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
camel/trunk/examples/camel-example-cxf/src/main/java/org/apache/camel/example/cxf/jaxrs/Client.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: 
camel/trunk/examples/camel-example-cxf/src/main/java/org/apache/camel/example/cxf/provider/Client.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-cxf/src/main/java/org/apache/camel/example/cxf/provider/Client.java?rev=881304&r1=881303&r2=881304&view=diff
==============================================================================
--- 
camel/trunk/examples/camel-example-cxf/src/main/java/org/apache/camel/example/cxf/provider/Client.java
 (original)
+++ 
camel/trunk/examples/camel-example-cxf/src/main/java/org/apache/camel/example/cxf/provider/Client.java
 Tue Nov 17 14:32:09 2009
@@ -77,6 +77,8 @@
         SOAPElement message = payload.addChildElement("requestType");
 
         message.addTextNode("Hello Camel!!");
+        
+        System.out.println("Send out the request: Hello Camel!!");
 
         // Invoke the endpoint synchronously
         SOAPMessage reply = null;
@@ -97,6 +99,8 @@
 
         String responseMessageText = bodyElement.getTextContent();
         
+        System.out.println("Get the response: " + responseMessageText);
+        
         return responseMessageText;
 
     }

Added: 
camel/trunk/examples/camel-example-cxf/src/main/resources/META-INF/spring/CamelCXFProviderRouteConfig.xml
URL: 
http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-cxf/src/main/resources/META-INF/spring/CamelCXFProviderRouteConfig.xml?rev=881304&view=auto
==============================================================================
--- 
camel/trunk/examples/camel-example-cxf/src/main/resources/META-INF/spring/CamelCXFProviderRouteConfig.xml
 (added)
+++ 
camel/trunk/examples/camel-example-cxf/src/main/resources/META-INF/spring/CamelCXFProviderRouteConfig.xml
 Tue Nov 17 14:32:09 2009
@@ -0,0 +1,58 @@
+<?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://camel.apache.org/schema/cxf";
+       xsi:schemaLocation="
+       http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans-2.5.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
+    ">
+
+    <!-- START SNIPPET: example -->
+
+    <!--
+    If you want to run this example in a Tomcat container which needs the 
servlet transport,
+    please replace 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 = "testBean" 
class="org.apache.camel.example.cxf.provider.TesterBean" />
+
+       <cxf:cxfEndpoint id="soapMessageEndpoint"
+               
serviceClass="org.apache.camel.example.cxf.provider.GreeterProvider"
+                       
address="http://localhost:9000/GreeterContext/SOAPMessageService";
+                       wsdlURL="wsdl/hello_world.wsdl"
+                       endpointName="s:SoapOverHttpRouter"
+                       serviceName="s:SOAPService"
+               xmlns:s="http://apache.org/hello_world_soap_http"/>
+
+
+   <camelContext id="test_context" 
xmlns="http://camel.apache.org/schema/spring";>
+       <route>
+            <from uri="cxf:bean:soapMessageEndpoint"/>
+            <to uri="bean:testBean?method=processSOAP"/>
+        </route>
+   </camelContext>
+
+   <!-- END SNIPPET: example -->
+
+</beans>

Added: 
camel/trunk/examples/camel-example-cxf/src/main/resources/META-INF/spring/CamelTransportSpringConfig.xml
URL: 
http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-cxf/src/main/resources/META-INF/spring/CamelTransportSpringConfig.xml?rev=881304&view=auto
==============================================================================
--- 
camel/trunk/examples/camel-example-cxf/src/main/resources/META-INF/spring/CamelTransportSpringConfig.xml
 (added)
+++ 
camel/trunk/examples/camel-example-cxf/src/main/resources/META-INF/spring/CamelTransportSpringConfig.xml
 Tue Nov 17 14:32:09 2009
@@ -0,0 +1,67 @@
+<?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:jaxws="http://cxf.apache.org/jaxws";
+       xsi:schemaLocation="
+       http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+       http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
+       http://camel.apache.org/schema/spring 
http://camel.apache.org/schema/spring/camel-spring.xsd";>
+
+       <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="roundRobinRef"
+               
class="org.apache.camel.processor.loadbalancer.RoundRobinLoadBalancer" />
+
+       <bean 
class="org.apache.camel.component.cxf.transport.CamelTransportFactory" 
lazy-init="false">
+               <property name="bus" ref="cxf" />
+               <property name="camelContext" ref="dest_context" />
+               <property name="transportIds">
+                       <list>
+                               
<value>http://cxf.apache.org/transports/camel</value>
+                       </list>
+               </property>
+       </bean>
+
+       <camelContext id="dest_context" 
xmlns="http://camel.apache.org/schema/spring";>
+               <route>
+                       <from 
uri="jetty:http://localhost:9091/GreeterContext/GreeterPort"; />
+                       <loadBalance ref="roundRobinRef">
+                               <to uri="direct:EndpointA" />
+                               <to uri="direct:EndpointB" />
+                       </loadBalance>
+               </route>
+       </camelContext>
+
+       <jaxws:endpoint id="endpointA" implementor="#implementorA"
+               address="camel://direct:EndpointA" />
+
+       <jaxws:endpoint id="endpointB" implementor="#implementorB"
+               address="camel://direct:EndpointB" />
+
+       <bean id="implementorA" 
class="org.apache.camel.example.camel.transport.GreeterImpl">
+               <property name="suffix" value="EndpointA" />
+       </bean>
+
+       <bean id="implementorB" 
class="org.apache.camel.example.camel.transport.GreeterImpl">
+               <property name="suffix" value="EndpointB" />
+       </bean>
+
+
+</beans>
\ No newline at end of file

Propchange: 
camel/trunk/examples/camel-example-cxf/src/main/resources/META-INF/spring/CamelTransportSpringConfig.xml
------------------------------------------------------------------------------
    svn:mergeinfo = 

Added: 
camel/trunk/examples/camel-example-cxf/src/main/resources/META-INF/spring/CxfRouteCamelContext.xml
URL: 
http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-cxf/src/main/resources/META-INF/spring/CxfRouteCamelContext.xml?rev=881304&view=auto
==============================================================================
--- 
camel/trunk/examples/camel-example-cxf/src/main/resources/META-INF/spring/CxfRouteCamelContext.xml
 (added)
+++ 
camel/trunk/examples/camel-example-cxf/src/main/resources/META-INF/spring/CxfRouteCamelContext.xml
 Tue Nov 17 14:32:09 2009
@@ -0,0 +1,52 @@
+<?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:broker="http://activemq.apache.org/schema/core";
+       xmlns:camel="http://camel.apache.org/schema/spring";
+       xmlns:jaxws="http://cxf.apache.org/jaxws";
+       xsi:schemaLocation="
+       http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+       http://camel.apache.org/schema/spring 
http://camel.apache.org/schema/spring/camel-spring.xsd
+       http://activemq.apache.org/schema/core 
http://activemq.apache.org/schema/core/activemq-core-5.3.0.xsd
+       http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd";>
+  
+  <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" />
+  <import resource="classpath:META-INF/cxf/cxf-extension-jms.xml" />
+
+  <broker:broker id="broker" useJmx="false" persistent="false" 
dataDirectory="target/activemq">
+    <broker:transportConnectors>
+       <broker:transportConnector name="openwire" uri="vm://localhost"/>
+    </broker:transportConnectors>
+  </broker:broker>
+
+  <camel:camelContext id="myCamelContext">
+    <camel:routeBuilder ref="myRouteBuilder"/>    
+  </camel:camelContext>
+
+  <bean id="myRouteBuilder" 
class="org.apache.camel.example.cxf.CamelCxfExample$MyRouteBuilder"/>
+  
+  <jaxws:endpoint id="serviceEndpoint"
+               implementor="org.apache.camel.example.cxf.GreeterImpl"
+               address="jms://JMSAddress"/>
+               
+  
+</beans>
\ No newline at end of file

Propchange: 
camel/trunk/examples/camel-example-cxf/src/main/resources/META-INF/spring/CxfRouteCamelContext.xml
------------------------------------------------------------------------------
    svn:mergeinfo = 

Added: 
camel/trunk/examples/camel-example-cxf/src/main/resources/META-INF/spring/JAXRSCamelContext.xml
URL: 
http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-cxf/src/main/resources/META-INF/spring/JAXRSCamelContext.xml?rev=881304&view=auto
==============================================================================
--- 
camel/trunk/examples/camel-example-cxf/src/main/resources/META-INF/spring/JAXRSCamelContext.xml
 (added)
+++ 
camel/trunk/examples/camel-example-cxf/src/main/resources/META-INF/spring/JAXRSCamelContext.xml
 Tue Nov 17 14:32:09 2009
@@ -0,0 +1,36 @@
+<?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:camel="http://camel.apache.org/schema/spring";
+       xsi:schemaLocation="
+       http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+       http://camel.apache.org/schema/spring 
http://camel.apache.org/schema/spring/camel-spring.xsd";>
+
+  <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" />
+  <import resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml" />
+  <import resource="classpath:META-INF/cxf/cxf-extension-jms.xml" />
+
+  <camel:camelContext id="cxfrs_context">
+    <camel:package>org.apache.camel.example.cxf.jaxrs</camel:package>    
+  </camel:camelContext>
+
+</beans>

Propchange: 
camel/trunk/examples/camel-example-cxf/src/main/resources/META-INF/spring/JAXRSCamelContext.xml
------------------------------------------------------------------------------
    svn:mergeinfo = 

Modified: 
camel/trunk/examples/camel-example-cxf/src/test/java/org/apache/camel/example/cxf/jaxrs/JAXRSClientServerTest.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/examples/camel-example-cxf/src/test/java/org/apache/camel/example/cxf/jaxrs/JAXRSClientServerTest.java?rev=881304&r1=881303&r2=881304&view=diff
==============================================================================
--- 
camel/trunk/examples/camel-example-cxf/src/test/java/org/apache/camel/example/cxf/jaxrs/JAXRSClientServerTest.java
 (original)
+++ 
camel/trunk/examples/camel-example-cxf/src/test/java/org/apache/camel/example/cxf/jaxrs/JAXRSClientServerTest.java
 Tue Nov 17 14:32:09 2009
@@ -20,6 +20,7 @@
 import org.apache.camel.example.cxf.jaxrs.resources.BookNotFoundFault;
 import org.apache.camel.example.cxf.jaxrs.resources.BookStore;
 import org.apache.camel.test.junit4.CamelSpringTestSupport;
+import org.apache.cxf.BusFactory;
 
 import org.junit.Test;
 
@@ -28,8 +29,6 @@
 
 public class JAXRSClientServerTest extends CamelSpringTestSupport {
     
-    
-    
     @Test
     public void testJAXWSClient() throws BookNotFoundFault {
         JAXWSClient jaxwsClient = new JAXWSClient();
@@ -70,5 +69,11 @@
     protected AbstractXmlApplicationContext createApplicationContext() {
         return new ClassPathXmlApplicationContext(new 
String[]{"/META-INF/spring/JAXRSCamelContext.xml"});
     }
+    
+    public void tearDown() throws Exception {
+        super.tearDown();
+        BusFactory.setDefaultBus(null);
+        BusFactory.setThreadDefaultBus(null);
+    }
 
 }


Reply via email to