Jersey is the reference implementation of JAX-RS and is the implementation that you will find in both WebLogic Server and GlassFish. Lets take a look at the programming model.First, if you stick with the best practices and the standard approach to REST you will create ‘services’ out of ‘resources’. At runtime, you will be able to generate a WADL which specifies the URIs and supported HTTP methods/verbs (GET, PUT, POST, DELETE) and you can use this to create client-side applications. The JAX-RS specification only provides details for server-side APIs but if you use Jersey then you can take advantage of the classes that it offers to consume REST services.Just like SOAP, the container will take care of mapping your data representation, whether it is in XML or JSON, to your Java POJOs. In addition, JAX-RS takes care of HTTP handshaking and allows you to perform content negotiation at runtime. Also, JAX-RS supports HTTP communication ONLY. There are no other transports supported.
Evolution over XML-RPCAllowed you to get around firewalls with HTTPSimply put, a format for sending messages
Both SOAP and REST have their rightful place within enterprise and consumer applications, and there is no reason they can’t co-exist and support the same enterprise application. REST is ideally suited for exposing data over the internet (or networks in general) and has low bandwidth and CPU requirements. It’s also good for creating mashups of different content from various providers on a web page.However, if you look at the enterprise requirements for messaging, you may find that SOAP is a better fit because it offers enterprise features like High Reliability with WS-RM
WebLogic Developer Webcast 4: RESTful Services with JAX-RS, JQuery and JSF 2.0
SOAP – Simple Object Access Protocol<br />Exposes OPERATIONS that implement/represent LOGIC<br />Provides loose coupling for integrating diverse systems<br />Designed for distributed computing<br />Designed to be extensible – WS-*<br />Standard error messaging – SOAP faults with standard Code/Subcode for error types<br />Aligns with Enterprise Application needs and goals<br />Supports other transport protocols than HTTP – SMTP, JMS<br />Supports enterprise security with WS-Security<br />Supports language neutrality<br />Supports ACID, Atomic transactions with WS-AT<br />Supports Reliable Messaging with WS-RM<br />Easy governance with strong typing<br />Broad Development Tools support <br />
REST vs. SOAP<br />REST<br />Exposes RESOURCES which represent DATA<br />Uses HTTP Verbs (GET/POST/DELETE)<br />Emphasis on simple point-to-point communication over HTTP<br />Supports multiple data formats<br />Emphasizes stateless communication<br />SOAP<br />Exposes OPERATIONS which represent LOGIC<br />Uses HTTP POST<br />Emphasis on loosely coupled distributed messaging<br />Supports only XML (and attachments)<br />Supports stateless and stateful/conversational operations<br />Supports asynchronous messaging<br />Strong Typing<br />
SOAP is better than REST!<br />Building a client for REST can be challenging<br />I can easily generate client-side artifacts from a WSDL<br />I don’t want to write raw HTTP calls<br />I don’t want to look at the HTTP response code for success/failure – I want to use my own exception types and codes<br />Many IDE’s support SOAP development – both client and server<br />REST only supports HTTP/HTTPS<br />HTTP is synchronous and in order to scale I need to be able to have asynchronous messaging<br />REST is not secure<br />Parameters as part of the URI<br />No support for acquiring tokens<br />RESTful services have no contract<br />I have a WADL that specifies URL’s but what about schemas for object definition<br />REST is not reliable<br />I have to handle failures with retries – no Reliable Messaging<br />REST can’t be governed<br />How do I know who is consuming my services without a Service Registry?<br />How do I discover RESTful services?<br />
Both SOAP and REST have their rightful places<br />REST<br />Good for:<br />Web Services<br />Limited bandwidth (smaller message size)<br />Limited resources (no xml parsing required) <br />Exposing data over the Internet<br />Combining content from many different sources in a web browser<br />SOAP<br />Good for:<br />Enterprise services<br />High Reliability with WS-RM<br />Transactions with WS-AT<br />Security with WS-Security<br />Asynchronous processing<br />Contract-first development<br />Stateful /conversational operations<br />Standards support, interoperability with business applications<br />Tooling Support<br />
PrimeFaces – www.primefaces.org<br />“PrimeFaces is a lightweight open source component suite for Java Server Faces 2.0 featuring 100+ rich set of JSF components”<br />Easy to use, good looking components<br />Multiple themes<br />
A particular slide catching your eye?
Clipping is a handy way to collect important slides you want to go back to later.