camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From madhu_online1 <>
Subject Getting Bad Request response invoking REST web service
Date Sun, 22 Jun 2014 02:54:03 GMT
I am trying to invoke an online REST web service through my Camel route and
get an http Bad Request response. I am not able to understand what is going

This is the code snippet for my route:-
MethodCallExpression encodingTransformer =  new
MethodCallExpression(URLEncoderTransformer.class, "transformBody");

			.process(new Processor() {				
				public void process(Exchange exchange) {
						Object fileNetResponse = exchange.getIn().getBody();
				} //End process

It fails on the invocation of the REST web service itself. I am not sure
what is the best way to invoke the service. 

My Java snippet to invoke the same snippet works fine:-
		URL testUrl = new URL("");
		URLConnection conn = testUrl.openConnection(); 
		BufferedReader in = new BufferedReader(new
		String inputLine = null;
		while ((inputLine = in.readLine())  != null) {

Can someone please help me understand how I can do the same thing above in
Java in Camel? 

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message