Camel,Maven,Spring的新手......尝试测试最简单的原型来调用外部Web服务。如果这对于这个论坛来说这个问题太基本了,请告诉我,还有一个更合适的问题。以下例外和代码:
异常:由以下原因引起:org.apache.camel.NoSuchBeanException:没有bean 可以在注册表中找到:cc类型: org.apache.camel.component.cxf.CxfEndpoint
<cxf:cxfEndpoint id="cc"
address="http://www.webservicex.net/CurrencyConvertor.asmx"
wsdlURL="http://www.webservicex.net/CurrencyConvertor.asmx?WSDL"
endpointName="CurrencyConvertorHttpGet"
serviceName="CurrencyConvertor"/>
<camelContext xmlns="http://camel.apache.org/schema/spring">
<package>com.cgi.siromsint</package>
</camelContext>
POM依赖项:
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core</artifactId>
<version>${camel-version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-spring</artifactId>
<version>${camel-version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-cxf</artifactId>
<version>${camel-version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-http</artifactId>
<version>${camel-version}</version>
</dependency>
public class WSRouteBuilder extends RouteBuilder {
@Override
public void configure() throws Exception {
from("file:src/data/amanda.csv").marshal().string()
.to("cxf:bean:cc");
}
}