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

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -