繁体   English   中英

apache cxf:多个端点还是多个CXFServlet servlet?

[英]apache cxf: multiple endpoints or multiple CXFServlet servlets?

我已经实现了具有多个端点的Apache CXF Web服务。

我已经成功部署了Web服务。

我遇到的问题是所有端点WSDL都出现在同一servlet URL中。

我可以在同一web.xml拥有两个org.apache.cxf.transport.servlet.CXFServlet类型的servlet,并让每个servlet服务一个端点,以便于我吗? ...

  • 位于http:// localhost / app / endpoint1的端点1

  • 位于http:// localhost / app / endpoint2的端点2

使用2个CXFServlet的动机是什么? CXF每个Servlet实例支持多个端点。

可以通过多种方式进行配置。 一个例子:

<jaxws:endpoint id="endpoint1" 
  implementor="#service1Impl" 
  address="/endpoint1">...</jaxws:endpoint>

<jaxws:endpoint id="endpoint2" 
  implementor="#service2Impl" 
  address="/endpoint2">...</jaxws:endpoint>

..其中service1Impl和service2Impl是实现服务接口的bean。

您能否提供有关部署的更多详细信息? 码头? Tomcat的? 还有吗

文档中 ,看起来就像

Endpoint.publish("/service1", new ServiceOneImpl());
Endpoint.publish("/service2", new ServiceTwoImpl());

但是我自己还没有尝试过。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM