Implementing the client library
The primary purpose of the client library is to simplify and eliminate code on the client. The client library is essentially a Java layer to help Java applications integrate with your service architecture, with no additional code generation required. The client library already has support for session and authentication and provides Java based clients a standardized mechanism to create the logical SDO objects to represent service requests.
About this task
- Interfaces of the service that is provided for each noun
- A file that contains constants that can be shared between client and server
- A client package that contains
- The abstract client Java class that contains common methods and methods required
- A programming friendly web enabled Java class that extends from the abstract class to implement the Java friendly and web enabled methods
- Noun-specific exceptions to represent client errors and server errors
This lesson of the tutorial demonstrates how to add convenience methods that hide the complexity of creating the different GetProject and ChangeProject requests.
Procedure
-
Import the provided ProjectFacadeConstants class:
- In the Enterprise Explorer view, expand .
- Right-click com.mycompany.commerce.project.facade. Click Import.
- Expand General select File System, then click Next.
- Browse to the temporary location where you extracted RecipeServices.zip.
- Browse to the com.mycompany.commerce.project.facade folder. Select the folder, then click Ok.
- Select ProjectFacadeConstants.java. Click Finish.
- Click Yes to overwrite the existing file.
-
Import the provided ProjectFacadeClient.java class that contains the Java
friendly client methods:
- Expand .
- Right-click com.mycompany.commerce.project.facade.client. Click Import.
- Expand General select File System, then click Next.
- Browse to the temporary location where you extracted RecipeServices.zip.
- Browse to the com.mycompany.commerce.project.facade.client folder. Select the folder, then click Ok.
- Select ProjectFacadeClient.java. Click Finish.
- Click Yes to overwrite the existing file.
-
Organize the imports for the Project-Client project:
- Open the Java perspective in HCL Commerce Developer.
- Expand Project-Client.
- Right-click the src folder; select .