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
Post a Comment