Update: Use Payara Server rather than GlassFish, info in Section 1
Update: Apache Tomcat, SSL, Authorization and Authentication in Section 9
Update: MySQL DB and Apache Tomcat in Section 10
Update: JavaFX to REST Example in Section 11
This course walks the student through general web service concepts, then focuses on RESTful web services. We will write both a service and clients, process JSON and XML, and test using cURL.
This course covers the following topics:
The application server initially used is GlassFish since GF is the reference implementation for Java EE. Section 8 covers the above topics using Apache Tomcat and CXF as the application server.
The environment used for this course includes:
Show where 'web services' and REST fit into Java EE.
Cover web service and REST concepts.
Download the JAX-RS and JSONP libraries and add them to 'user libraries' in Eclipse.
Setup a REST client template.
NOTE: When setting up a project, be sure to add all the jar files that come in the JAX-RS zip file. Currently, the zip file has three directories. Go into each directory and add the jars.
Call an exchange rate service.
Parse the JSON returned from the exchange rate service.
Decide what the URLs and data formats will be.
Annotate and deploy the service.
Setup cURL and deploy the project.
Test the REST service by sending get/put/post/delete commands using cURL. Send/receive data as XML or JSON.
Write a client and JUnit tests:
00:10 - Start
03:59 - Write the Constructor
06:29 - 'getAll' Method
08:26 - 'get' Method
10:51 - 'post' Method
14:08 - 'put' Method
16:36 - 'delete' Method
Summary of main topics.
00:25 - GlassFish Admin Console
01:43 - GlassFish Security Realms
04:28 - glassfish-web.xml
07:02 - web.xml
10:10 - ApplicationConfig class
12:25 - FoodRestService class
I have 25+ years experience in software development. Seven years with embedded systems and 18 years in the object oriented industry. Companies include banking, finance, telecom, and a product vendor. Jobs ranged from gathering requirements and turning them into working software, to mentoring others learning OO programming and design. I currently reside in the southeast United States near Research Triangle Park, NC.