Java JAX-WS 与 JAX-RPC
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3307516/
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
JAX-WS vs. JAX-RPC
提问by norminka
I wrote 2 webservices, one with Jax-WS and one with Jax-RPC. They just return a String.
我编写了 2 个 web 服务,一个使用 Jax-WS,一个使用 Jax-RPC。他们只是返回一个字符串。
I stress-tested both with jMeter and, strangely, thereby Jax-RPC was a bit faster.
我用 jMeter 进行了压力测试,奇怪的是,因此 Jax-RPC 更快了一点。
When do I really profit of Jax-WS in aspects of performance (response time, CPU-time, heap)? How can I proof it?
我什么时候才能真正从性能方面(响应时间、CPU 时间、堆)受益于 Jax-WS?我该如何证明?
thanks for your time! =)
谢谢你的时间!=)
回答by Pascal Thivent
You didn't mention anything about the implementations you're using so it's hard to say anything about them :)
I don't know if your benchmark is representative of anything, I'm not sure it allows to make any valid conclusion.
JAX-WS is supposed to perform better in general than JAX-RPC, see the already mentioned article.
JAX-RPC is a dead standard that has been pruned in Java EE 6 (and might thus be removed from future versions). Reason for Pruning:JAX-RPC was an early attempt at modeling SOAP web services as RPC calls. Web services have since grown out of being an RPC model. The much more robust, feature-rich and popular JAX-WS API effectively supercedes JAX-RPC.
您没有提及有关您正在使用的实现的任何内容,因此很难对它们进行任何说明:)
我不知道你的基准是否代表任何东西,我不确定它是否允许做出任何有效的结论。
JAX-WS 一般应该比 JAX-RPC 执行得更好,请参阅已经提到的文章。
JAX-RPC 是一个死标准,已在 Java EE 6 中删除(因此可能会从未来版本中删除)。修剪的原因:JAX-RPC 是将 SOAP Web 服务建模为 RPC 调用的早期尝试。Web 服务已经从 RPC 模型发展而来。更健壮、功能丰富且流行的 JAX-WS API 有效地取代了 JAX-RPC。
To summarize, I would definitely not base a new project on JAX-RPC.
总而言之,我绝对不会基于 JAX-RPC 建立一个新项目。
回答by Premraj
- JAX-RPC 1.0:Which works on
java.rmi.Remote
interface concept. And usesRemoteException
i.e. all remote methods in a service endpoint interface (SEI) throw the standardjava.rmi.RemoteException
. JAX-RPC 2.0was renamed JAX-WS 2.0. - JAX-WS: uses Annotations
@WebService
,@SOAPBinding
,@WebMethod
,@WebParam
,@WebServiceClient
and so on. - Java:JAX-RPC uses Java 1.4. JAX-WS uses Java 5.0.
- SOAP:JAX-RPC and JAX-WS support SOAP 1.1. JAX-WS also supports SOAP 1.2.
- XML/HTTP: The WSDL 1.1 specification defined an HTTP binding, which is a means by which you can send XML messages over HTTP without SOAP.JAX-RPC ignored the HTTP binding. JAX-WS adds support for it.
- WS-I's(web services interoperability organization) Basic Profiles:JAX-RPC supports WS-I's Basic Profile (BP) version 1.0. JAX-WS supports BP 1.1.
- Data Mapping Model: JAX-RPC has its own data mapping model, JAX-WS's data mapping model is JAXB.
- JAX-RPC 1.0:适用于
java.rmi.Remote
接口概念。并使用RemoteException
即服务端点接口 (SEI) 中的所有远程方法抛出标准java.rmi.RemoteException
. JAX-RPC 2.0更名为JAX-WS 2.0。 - JAX-WS:使用注解
@WebService
,@SOAPBinding
,@WebMethod
,@WebParam
,@WebServiceClient
等。 - Java:JAX-RPC 使用 Java 1.4。JAX-WS 使用 Java 5.0。
- SOAP:JAX-RPC 和 JAX-WS 支持 SOAP 1.1。JAX-WS 还支持 SOAP 1.2。
- XML/HTTP:WSDL 1.1 规范定义了 HTTP 绑定,这是一种可以通过 HTTP 发送 XML 消息的方法,而 SOAP.JAX-RPC 忽略了 HTTP 绑定。JAX-WS 添加了对它的支持。
- WS-I(Web 服务互操作性组织)基本配置文件:JAX-RPC 支持 WS-I 的基本配置文件 (BP) 1.0 版。JAX-WS 支持 BP 1.1。
- 数据映射模型:JAX-RPC有自己的数据映射模型,JAX-WS的数据映射模型是JAXB。