From the course: Java EE 7: Web Services

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Retrieve data via an endpoint

Retrieve data via an endpoint - Java EE Tutorial

From the course: Java EE 7: Web Services

Start my 1-month free trial

Retrieve data via an endpoint

- Let's see retrieving data using a Soap-based web service in action. I've opened the project in IntelliJ and I've navigated to the interface file for the application service. So notice here on line 15 we have our getAll method, and now let's look at its implementation. So click on ApplicationService.java, and let's scroll down to line 45. So here we have our getAll method. On line 46 I'm creating an empty ArrayList. The next few statements are enclosed in a try-catch block to handle exceptions. And now on line 49, I'm getting a Database connection and creating a statement, and on line 50, I'm executing a simple query, select * from tza_application, to retrieve all the applications. Now on lines 52 through 55, I'm looping through the results, creating new applications and then storing those in the ArrayList. And then down on line 60 I'm returning the list of applications. So let's test this code out by going to ApplicationClient.java. So this is the application client file we've used…

Contents