java Web 服务客户端的 AXIS 与 JAX-WS

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4627240/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-30 07:16:54  来源:igfitidea点击:

AXIS vs JAX-WS for Web Service Client

javasoapwsdljax-wsaxis

提问by jny

I am deciding on the implementation of Web Service Client in Java. I've generated Axis client in Eclipse and JAS-WS client with wsimport. Both solutions work and now I have to choose one to go forward. What should I think about before picking one over the other?

我正在决定在 Java 中实现 Web 服务客户端。我已经在 Eclipse 中生成了 Axis 客户端,并使用 wsimport 生成了 JAS-WS 客户端。两种解决方案都有效,现在我必须选择一个才能继续。在选择一个之前我应该​​考虑什么?

回答by jarnbjo

The client side of JAX-WS is part of the standard Java API, and the reference implementation is reliable and performant, while Axis requires 3rd party dependencies. If you don't need any functionality implemented by Axis and not offered by JAX-WS, I really don't see any reason why you should opt for Axis and not for JAX-WS.

JAX-WS 的客户端是标准 Java API 的一部分,参考实现是可靠和高性能的,而 Axis 需要 3rd 方依赖项。如果您不需要 Axis 实现的任何功能而不是 JAX-WS 提供的功能,我真的看不出有什么理由您应该选择 Axis 而不是 JAX-WS。

回答by Brian

One thing to keep in mind in the comparison. If your web client app has a need to connect multiple users to your back end simultaneously, the Java reference implementation has no way of doing this (at least that I've been able to find). By using the Authenticator class, you're tied to only allowing a single user to ever access the back end and you don't even control the lifespan of that user connection. The Authenticator is a surprisingly difficult-to-use API with severe limitations.

在比较中要记住一件事。如果您的 Web 客户端应用程序需要同时将多个用户连接到您的后端,则 Java 参考实现无法做到这一点(至少我已经找到了)。通过使用 Authenticator 类,您被绑定到只允许一个用户访问后端,您甚至无法控制该用户连接的生命周期。Authenticator 是一个令人惊讶的难以使用的 API,具有严重的局限性。