You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Nick Bryan <ni...@unit3d.tv> on 2015/05/14 16:34:34 UTC
spring-ws component 2.15.2
Hi,
Trying to use spring-ws as a web service client and set up the following very simple route based on the component doc
public void configure() {
String dataRequest = "<ns1:GetWeather xmlns:ns1='http://www.webservicex.com'>" +
" <ns1:CityName>London</ns1:CityName>" +
" <ns1:CountryName>England</ns1:CountryName>" +
"</ns1:GetWeather>";
ProducerTemplate template = getContext().createProducerTemplate();
from("direct:example")
.to("spring-ws:http://www.webservicex.com/globalweather.asmx");
template.requestBody("direct:example", dataRequest);
}
When I run it I'm getting the error - No consumers available on endpoint: Endpoint[direct://example]
Any pointers as to what I'm doing wrong?
Thanks
Nick
Re: spring-ws component 2.15.2
Posted by Claus Ibsen <cl...@gmail.com>.
Hi
The configure method of RouteBuilder is only for setting up the Camel
routes. All the code with the producer template et all should be done
someplace else.
http://camel.apache.org/walk-through-an-example.html
On Thu, May 14, 2015 at 4:34 PM, Nick Bryan <ni...@unit3d.tv> wrote:
> Hi,
> Trying to use spring-ws as a web service client and set up the following very simple route based on the component doc
>
> public void configure() {
>
> String dataRequest = "<ns1:GetWeather xmlns:ns1='http://www.webservicex.com'>" +
> " <ns1:CityName>London</ns1:CityName>" +
> " <ns1:CountryName>England</ns1:CountryName>" +
> "</ns1:GetWeather>";
>
> ProducerTemplate template = getContext().createProducerTemplate();
>
> from("direct:example")
> .to("spring-ws:http://www.webservicex.com/globalweather.asmx");
>
> template.requestBody("direct:example", dataRequest);
> }
>
> When I run it I'm getting the error - No consumers available on endpoint: Endpoint[direct://example]
>
> Any pointers as to what I'm doing wrong?
> Thanks
> Nick
--
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/