camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From RR <raghavanrajagopa...@gmail.com>
Subject RestFul Services using CAMEL
Date Sun, 08 Apr 2012 01:14:05 GMT
I am a newbie to CAMEL. Pardon me if this is a so naive.

Our users are going to call a REST webservice that's going to load a very
big XML file and respond back only a portion of the XML. I came across
tokenizeXML() in Splitter EAI pattern and played around a bit and works
great stand-alone. 

But I am not able to implement this while try to integrate with CXF
Webservice.

In my beans.xml I have,

<bean id="demoService" name="demoService" class="com.hrb.demo.DemoService">
</bean>
<jaxrs:server id="demo" address="/demo">
	<jaxrs:serviceBeans>
		<ref bean="demoService" />
	</jaxrs:serviceBeans>
</jaxrs:server>

<cxf:rsServer id="myServer" address="/demo"
		serviceClass="com.hrb.demo.DemoService" />

<camelContext id="mycamelContext"
xmlns="http://camel.apache.org/schema/spring">
	<package>com.hrb.demo</package>
</camelContext> 

and I want my Routerclass to process the request by loading the XML using
split(), tokenizeXML() and streaming() and send the response back.

from("cxfrs://bean:myServer"). process(new Processor() {
			public void process(Exchange arg0) throws Exception {
                             //THE FILE order.dat is compressed..
				File file = new File(
						"C:\\temp\order.dat");
				ZipFile zipfile = new ZipFile(file);
				Enumeration e = zipfile.entries();
				ZipEntry entry = null;
				while (e.hasMoreElements()) {
					entry = (ZipEntry) e.nextElement();
				}
                         // I WANT TO SEND THIS STREAM TO THE NEXT
ROUTE..BUT NOT SURE HOW???
			}
		}).split().tokenizeXML("Order").streaming().process(new Processor() {

                            // IF THE TOKENIZED STRING IS EQUAL TO CERTAIN
VALUE,
                           // I WANT TO SET THE RESPONSE FOR REST SERVICE.
                 }.end();

}

I dont know whether it's possbile to do this way via CAMEL. Any help is
greatly appreciated.

Thanks,
RR


--
View this message in context: http://camel.465427.n5.nabble.com/RestFul-Services-using-CAMEL-tp5625332p5625332.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message