Web 服务:JAX-WS、CXF、WSDL...这是什么意思?
很抱歉他的新手问题。但我真的需要从这件事开始。 我想访问我的 Java EE 项目中的 Web 服务。此 Web 服务提供 WSDL 文件。所以我知道我可以使用它来构建 Java 代码来访问 Web 服务。 现在我了解到 Apache CXF 是我可以使用的一个很好的框架。但与 JAX-WS 有什么区别呢?
有人可以向我解释一下吗?
Sorry fot his newbie question. But I really need a start on this one.
I want to access a webservice in my Java EE project. This webservice offers a WSDL file. So I understand I can use this to build Java code from it to access the web service.
Now I read that Apache CXF is a good framework that I can use. But what's the difference to JAX-WS?
Could someone please explain this to me?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
其他答案是正确的,但使用 CXF 或 Metro,您将获得一个实施 Web 服务堆栈,并且具有 JAX-WS api 之外的额外功能。这就是为什么 JAX-WS RI 还具有比 JAX-WS 更多的可用功能。
我认为这篇文章非常详细地解释了这一点。
http://www.predic8.com/axis2-cxf-jax-ws -比较.htm
The other answers are correct, but with CXF or Metro you are getting an implementation web services stack and with that are extra features beyond the JAX-WS api. That is why JAX-WS RI also has more features available than just JAX-WS.
I think this article explains this very well in detail.
http://www.predic8.com/axis2-cxf-jax-ws-comparison.htm
JAX-WS 是使用注释定义 Web 服务的规范(由
SunOracle 提供)。Apache CXF 是一个实现 JAX-WS 以生成 Web 服务定义和 Java 代理(从 Web 服务定义)的框架
Apache Axis 2 也是一个现在支持 JAX-WS(最高可达 JAX-WS 2)的框架。它是 Apache Axis 的改进。 CXF 最高支持 JAX-WS 1.2。
可以在此处找到简要教程。
JAX-WS is a Specification (provided by
SunOracle) to defining Web Services by use of Annotations.Apache CXF is a framework that implements JAX-WS to generate Web Services Definitions and Java Proxy (from a Web Service Definitions)
Apache Axis 2 is also a framework that now supports JAX-WS (up to JAX-WS 2). It's an improvement from Apache Axis. CXF supports up to JAX-WS 1.2.
Brief tutorial can be found here.
JAX-WS 是一个 API(或规范),CXF 是该 API 的实现。 此处还提供了一个参考实现
JAX-WS is an API (or specification) and CXF is an implementation of that API. There is also a reference implementation available here
CXF 很好,但您不需要它来解决您的问题。您可以使用 wsimport,它作为一部分JDK 的一部分,从 WSDL 生成类来访问 Web 服务。
CXF is good but you don't need it to solve your problem. You can use wsimport, which comes as part of the JDK, to generate classes from the WSDL to access the web service.