Deploying CT-V Java Web Services (REST/SOAP) on Wildfly
Deploying CT-V REST APIs on WildFly includes the following steps:
Access the modules directory of WildFly (
<wildfly_home>/modules).Create a directory named main in
<wildfly_home>/modules/com/CTV/tmproject. Directories com, CTV, andtmprojectare to be created in the order as mentioned in the path<wildfly_home>/modules/com/CTV/tmproject.Note
If Java runtime environment version is 8 or above, then copy the
mysql-connectorjava-5.1.48.jarfile from the/SafeNetTokenization/Tokenization/lib/ext directoryto the<wildfly_home>/modules/com/CTV/tmproject/maindirectory.For MySQL 8.0, the Java runtime environment version must be 8 or above.
Copy the following jar files to the
<wildfly_home>/modules/com/CTV/tmproject/maindirectory.Select the following jar files from the
SafeNetTokenization/Tokenization/lib/extdirectory:bson-2.5.1.jarjdbc-4.10.6.20151104.jarmysql-connector-java-5.1.42-bin.jar or mysql-connector-java-5.1.48.jarojdbc7.jarc3p0-0.9.5.4.jarjtds- 1.2.8.jarmchange-commons-java-0.2.11.jarSafeNetTokenService-8.12.3.000.jarSafeNetTVM.jarsqljdbc41.jarTVMInformix.jarTVMMySQL.jarTVMOracle.jarTVMSQLServer.jar
Select the following jar files from the
SafeNetTokenization/IngrianJCE/lib/extdirectory:*
commons-lang3-3.1.jarcommons-collections4-4.1.jargson-2.1.jarIngrianlog4j- api-2.10.0.jarIngrianlog4j-core-2.10.0.jarIngrianNAE-8.12.3.000.jar
Create an XML file named
module.xmlin the<wildfly_home>/modules/com/CTV/tmprojectdirectory, and copy the following content into themodule.xmlfile:<?xml version="1.0" encoding="UTF-8"?> <module xmlns="urn:jboss:module:1.1" name="com.CTV.tmproject"> <dependencies> <module name="javaee.api"/> </dependencies> <resources> <resource-root path="SafeNetTokenService-8.12.3.000.jar"/> <resource-root path="SafeNetTVM.jar"/> <resource-root path="gson-2.1.jar"/> <resource-root path="commons-lang3-3.1.jar"/> <resource-root path="commons-collections4-4.1.jar"/> <resource-root path="Ingrianlog4j-api-2.10.0.jar"/> --> <resource-root path="Ingrianlog4j-core-2.10.0.jar"/> <resource-root path="IngrianNAE-8.12.38.10.1.000.jar"/> <resource-root path="c3p0-0.9.5.4.jar "/> <resource-root path="jtds-1.2.8.jar"/> <resource-root path="mchange-commons-java-0.2.11.jar"/> <resource-root path="sqljdbc41.jar"/> <!-- <resource-root path="TVMOracle.jar"/> --> <!-- Uncomment this if using Oracle database --> <!-- <resource-root path="ojdbc7.jar "/> --> <!-- Uncomment this if using Oracle database --> <!-- <resource-root path="TVMSQLServer.jar"/> --> <!-- Uncomment this if using SQL Server database --> <!-- <resource-root path="TVMMySQL.jar"/> --> <!-- Uncomment this if using MySQL database --> <!-- <resource-root path="mysql-connector-java-5.1.42-bin.jar"/> --> <!-- Uncomment this if using MySQL database and runtime Java version is 7--> <!-- <resource-root path="mysql-connector-java-5.1.48.jar"/> --><!-- Uncomment this if using MySQL database and runtime Java version is 8 or above <!-- <resource-root path="TVMInformix.jar"/> --> <!-- Uncomment this if using Informix database --> <!-- <resource-root path="jdbc-4.10.6.20151104.jar"/> --> <!-- Uncomment this if using Informix database --> <!-- <resource-root path="bson-2.5.1.jar"/> --> <!-- Uncomment this if using Informix database --> </resources>Add the following content into the
standalone.xmlfile.<global-modules> <module name="com.CTV.tmproject" slot="main"/> </global-modules>Note
Ensure to uncomment the resource-root path for the database being used.
Create a directory where WildFly will be deployed. For example,
CT-Vconfiguration(c:/CT-Vconfiguration).Copy the following properties files to the CT-Vconfiguration directory:
SafeNetToken.propertiesandSfntDbp.propertiesfromSafeNetTokenization/Tokenization/lib/ext.IngrianNAE.propertiesfromSafeNetTokenization/IngrianJCE/lib/ext.
Update HostName, PortNumber, DatabaseName, and DatabaseType parameters in
SafeNetToken.propertiesfile.Update NAE_IP.1, NAE_Port, and Log_File parameters in
IngrianNAE.propertiesfile.Edit the
<wildfly_home>/bin/standalone.batfile and set the JAVA_OPTS variable for the properties files copied to the CT-Vconfiguration directory as shown here.set JAVA_OPTS=%JAVA_OPTS% -Dcom.safenet.SafeNetToken_Properties_Conf_Filename="c:/CT-Vconfiguration/SafeNetToken.properties" -Dcom.safenet.SfntDbp_Properties_Conf_Filename="c:/CTVconfiguration/SfntDbp.properties" - Dcom.ingrian.security.nae.IngrianNAE_Properties_Conf_Filename="c:/CT-Vconfiguration/IngrianNAE.properties"Restart the WildFly server.
Deploy the
SafeNetTokenization/Tokenization/restfulService/tmrest.warfile on the WildFly server.
Deploying SOAP APIs on WildFly
Deploying CT-V SOAP APIs on WildFly includes the following steps:
Follow the Steps 1 through 10 as described in the section for the REST APIs.
Download axis2 version 1.7.8 binary distribution and extract axis2-1.7.8-war.zip to a directory referred as <axis_home>.
Extract <axis_home>/axis2.war file using the following command:
jar -xvf axis2.warDelete the <axis_home>/axis2.war file.
Create SafeNetTokenizer/lib directory in the <axis_home>/WEB-INF/services directory.
Copy the SafeNetTokenizer.class file from SafeNetTokenization/Tokenization/lib/ext to the <axis_home>WEB-INF/services/SafeNetTokenizer/lib directory.
In the <axis_home> directory create the axis2.war file by running the following command:
jar -cvf axis2.war *Deploy the <axis_home>/axis2.war file on the WildFly server.