且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

JAX-WS实现包含在Java中?

更新时间:2023-09-19 14:40:40

捆绑的JAX- WS缺乏与servlet容器的集成,因为它仅用于 在独立Java应用程序中提供JAX-WS服务(WTF!?!?!?)。

Bundled JAX-WS lacks integration with servlet containers, as it is intended to be used only to offer JAX-WS services inside standalone Java applications (WTF!?!?!?).

当然,可以考虑实现一个执行该集成的servlet,因此您不必在WAR中包含另一个Metro副本。但是只包含一个外部的完整副本更容易,它会使WAR膨胀,但不应该有很大的性能损失。此外,通过这种方式,您可以控制使用的版本,避免陷入JRE中包含的版本。

Of course, one could think of implementing a servlet that does that integration, so you would not have to include another copy of Metro in your WAR. But it is easier to just include an external "full" copy, it bloats the WAR but should not have a great performance penalty. Furthermore, in this way you can control which version you use, avoiding to get stuck with the version that was included in your JRE.

无论如何,Sun通常会更改软件包名称。捆绑的库,所以它们不会与外部库冲突,因此,如果servlet存在(它没有),它可能会被调用:

Anyway, Sun usually changed package names in bundled libraries so they would not collide with external ones, Therefore, if the servlet would exist (it does not), it would probably be called:

com.sun.xml 。 内部。 ws.transport.http.servlet.WSServlet

com.sun.xml. internal. ws.transport.http.servlet.WSServlet

这非常烦人,因为它们也以相同的方式更改了一些配置属性(例如:超时相关的),所以如果你使用捆绑的JAX-WS,你必须使用

This is very annoying as they also changed some configuration properties in the same way (e.g.: timeout related ones), so if you use the bundled JAX-WS you have to use

com.sun.xml。 内部。 ...样式配置属性,

但如果您使用某些外部JAX-WS,则必须使用

com.sun.xml. internal.... style configuration properties,

but if you use some external JAX-WS you have to use

com.sun .xml ....样式配置属性。

com.sun.xml.... style configuration properties.

谢谢Sun !!