diff --git a/miniloan-server/src/main/java/com/ibm/odm/samples/RESTJSONJavaClient.java b/miniloan-server/src/main/java/com/ibm/odm/samples/RESTJSONJavaClient.java index 5b28415..9f4e212 100644 --- a/miniloan-server/src/main/java/com/ibm/odm/samples/RESTJSONJavaClient.java +++ b/miniloan-server/src/main/java/com/ibm/odm/samples/RESTJSONJavaClient.java @@ -28,8 +28,10 @@ import org.apache.http.client.methods.HttpPost; import org.apache.http.entity.StringEntity; import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.conn.ssl.SSLConnectionSocketFactory; import org.apache.http.impl.client.HttpClients; import org.apache.http.util.EntityUtils; +import org.apache.http.ssl.SSLContexts; public class RESTJSONJavaClient { @@ -40,7 +42,13 @@ public class RESTJSONJavaClient { * @throws Exception */ public static synchronized CloseableHttpClient getClient() throws Exception { - CloseableHttpClient client = HttpClients.createDefault(); + SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory( + SSLContexts.createDefault(), + new String[] { "TLSv1.2" }, + null, + SSLConnectionSocketFactory.getDefaultHostnameVerifier()); + + CloseableHttpClient client = HttpClients.custom().setSSLSocketFactory(sslsf).build(); return client; } diff --git a/miniloan-server/src/main/java/com/ibm/odm/samples/Validate.java b/miniloan-server/src/main/java/com/ibm/odm/samples/Validate.java index a09118e..05f8451 100644 --- a/miniloan-server/src/main/java/com/ibm/odm/samples/Validate.java +++ b/miniloan-server/src/main/java/com/ibm/odm/samples/Validate.java @@ -102,9 +102,7 @@ public String validate(JsonObject json) { String result = ""; String server = json.getString("server"); String ruleset = json.getString("ruleset"); - String instanceType = json.getString("instanceType"); - String url = "https://" + server +"/odm/" + - instanceType + "/DecisionService/rest/v1/" + ruleset; + String url = server + "/rest/v1/" + ruleset; boolean showTrace = (boolean) json.getBoolean("showTrace"); result = validateWithJRules(loan, borrower, url, json, showTrace); System.out.println(result); diff --git a/miniloan-server/src/main/webapp/index.html b/miniloan-server/src/main/webapp/index.html index f048582..c8c2582 100644 --- a/miniloan-server/src/main/webapp/index.html +++ b/miniloan-server/src/main/webapp/index.html @@ -68,10 +68,10 @@
-

ODM on cloud Sample

+

ODM SaaS Sample

Loan request approval application


-

Calls the ODM on cloud execution server to run a decision to approve or not a loan request.

+

Run a decision to approve or not a loan request through ODM on Cloud or CP4BA aaS Decision Service.

@@ -169,52 +169,49 @@

Loan

-
+
-

Rule Execution Server information

+

Decision Service information

-
-
-
- Tenant URL -
- -
-
-
- User name -
- -
-
- -
-
-
- Ruleset -
- -
-
-
- Password -
- -
- -
Dev - - -
- -
+
+
+
+
+ Decision Service URL +
+ +
+
+
+
+
+ User name +
+ +
+
+
+ Password +
+ +
+
+
+ Ruleset +
+ +
+
+ +
+
+
@@ -228,13 +225,11 @@

Rule Execution Server information

-
-
-
Response
-
nothing for now...
-
-
+
+
Response
+
nothing for now...
+
- + \ No newline at end of file diff --git a/miniloan-server/src/main/webapp/js/main.js b/miniloan-server/src/main/webapp/js/main.js index 7f54cc1..21cfd3c 100644 --- a/miniloan-server/src/main/webapp/js/main.js +++ b/miniloan-server/src/main/webapp/js/main.js @@ -42,7 +42,6 @@ $(document).ready( 'ruleset' : $('input[name=ruleset]').val(), 'user' : $('input[name=user]').val(), 'password' : $('input[name=password]').val(), - 'instanceType' : $('input[name=instanceType]:checked', '#instanceChoice').val(), 'yearly-income' : parseInt($('input[name=yearly-income]').val()), 'credit-score' : parseInt($('input[name=credit-score]').val()), 'amount' : parseInt($('input[name=amount]').val()),