camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ychawla <premiergenerat...@yahoo.com>
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);
exchange.getIn().setBody(input);

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:

http://localhost:8095/WebServiceTutorial/services/Hello?username=admin&password=admin

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
connectivity:

<from uri="file:/tmp/input"/>
<to
uri="http://localhost:8095/WebServiceTutorial/services/Hello?username=admin&password=admin"
/>
<to uri="file:/tmp/output"/>

Cheers,
Yogesh


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=\"http://schemas.xmlsoap.org/soap/envelope/\"
> xmlns:tut=\"http://tutorial.com\"><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: http://old.nabble.com/Not-able-to-invoke-webservice-using-http-component-tp28001459p28003434.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Mime
View raw message