In this section, we're going to take a look at the JAX-RS client APIs and how to implement web service clients. I'm going to show you how you can set up and configure a JAX-RS client instance. We'll use WebTarget and its builder to specify request behavior, resolve URI template parameters, do invocation in response handling, and use GenericType implementations to get unmarshalled typed collections:
So far, we've implemented our small library service, which supports books, authors, and loans, via a REST API. We'll then implement a library client which is a standalone client to get a list of books, unknown books, to create books, to get books with the returned URI, and so forth.
Let's switch to our IDE. We will create a small class called LibraryServiceClient, which is...