In your XML/Spring route definition, you have to use "&" instead of "&".

Best,
Christian

On Fri, Mar 16, 2012 at 12:04 AM, soumya_sd <soumya...@yahoo.com> wrote:

> I'm trying to integrate Google Places API using Apache Camel
> (2.10-SNAPSHOT)
> and Spring (3.0.7.RELEASE) with Tomcat (7.0.26) as my web conainer server.
>
> When I declare the route in a Spring config xml (see below) I can see the
> correct output response on my Tomcat logs.
>
>
>  <route id="google-places-route">
>        <from uri="direct:start" />
>        <to
> uri="
> https://maps.googleapis.com/maps/api/place/search/json?location=40.446788,-79.950559&radius=500&types=food&sensor=false&key=my-google-api-key
> "
> />
>        <to uri="stream:out"/>
>        </split>
> </route>
>
> Please note the camel scheme used here is https and NOT http.
>
> Now, I'm trying to do the same by defining my route in a Java class that
> extends RouterBuilder
>
> public class GooglePlacesRoute extends RouteBuilder {
>
>  @Override
> public void configure() throws Exception {
>
>    from("direct:start").process(new
> MyCustomProcessor()).to("
> https://maps.googleapis.com/maps/api/place/search/json?location=40.446788,-79.950559&radius=500&types=food&sensor=false&key=my-google-api-key
> ").to("stream:out");
> }
> }
>
> class MyCustomProcessor implements Processor {
>
> @Override
> public void process(Exchange exchange) throws Exception {
>
>    exchange.setPattern(ExchangePattern.InOut);
>        Message inMessage = exchange.getIn();
>
>
>    inMessage.setHeader(Exchange.HTTP_METHOD, "GET");
>    exchange.getIn().setBody("", String.class);
>
> }
> }
>
> My Camel route is deployed and started correctly. However, when I invoked
> it
> I don't get the expected output. I get the following response from Google's
> servers.
>
> { "html_attributions" : [], "results" : [], "status" : "REQUEST_DENIED" }
>
> I'm assuming that I don't have to do anything special in my Java DSL to
> handle HTTPS (instead of HTTP). Is this assumption correct ?
>
> What am I missing here ?
>
> Thanks.
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Why-this-works-with-Spring-DSL-and-not-Java-DSL-http-component-tp5569500p5569500.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Reply via email to