Reference no: EM132246260
Java EE Programming Assignment - RESTful Service and Client with JSON
Overview - In Assignment, you create a RESTful service to perform CRUD operations on a data structure that stores information about customers. Think of the information as a dataset that may be accessed by many applications used by different departments in a company or even outside of the company. In addition to the service, you create a client program. In this assignment, you build and test the service and one client on the same workstation. In production mode, the service would be deployed to a server so many different clients running on different computers can use it. The client program that you create for this assignment is designed to test that the service works.
Your service makes the functionality of the CustomerManager class available to remote clients. Your client program issues the HTTP requests to the service and interprets the returned results. URIs identify the resource (the customer of interest) and the HTTP verb specifies whether the customer is to be Created, Retrieved, Updated or Deleted. Customer information is passed between the client and the service in JSON notation. The client program runs in Java SE.
To submit your solution, upload two files:
- A WAR for the server side because RESTful services are deployed in Web applications.
- A JAR file for the client side because the client runs as an ordinary Java SE program.
Instructions -
1. In this document, when you see a project name that starts Your Name or a package name that starts your.name, substitute your group name. This naming convention identifies your code for marking.
2. Open Eclipse to a new workspace and work in the Java EE perspective.
3. If in a new workspace (always recommended) create a new instance of the Wildfly server and start the server.
4. Create a New Dynamic Web Project for Service.
5. Create a New Java Project for Client.
6. Add the JARs that provide the RESTEasy API to the classpath of the client.
7. Create a class to implement your service. It will have a method for each operation.
8. Add a getCustomer() method to your service class. This method receives an account no as a String argument. The return type must be JsonObject.
9. Add a getAllCustomers() method. It has no argument.
10. When both get operations work from a browser, start to code the client.
11. Create two classes your client class.
12. Add the method to get a customer to your client class.
13. Test by running the Tester class as a Java application.
14. Make a helper class that has methods to convert between Customer objects from JSON notation.
15. Continue by adding methods addCustomer(), updateCustomer () and deleteCustomer () to your service class and your client class.
16. Save and close all source files and then test again.
17. Submit your solution.
18. Shut down properly (always).
Attachment:- Assignment File.rar