camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ychawla <>
Subject Re: Not able to invoke webservice using http component
Date Tue, 23 Mar 2010 16:29:44 GMT

Hi Habeer,
Do you need to do the DOM conversions that you are doing:

Document input = xmlConverter.toDOMDocument(soapMessage);

Can't you just set the body to be a string?

Same with the return message.  That might be tripping something up.  Also,
are you able to get to your webservice using a browser/basic auth:


When I was first setting up a web service connection through HTTP, I set up
a polling folder and result folder and got that working first.  I just made
the entire soap message in a text editor which it looks like you already
have.  Then you can set up a simple route to test for web service

<from uri="file:/tmp/input"/>
<to uri="file:/tmp/output"/>


Harbeer Kadian wrote:
> Hi,
> I deployed a simple webservice on TomCat Server.
> I created following route to access the webservice using apache camel.
> from("direct:ProducerUri")
> .to("http://localhost:8095/WebServiceTutorial/services/Hello?username=admin&password=admin");
> I created the exchange in the following way
> String soapMessage = "<soapenv:Envelope
> xmlns:soapenv=\"\"
> xmlns:tut=\"\"><soapenv:Header/><soapenv:Body><tut:sayHello><tut:name>"
>                 + "Harbeer Kadian" +
> "</tut:name></tut:sayHello></soapenv:Body></soapenv:Envelope>";
>             XmlConverter xmlConverter = new XmlConverter();
> Document input = xmlConverter.toDOMDocument(soapMessage);
> exchange.getIn().setBody(input);
> exchange.setPattern(ExchangePattern.InOut);
> //added this line after seeing no soapAction found error on Tom Cat Server
> log
> exchange.getIn().setHeader("SOAPAction", "");
> exchange = producerTemplate.send("direct:ProducerUri", exchange);
> Document output = (Document)exchange.getOut().getBody();
> System.out.println(output);
> I am getting null as output.
> Also on the tom cat server log, no exception is coming.
> I have no idea how to invoke webservice using http component.
> Please help me.
> With Regards
> Harbeer Kadian

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message