Oracle® Retail Integration Bus Service-Oriented Architecture Enabler Tool Guide Release 15.0.1 E74930-01 |
|
![]() Previous |
![]() Next |
This chapter provides a set of implementation notes that may be helpful when implementing the Oracle Retail Service-Oriented Architecture Enabler (RSE) tool. The information included here is intended to provide guidance on the following topics:
PL/SQL Provider Service
Java EE Service Provider
Deploying the Web service
Creating a JDBC Data Source
The implementation notes in this chapter are intended to provide some guidance in the development and deployment of the Web service layer. This information does not take into account the implementation of the business logic required to complete the application API layer.
The RSE tool and approaches described in this section are complex. A high level of skill and knowledge of the product is required to complete these implementation tasks. Also required is technology specific development of application APIs and the business logic that is needed to complete it.
Any issues that may arise with development tools, development environments, custom APIs, or custom message flows are the responsibility of the customer and not Oracle Retail.
The distribution (.zip) file includes a .ear file that contains all the generated code for the service; it is ready to be deployed to the application server. The business logic can be implemented in PL/SQL packages in Oracle. The distribution contains the specification and body scripts for the packages called by the deployed service.
To complete implementation, follow these steps:
Create the PL/SQL service provider distribution file using the RSE tool. The output of this process is the .zip file.
Extract the <service_name>ProviderImplSpec.sql and <service_name>ProviderImplBody.sql files from the distribution zip file.
These files are modified to provide a PL/SQL implementation for the service.
Extract the <appname>-service.ear file from the distribution zip file. This file is the generated Web service that is deployed.
Create the JDBC data source.
If not already deployed, deploy the Oracle Objects to the appropriate database user.
Note: See the Oracle Retail Functional Artifact Generator Guide. |
Modify the PL/SQL body file for the business logic implementation. The <service_name>ProviderImplBody.sql file contains comments about where to implement logic for each method on the service.
Install the modified PL/SQL packages to the database. They are called by the Web service methods.
Deploy the <appname>-rest-service.ear file to the WebLogic Application Server.
The RSE tool creates the appropriate provider restful resources as well as a skeleton implementation layer where the developer implements business logic. All of this is packaged inside the provider distribution archive file.
The Java EE Provider distribution file provides a sample deployable application and all the libraries that can be used to create Web services using retail payloads. The distribution file follows the naming convention of <appname>_JavaEEServiceProvider.zip. For example, the distribution file for the RMS application is named rms_JavaEEServiceProvider.zip. The <rms> prefix must be replaced with the name of any other application being developed.
The Web services generated by the RSE tool can be implemented and deployed in a number of ways. This section includes three implementation use cases for reference.
Generate the distribution file using the RSE tool.
Extract the <appname>-service-ejb-impl-src.jar file from the zip file.
Extract the <appname>-rest-service.ear file from the zip file.
Add business logic code where indicated in the Impl java files.
Use the java jar command to re-build the <appname>-service-ejb-impl.jar file.
Use the jar command to update .ear file with the new implementation jar.
Deploy the .ear file to the server.
Create custom java classes that implement the <service_name>ServiceProvider interfaces contained in the <appname>-service-provider.jar file.
Extract the ServiceProviderImplLookupFactory.properties file from the .ear file.
Modify the properties file to point to your implementation classes for the services.
Use the jar command to create a jar containing your implementation classes, as well as the modified properties file.
Run the RSE tool again and provide the new custom implementation jar file.
Extract and deploy the generated .ear file to the server.
Generate the distribution file using the RSE tool.
The service interfaces are provided in the <appname>-service-provider.jar file in the distribution file. This jar file should be included in the application classpath.
Source code of sample implementations for the service interfaces are provided in the <appname>-service-ejb-impl-src.jar file in the distribution file. (If application developers want to use the same classes in their application, they can extract the java files from the jar file and include those in application source code. They also can add their own business logic in the method implementations. If they decide to write their own implementations, they should make sure that the appropriate service interfaces are implemented.)
After writing the Web service implementations, the java files should be compiled. The class files can be included in a new jar file or in the same jar file used for the rest of the classes of the application.
Modify the ServiceProviderImplLookupFactory.properties file to include appropriate class names of service implementations and include it in application classpath. A recommended approach is to include the properties file in the jar file that contains the service implementation classes.
Make sure that the following jar files are included in the application ear file:
<appname>-service-provider.jar
Jar file containing the service implementation classes
jersey-client.jar
retail-public-payload-java-beans-base-<version>.jar
retail-public-payload-java-beans-<version>.jar
retail-soa-enabler-<version>.jar
Include web-module in the application.xml of the application. The module name should be same as the name of <appname>-rest-service.war file.
The .ear file is ready for deployment on the server.
Below are the steps for installing the <service-name>.ear on WebLogic:
Create managed server on Weblogic for REST deployment.
Access the admin console at URL: http://<host>:4848/
Make sure that the managed server is up and running.
Create datasource as listed in the section
After creating data source, navigate to Deployments Page.
Click "Lock and Edit" located on the right side pane.
Click Install. Browse the <appname>-rest-service.ear file to deploy and click
OK.
Use managed server created above to deploy.The deployed application is listed under Deployments and should be in Active State.
The URL to test a web service is like this: http://<host>:8080/rms-rest-service/SupplierResource/4/5.
In the above example, "rms-rest-service" is the context of web application in ear file, SupplierResource is the name of service, and the numbers are values supplied for path parameters for the web service.
The above URL makes a call to the GET method of the web service.
For testing all other operations you can install SOAP-UI. And provide the URL of the WADL to create test cases. A sample URL of the WADL is http://<host>:8080/rms-rest-service/application.wadl
It will show all the operations that are available for a web service. You can enter request xml and execute the web service method.
To create a JDBC Data Source in WebLogic Server, follow these steps:
Select Data Sources from Home Page.
Click Lock & Edit located in the right pane.
Click New and select Generic Data Source from pop down.
Select Resource Type as javax.sql.DataSource.
Enter Name as, RetailWebServiceDs.
Enter JNDI Name as, jdbc/RetailWebServiceDs and Click Next.
Select Database Driver as, "Oracle's Driver(Thin) for Service connection; Versions:Any.
Click Next button. Uncheck the option for "Supports Global Transcations" and click Next.
In Connection Properties section, enter the following details:
DatabaseName: <sid>
Host Name: <host name>
Port: <port number>
password: <database password>
Confirm Password: <Same database password as above>
Click Next.
Click the Test Configuration button.
After Connection test succeeded, Click Next.
Select Managed server that is created for REST service deployment.
Click Finish.