You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by vamsikris27 <va...@gmail.com> on 2013/10/14 12:30:30 UTC
Program fo calling REST Url and displaying output ,getting null as
output
Hi,
I am new to using CAMEL and REST.I have written a camel program ,which
calls a REST url and tries to display the output .i am getting null as
output .Can anyone help me out.Thanks
public class Servlet1 extends HttpServlet{
public void doGet(HttpServletRequest request, HttpServletResponse
response)
throws IOException{
PrintWriter out = response.getWriter();
System.out.println("test");
int status = 0;
String problemDescription = null;
String Response=null;
// String URL
="http://code.google.com/a/eclipselabs.org/p/restclient-tool/" ;
String URL ="http://code.google.com/p/rest-client/";
CamelContext camel = new DefaultCamelContext();
ProducerTemplate template = camel.createProducerTemplate();
Exchange exchange = template.request(URL, new Processor() {
public void process(Exchange exchange) throws Exception {
}
});
out.println("<html>");
out.println("<body>");
out.println("
Testing Camel
");
out.println(exchange.getOut().getBody(String.class));
out.println("</body>");
out.println("</html>");
}
--
View this message in context: http://camel.465427.n5.nabble.com/Program-fo-calling-REST-Url-and-displaying-output-getting-null-as-output-tp5741512.html
Sent from the Camel - Users mailing list archive at Nabble.com.