Hi, I am new to Apache camel and trying to Configure camel for invoking a rest webservice and getting a response in JSON and type cast it. I tried the following but, am not able to get the response anywhere.
Had the configuration file "camel-context.xml" as ------------------------------------------ <cxf:rsClient id="signOnRsClient" address="http://158.151.224.44:8080/organizations?match&CountryISOAlpha2Code=GB&CustomerReferenceText=REFTEXT&DUNSNumber=210021531" /> <route streamCache="true"> <from uri="direct:cafe" /> <log message="****************Sign ON Request Fired************" /> <bean ref="signOnRequestHandler" /> <to uri="cxfrs://bean://signOnRsClient"/> <bean ref="signOnResponseHandler" /> ------------------------------------------ In signOnRequestHandler, I had the following lines for appending the request parameters ------------------------------------------ public void process(Exchange exchange) throws Exception { @SuppressWarnings("unchecked") Message inputMessage = exchange.getIn(); inputMessage.setHeader("x-dnb-user", "uatuser1"); inputMessage.setHeader("x-dnb-pwd", "password-1"); } ------------------------------------------ I had main java file , where am trying to invoke the from:uri for initiating the rest action as below ------------------------------------------ public static void main(String[] args) throws Exception { AbstractApplicationContext applicationContext; ProducerTemplate template; applicationContext = new ClassPathXmlApplicationContext("camelcontext.xml"); CamelContext camelContext = applicationContext.getBean("camelContext", CamelContext.class); template = camelContext.createProducerTemplate(); template.sendBody("direct:cafe", ExchangePattern.InOut); } ------------------------------------------ In the response, am not able to figure out on how to process it. The response handler is as below ------------------------------------------ public void process(Exchange exchange) throws Exception { System.out.println("--->" + exchange.getOut().getHeaders().toString()); System.out.println("--->" + exchange.getOut()); ------------------------------------------ I might have done something wrong in the above things, which am unaware. Please guide me on how to resolve this. Thanks, Bala -- View this message in context: http://camel.465427.n5.nabble.com/Camel-for-Rest-Service-tp5723267.html Sent from the Camel - Users mailing list archive at Nabble.com.