JAX-WS vs. JAX-RPC

随声附和 提交于 2019-11-26 16:34:17

问题


I wrote 2 webservices, one with Jax-WS and one with Jax-RPC. They just return a String.

I stress-tested both with jMeter and, strangely, thereby Jax-RPC was a bit faster.

When do I really profit of Jax-WS in aspects of performance (response time, CPU-time, heap)? How can I proof it?

thanks for your time! =)


回答1:


  1. You didn't mention anything about the implementations you're using so it's hard to say anything about them :)

  2. I don't know if your benchmark is representative of anything, I'm not sure it allows to make any valid conclusion.

  3. JAX-WS is supposed to perform better in general than JAX-RPC, see the already mentioned article.

  4. 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.

To summarize, I would definitely not base a new project on JAX-RPC.




回答2:


  • JAX-RPC 1.0: Which works on java.rmi.Remote interface concept. And uses RemoteException i.e. all remote methods in a service endpoint interface (SEI) throw the standard java.rmi.RemoteException. JAX-RPC 2.0 was 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.


来源:https://stackoverflow.com/questions/3307516/jax-ws-vs-jax-rpc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!