You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by vigneshwaran02 <vi...@gmail.com> on 2015/08/10 16:21:32 UTC

Spring DSL consume Restful WebService to POJO

Hi Team,

I tried to use Spring DSL to consume to Restful Webservice and store the
output in the POJO but the processor was not triggered. Can you please
assist me on this.

from("restlet:http://localhost:8090/validateCustomer?custName=XXX").process(new
ProcessWebservice())
.to("file:destination");

public class ProcessWebservice implements Processor {
	
    public void process(Exchange exchange) throws Exception {
        String body = exchange.getIn().getBody(String.class);
        System.out.println("body>>"+body);

    }

I appreciate your help on this.


Thanks,
Vigneshwaran
}



--
View this message in context: http://camel.465427.n5.nabble.com/Spring-DSL-consume-Restful-WebService-to-POJO-tp5770531.html
Sent from the Camel Development mailing list archive at Nabble.com.

Re: Spring DSL consume Restful WebService to POJO

Posted by "calyan.bandi" <ca...@gmail.com>.
Hi,

I would recommend to troubleshoot this in the following way:

from("restlet:http://localhost:8090/validateCustomer?custName=XXX").log("response
from webservice is ${body}");

or you can redirect the output to stdout using the stream component.
from("restlet:http://localhost:8090/validateCustomer?custName=XXX").to("stream:out");

This way you'll ensure that indeed you are receiving a response from the
webservice. As per my experience, webservice calls from a client program are
not successful usually the first time due to many factors. So you might want
to rule out that possibility first.

Thanks,
Kalyan




--
View this message in context: http://camel.465427.n5.nabble.com/Spring-DSL-consume-Restful-WebService-to-POJO-tp5770531p5770641.html
Sent from the Camel Development mailing list archive at Nabble.com.