The website that I'm trying to access sends xml only. With Camel's XML DSL I'm trying to get that XML and send it off to another site via cxrfs. For right now I can settle for it going to a bean and merely being able to access the data.
When I execute my route I dont necessarily get any errors. It just doesnt do anything with the XML probably because its not getting stored in the body. Not sure though.
Output
[INFO] Starting Camel ...
[pache.camel.spring.Main.main()] MainSupport INFO Apache Camel 2.12.0.redhat-610379 starting
[pache.camel.spring.Main.main()] SpringCamelContext INFO Apache Camel 2.12.0.redhat-610379 (CamelContext: camel) is starting
[pache.camel.spring.Main.main()] ManagedManagementStrategy INFO JMX is enabled
[pache.camel.spring.Main.main()] DefaultTypeConverter INFO Loaded 190 type converters
[pache.camel.spring.Main.main()] SpringCamelContext INFO AllowUseOriginalMessage is enabled. If access to the original message is not needed, then its recommended to turn this option off as it may improve performance.
[pache.camel.spring.Main.main()] SpringCamelContext INFO StreamCaching is not in use. If using streams then its recommended to enable stream caching. See more details at http://camel.apache.org/stream-caching.html
[pache.camel.spring.Main.main()] SpringCamelContext INFO Route: route1 started and consuming from: Endpoint[timer://foo?repeatCount=1]
[pache.camel.spring.Main.main()] SpringCamelContext INFO Total 1 routes, of which 1 is started.
[pache.camel.spring.Main.main()] SpringCamelContext INFO Apache Camel 2.12.0.redhat-610379 (CamelContext: camel) started in 0.335 seconds
[camel) thread #0 - timer://foo] BusApplicationContext INFO Refreshing org.apache.cxf.bus.spring.BusApplicationContext@3fd43e1d: startup date [Fri Sep 19 09:33:45 EDT 2014]; parent: org.springframework.context.support.FileSystemXmlApplicationContext@375d661b
[camel) thread #0 - timer://foo] idationXmlBeanDefinitionReader INFO Loading XML bean definitions from class path resource [META-INF/cxf/cxf.xml]
[camel) thread #0 - timer://foo] idationXmlBeanDefinitionReader INFO Loading XML bean definitions from class path resource [META-INF/cxf/camel/cxf-extension-camel.xml]
My Processor! Get In
null
My Processor! Get out
Message: [Body is null]
Route
<bean id="proc" class="com.b2bservicep1.httpserv.Proc"/>
<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
<route>
<from uri="timer://foo?repeatCount=1"/>
<setHeader headerName="CamelHttpMethod">
<constant>GET</constant>
</setHeader>
<to uri="cxfrs://http://myxmlsitethatimcalling.com?resourceClasses=com.b2bservicep1.httpserv.Proc"/>
<to uri="bean:proc?method=process"/>
</route>
</camelContext>
</beans>
Processor that I wrote
package com.b2bservicep1.httpserv;
import javax.ws.rs.GET;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
public class Proc implements Processor{
@Override @GET
public void process(Exchange arg0) throws Exception {
// TODO Auto-generated method stub
System.out.println("My Processor! Get In");
System.out.println(arg0.getIn().getBody());
System.out.println("My Processor! Get out");
System.out.println(arg0.getOut());
}