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 - Java EE Tutorial
From the course: Java EE 7: Web Services
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
(Locked)
Understand SOAP services1m 29s
-
(Locked)
Create a JAX-WS endpoint4m 55s
-
(Locked)
Implement SOAP clients in Java4m 8s
-
(Locked)
Retrieve data via an endpoint3m 25s
-
(Locked)
Create data via an endpoint2m 24s
-
(Locked)
Update data via an endpoint2m 6s
-
(Locked)
Delete data via an endpoint2m
-
(Locked)
Map to entities with JAXB3m 50s
-
(Locked)
-
-
-