2012-09-14 22 views
2

我通过简单的终端界面曝光了JAX-WS Web服务(example使用Java SE端点嵌入式Tomcat的

如果我理解正确的API,以替代直接调用Endpoint.publish(使用Sun的HTTP服务器),我们可以:

  1. 创建端点 - >Endpoint e = Endpoint.create(impl);
  2. 发布端点--->e.publish(context);

我可以使用此e.publish(..) API发布到嵌入式tomcat服务器吗? (example

javadoc of the Publish method对我来说很让人困惑。

回答

2

虽然已经两岁多了,this answer还是有相关问题的。如果你想部署到tomcat,无论它是在嵌入式模式下运行还是正常运行,你都需要打包一个war并将它放在webapps目录中。

要按照您的问题描述的方式与publish()方法一起使用,tomcat将不得不提供Sun HTTP Server Service Provider Implementation,事实并非如此。 Sun的HTTP服务器的替代品是例如Jetty

+0

谢谢。我在Jetty上跟踪了你的线索,发现Apache CXF(内部使用Jetty)可以正常工作。我发布了一些关于此主题的其他有用链接,并发布到了我的[博客](http://kpachar.blogspot.in/2012/09/secure-jax-ws-with-apache-cxf-some-links.html ) – Pradyumna