JVM 1.8.0_45
apache-camel 2.15.2
spring-ws 2.2.1
spring-boot 1.2.4
我试图在spring-boot应用程序中使用apache-camel(2.15.2)来处理传入的Web服务调用.
我根据这里的指南创建了一个初始工作的春季启动项目(没有骆驼)http://spring.io/guides/gs/producing-web-service/
然后我尝试将Camel:Spring Web Services组件集成为Consumer来处理传入的Web服务请求,遵循"公开Web服务"部分中的指导原则http://camel.apache.org/spring-web-services.html
WebServiceConfig.java
import org.apache.camel.component.spring.ws.bean.CamelEndpointMapping;
@EnableWs
@Configuration
public class WebServiceConfig extends WsConfigurerAdapter {
@Bean
public ServletRegistrationBean messageDispatcherServlet(ApplicationContext applicationContext) {
MessageDispatcherServlet servlet = new MessageDispatcherServlet();
servlet.setApplicationContext(applicationContext);
servlet.setTransformWsdlLocations(true);
return new ServletRegistrationBean(servlet, "/ws/*");
}
// default wsdl stuff here...
// exposing the endpoint mapping bean here rather than in spring-ws-servlet.xml (seems to work)
@Bean public CamelEndpointMapping endpointMapping() {
return new CamelEndpointMapping();
}
}
Run Code Online (Sandbox Code Playgroud)
ClaimRouter.java
import org.apache.camel.LoggingLevel;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.model.dataformat.JaxbDataFormat; …
Run Code Online (Sandbox Code Playgroud)