SOAP and RESTful - Best Books to Learn Web Service in Java

If you are a Java developer and want to learn how to develop Web Services in Java, both SOAP and RESTful, but confused on where to start, then you have come to the right place. In this article, I am going to share some of the best books to learn about both SOAP and RESTful web services in Java. If you are not familiar with Web Services, it's way to expose the services provided by your application to other developers and application. For example, if your system provides weather information then the user can go and check whether manually by looking at the Web GUI built using HTML, CSS, and JavaScript, but by exposing the same information using Web services, you allow a programmer to display as they want.   A programmer can invoke your web service from a smartphone application and show weather related information in a weather app. The web service really makes your services more accessible and opens a new way to show the information to different users.

There are two kinds of Web Services popular in the programming world, the SOAP web services and the RESTful Web Service. Former is the old but reliable way to exchange message and provides a lot of features e.g. asynchronous processing and stateful transaction, while REST is a relatively newer way to build Web service which makes use of HTTP protocol to expose Web Services.

Java provides support to develop both SOAP and RESTful Web services. It has both standard and several libraries and framework which makes your task of developing web services really easy e.g. you can use JAX-WS to develop SOAP based Web Services and JAX-RS to develop RESTful Web Services.

There are also several open source implementation exists e.g. Apache Axis is a good library for developing SOAP based web services and Restlet, RESTEasy, Jersey, and Spring framework are good for developing RESTful web Services.




Best Books to learn Web Services in Java

I have always found books and personal coaching the best way to learn anything new in past. When it comes to self-study, I mostly rely on good books. Why I prefer books than documentation or blog post? Well, even though documentation is most up-to-date and comprehensive resource they are not for beginners. they are reference material, so they are the best to use as reference i.e. you refer them once you have some knowledge.

Similarly, blog post is good to learn a particular topic but they are not comprehensive enough to teach you most of the things you need to use that knowledge in real world projects, hence I use blog post when I want to learn more about a particular topic e.g. if you are familiar with PUT and POST method but confused about when to use PUT or POST, you can search and read more about it in an article especially focused on that.

Books provide best of both worlds. They contain all the useful information in a structured fashion so that you can learn them in the order, starting from fundamentals and going to advanced knowledge. They are also most complete and just comprehensive enough to give you some sort of platform where you can use reference documentation and blog posts to learn more about it.


So, without wasting any more time, let's see some of the best books to learn web services in Java.


1) Java Web Services: Up and Running by Martin Kalin 
This should be the first book you read to get a hand of what are soap and rest web services, what can you do with them and how to implement them with JAX-WS and JAX-RS. If you are completely new to this topic I recommend writing some of the code examples the book gives, and if you already have some knowledge you can just go through the book skipping the parts that you consider you already know well enough.

The second edition provides you more RESTful context than the first version as REST has come a long way in the recent year to become the first choice web service technology. This is also a good book to prepare for Oracle certified Java expert for Web services (OCEJWSD) certification, exam code 1Z0-897.

Best book to learn Java Web Service




2) RESTful Java with JAX-RS 2.0 by Bill Burke 
If you have some knowledge of Java and OOP and you wants to learn how to developer REST based clients and servers then this is the right book for you. It covers JAX-RS 2.0 specification from Java EE 7 and focused on implementation rather than theory. You will learn how REST and JAX-RS work together and when to use them. It uses JBoss' RESTEasy framework to demonstrate JAX-RS 2.0 features with several hands-on examples.

It also teaches you little bit advanced concept like securing REST and popular mechanisms to perform authentication on the Web, including client-side SSL and OAuth 2.0 and HTTP Content Negotiation, caching etc. It's actually a complete guide to developing REST web services using Java platform, particularly JAX-RS 2.0, useful for both beginners and experienced

Best book to learn RESTful Web Service in Java




3) RESTful Web Services by Leonard Richardson 
This is actually the best book on RESTful Web Services, collectively authored by Leonard Richardson and Sam Ruby. Unlike the previous book which is a guide to implementing REST web services in Java using JAX-RS 2.0, this is the guide for RESTful web services itself. Even David Heinemeier Hansson, creator of the Rails framework, who has also forward this book has said that "Every developer working with the Web needs to read this book." and I couldn't agree more.

You will learn every single detail about web services and that too from the web perspective. You will learn what is URI, how HTTP can be used as application level protocol and not just a transport protocol to transfer data between client and server.

Java RESTful Web Services book for experienced

You will also learn Resource oriented architecture and most importantly how a RESTFul design is simpler, more versatile and more scalable than an RPC based web service design. In short, a great book to learn everything about REST web services from a web developer perspective.


4) Spring REST
This book explains all details of developing RESTful web services using Spring Framework. For example, Spring provides RestTemplate to simply consumption of RESTful web services. You can connect to a REST service using this class and process response in JSON, XML, and TEXT format. Spring framework is full of such helpful classes and utilities.

Best book to learn RESTful Web Services using Spring framework



That's all in this list of great books to learn web services in Java. It includes books on both SOAP and RESTful web services. The knowledge of SOAP and REST web services will give you a big plus in your resume because not many developers know how web services actually work or how to apply best practices, be it SOAP or REST. Since current trend is towards RESTful web service, learning a little bit more about REST is even more beneficial.

Further Learning
REST Fundamentals By Howard Dierking
RESTFul Services in Java using Jersey
REST with Spring

2 comments:

  1. any good books for developing j2ee projects for learning purporse and to understand the concepts

    ReplyDelete
    Replies
    1. Hello Ankit, J2EE comprises many technologies e.g. Servlet, JSP, EJB, JMS, JDBC, JNDI etc. There is not a single book to cover everything but if you want to start learning concepts you can start from Servlet and JSP e.g. Head First Servlet and JSP and a couple of other books which I have suggested here

      Delete