web services - How to invoke a simple webservice with camel? -


this route:

<route> <from uri="timer:timername?period=2000"/> <to uri="ahc:http://www.google.com/search?q=camel"/> <log message="${property.camelhttpresponsecode}"/> </route> 

i want response code status got error

exchange[message: [body null]] 

how can fix problem ?

i guess reading "get response code" paragraph in documentation have helped :

exchange exchange = template.send("ahc:http://www.google.com/search", new processor() {         public void process(exchange exchange) throws exception {             exchange.getin().setheader(exchange.http_query, constant("hl=en&q=activemq"));      } }); message out = exchange.getout(); int responsecode = out.getheader(exchange.http_response_code, integer.class); 

Comments

Popular posts from this blog

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

1111. appearing after print sequence - php -

android - How to create dynamically Fragment pager adapter -