camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nit_mis <mishranitin2...@gmail.com>
Subject Camel CXF RS Working example
Date Thu, 22 Sep 2011 21:34:48 GMT
Hi,

I am looking for a camel CXF RS working example. Could anyone point me to
the right source code for the working example?
I have done following configuration and deployed the example in the tomcat
but I am getting strange output when typing the URL on the browser

<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"
	xmlns:jaxrs="http://cxf.apache.org/jaxrs"
	xsi:schemaLocation="
       http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
       http://camel.apache.org/schema/cxf
http://camel.apache.org/schema/cxf/camel-cxf.xsd
       http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.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-jaxrs-binding.xml" />
    <import resource="classpath:META-INF/cxf/cxf-extension-http.xml" />
    <import resource="classpath:META-INF/cxf/cxf-servlet.xml"/>

	 
	<jaxrs:server id="restService"
address="http://localhost:9002/camel-example-cxf-tomcat-2.7.2/rest"
		staticSubresourceResolution="true">
		<jaxrs:serviceBeans>
			<ref bean="customerService" />
		</jaxrs:serviceBeans>
	</jaxrs:server>
  
  <bean id="customerService"
class="org.apache.camel.example.cxf.CustomerService" />
  
  <cxf:rsServer id="rsServer"
address="http://localhost:8080/camel-example-cxf-tomcat-2.7.2/route"
                serviceClass="org.apache.camel.example.cxf.CustomerService"
/>

        <cxf:rsClient id="rsClient"
address="http://localhost:9002/camel-example-cxf-tomcat-2.7.2/rest"
                serviceClass="org.apache.camel.example.cxf.CustomerService"
/>

        <camelContext id="camel"
xmlns="http://camel.apache.org/schema/spring">
                <route>
                        <from uri="cxfrs://bean://rsServer" />
                        <setHeader headerName="CamelCxfRsUsingHttpAPI">
                                <constant>True</constant>
                        </setHeader>
                        <to uri="cxfrs://bean://rsClient" />
                </route>
        </camelContext>
  
</beans>


Output: (When used URL:
http://localhost:8080/camel-example-cxf-tomcat-2.7.2)

Available RESTful services:
Endpoint address: http://localhost:9002/camel-example-cxf-tomcat-2.7.2/rest
WADL :
http://localhost:9002/camel-example-cxf-tomcat-2.7.2/rest?_wadl&type=xml
Endpoint address: http://localhost:8080/camel-example-cxf-tomcat-2.7.2/route
WADL :
http://localhost:8080/camel-example-cxf-tomcat-2.7.2/route?_wadl&type=xml

Thanks

--
View this message in context: http://camel.465427.n5.nabble.com/Camel-CXF-RS-Working-example-tp4831560p4831560.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message