camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vamsikris27 <vamsikri...@gmail.com>
Subject Program fo calling REST Url and displaying output ,getting null as output
Date Mon, 14 Oct 2013 10:30:30 GMT
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.

Mime
View raw message