camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From santoshjoshi <santoshjoshi2...@gmail.com>
Subject Re: CXFRS and printing out put to XML file
Date Tue, 18 Oct 2011 18:21:45 GMT
Thanks Everyone in this forum,

I got the solution, basically my camel-context configuration was not up to
that mark,

The below configuration solved my problem.
 
        <! -- 4 THE ACTUAL SERVER WHICH WILL GET HIT -->
	<jaxrs:server id="restService" depends-on="camelContext"
		address="http://REALSERVER.COM/REST/" createdFromAPI="true"
		staticSubresourceResolution="true">
		<jaxrs:serviceBeans>
			<ref bean="servicecity" />
		</jaxrs:serviceBeans>
	</jaxrs:server>
	
	<bean name="servicecity" id="servicecity"
class="com.santosh.CityServiceImpl" />

 
        <! -- 3  YOUR PROXY CLIENT -->
	<cxf:rsClient id="rsClient" address="http://REALSERVER.COM/REST/" 
				  serviceClass="com.santosh.CityServiceImpl"
		          username="santosh" password="pwd" />

        <! -- 1 JAXRS PROXY CLIENT  --> 
	<jaxrs:client id="cityServiceClient" address="http://localhost:8123/REST/"
		serviceClass="com.santosh.CityService" username="santosh" password="pwd">
	</jaxrs:client>

       <! -- 2  YOUR LOCAL SERVER THAT YOU NEED TO HIT, YOUR LOCAL SERVER
-->
	<cxf:rsServer id="rsServer" address="http://localhost:8123/REST/"
serviceClass="com.santosh.CityServiceImpl" />


THE STEPS ARE 
1)  create  JAXRS PROXY CLIENT and get it in your have code
       CityService cityService = (CityService)
context.getBean("cityServiceClient");
       cityService.getCities("INDIA");

2) the above code will call the SERVER (LOCAL) 

3)  the above step  will call  YOUR PROXY CLIENT 

4) the PROXY CLIENT will call the ACTUAL REAL SERVER


Please correct if i am wrong,

Thanks
Santosh

--
View this message in context: http://camel.465427.n5.nabble.com/CXFRS-and-printing-out-put-to-XML-file-tp4902503p4914796.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message