The JAX-RS client API is built on top of the HTTP protocol. It consumes all web services that are built on the HTTP protocol. Apart from this client API, there are other APIs, such as HTTPURLConnection and Apache HTTP Library, to consume web services. However, this API is harder to code and time-consuming for complex web services. So, the JAX-RS client API is wrapped in such a way that developers can find it easy to code and reuse wrapper classes as much as they can.
In the Web Service Flow figure,
Client is the base to initiate the connection. We can get the client instance using the entry point, that is, the ClientBuider
method. ClientBuilder provides a new instance every time. So, if necessary, we can create different instances for different URIs.
Once we obtain the client instance, optionally, we can set properties or register filters. Filters can help in manipulating custom objects...