hi,

I am following example on 
(how to invoke rest service through camel cxfrs producer)
http://camel.apache.org/cxfrs.html  


My question is how do i call webservice
http://www.webservicex.net/stockquote.asmx/GetQuote?symbol=RHT

from below sample


Exchange exchange = template.send("direct://proxy", new Processor() {
    public void process(Exchange exchange) throws Exception {
        exchange.setPattern(ExchangePattern.InOut);
        Message inMessage = exchange.getIn();
        setupDestinationURL(inMessage);
        // set the operation name 
        inMessage.setHeader(CxfConstants.OPERATION_NAME, "getCustomer");
        // using the proxy client API
        inMessage.setHeader(CxfConstants.CAMEL_CXF_RS_USING_HTTP_API,
Boolean.FALSE);
        // set a customer header
        inMessage.setHeader("key", "value");
        // set the parameters , if you just have one parameter 
        // camel will put this object into an Object[] itself
        inMessage.setBody("123");
    }
});
      
// get the response message 
Customer response = (Customer) exchange.getOut().getBody();

Thanks



--
View this message in context: 
http://camel.465427.n5.nabble.com/Calling-restful-webservice-from-Camel-tp5763765.html
Sent from the Camel Development mailing list archive at Nabble.com.

Reply via email to