我正在使用camel-cxf通过cxfServlet加载服务。 这对xml spring dsl来说很好。 当我决定将路由从xml更改为java dsl cxfServlet时,返回“未找到服务”。
我的路线:
CamelContext myCamelContext;
myCamelContext = new DefaultCamelContext();
final CxfEndpoint cxfEndpoint = new CxfEndpoint();
cxfEndpoint.setAddress("/uploadWsdl");
cxfEndpoint.setServiceClass("co.iais.bimeservice.ServiceEndpoint");
cxfEndpoint.setServiceName(new QName("s:WsdlService", "http://BimeService.iais.co", ""));
cxfEndpoint.setCamelContext(myCamelContext);
try {
RouteBuilder builder = new RouteBuilder() {
@Override
public void configure() {
from(cxfEndpoint).bean(EmptyBean.class);
}
};
myCamelContext.addRoutes(builder);
myCamelContext.start();
} catch (Exception e) {
Logger.getLogger(RestApp.class.getName()).log(Level.SEVERE, null, e);
}
web.xml:
<servlet>
<servlet-name>CXFServlet</servlet-name>
<servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- all our webservices are mapped under this URI pattern -->
<servlet-mapping>
<servlet-name>CXFServlet</servlet-name>
<url-pattern>/services/*</url-pattern>
</servlet-mapping>
,当我在浏览器中调用“ http://localhost:8084/BimeService/services/uploadWsdl”时,返回“找不到服务”。 但是在xml dsl中,此服务配置正常运行。任何帮助都使我感到高兴!