Monday 14 July 2014

REST vs SOAP o en Java JAX-WS vs JAX-RS

RESTful services (Mostly web integration, mobile phone apps)
  • Integration over web will be easy with the REST. Popularly used with the AJAX calls.
  • Not verbose as SOAP services so need less bandwidth hence good to use for the mobile apps.
  • Web services are completely stateless so only for stateless services.
JAX-WS and JAX-RPC are SOAP based services. (Enterprise web services)
JAX-WS Java EE later versions support this and standards still evolving. - SOAP based services not preferred for mobile app communication because of heavy payload compare to rest. - More suitable for the enterprise web services where you need interoperability, transactions, message delivery and reliability.
REF: http://stackoverflow.com/questions/10311381/practical-usecase-based-difference-between-jax-rpc-vs-jax-ws-vs-jax-rs-web-servi


  • JAX-WS: addresses advanced QoS requirements commonly occurring in enterprise computing. When compared to JAX-RS, JAX-WS makes it easier to support the WS-* set of protocols, which provide standards for security and reliability, among other things, and interoperate with other WS-* conforming clients and servers.
  • JAX-RS: makes it easier to write web applications that apply some or all of the constraints of the REST style to induce desirable properties in the application, such as loose coupling (evolving the server is easier without breaking existing clients), scalability (start small and grow), and architectural simplicity (use off-the-shelf components, such as proxies or HTTP routers). You would choose to use JAX-RS for your web application because it is easier for many types of clients to consume RESTful web services while enabling the server side to evolve and scale. Clients can choose to consume some or all aspects of the service and mash it up with other web-based services.
REF: http://docs.oracle.com/javaee/6/tutorial/doc/gjbji.html


REST is a style not a standard
You might think of architectural style for software as being one step of abstraction above design patterns. However, according to Fielding, a collection of design patterns is not the same as an architectural style because patterns are too close to particular problems.
Since REST is a style for hypertext systems rather than Web services, the title "REST versus SOAP" is somewhat misleading. However, many software designers contemplating creating a Web service have come to the conclusion that SOAP is overly complicated and a simpler REST-like design is preferable.........
Commercial use of REST
Many of the Web's commercial enterprises have become aware of the interest in REST in recent years. The Google Data API (currently still in beta) provides a simple protocol specifically using REST principles. HTTP GET requests to the service result in XML formatted data in either the Atom or RSS syndication format. Google is also working on a publishing protocol using Atom and the POST, PUT and DELETE operations. The eBay service provides for accessing services using a variety of language tools, including document/literal style SOAP and REST style.
Can the REST style ever be a complete replacement for the RPC style of XML-RPC and SOAP? I certainly don't think so and in the next article I will try to suggest the areas where SOAP reigns supreme.
REF:http://things-of-the-day.blogspot.in/2014/02/rest-vs-soap-o-en-java-jax-ws-vs-jax-rs.html

No comments:

Post a Comment