From fd18efe4b4d59b873c61c26cdc12eb64c73cd5a4 Mon Sep 17 00:00:00 2001 From: Keith Armstrong Date: Thu, 23 Jan 2025 07:28:11 -0500 Subject: [PATCH] Added more tags to the returned hashMap --- src/com/belkast/soap/soapProcessor.java | 10 ++++++---- src/com/belkast/soap/webService.java | 22 ++++++++++++---------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/src/com/belkast/soap/soapProcessor.java b/src/com/belkast/soap/soapProcessor.java index 5831ff1..98656e2 100644 --- a/src/com/belkast/soap/soapProcessor.java +++ b/src/com/belkast/soap/soapProcessor.java @@ -111,15 +111,17 @@ public class soapProcessor { thisMap.put("success", false); thisMap.put("sent", new String(document, StandardCharsets.UTF_8)); - thisMap.put("response", ex.toString()); - thisMap.put("code", exCode); + thisMap.put("response_code", exCode); + thisMap.put("response_data", ex.toString()); + thisMap.put("response_size", ex.toString().length()); return thisMap; } thisMap.put("success", true); thisMap.put("sent", new String(document, StandardCharsets.UTF_8)); - thisMap.put("response", response.toString()); - thisMap.put("code", thisCode); + thisMap.put("response_code", thisCode); + thisMap.put("response_data", response.toString()); + thisMap.put("response_size", response.toString().length()); return thisMap; } diff --git a/src/com/belkast/soap/webService.java b/src/com/belkast/soap/webService.java index ba2cc7b..8959dff 100644 --- a/src/com/belkast/soap/webService.java +++ b/src/com/belkast/soap/webService.java @@ -90,25 +90,25 @@ public class webService { while (iterator.hasNext()) { Map.Entry pair = iterator.next(); - debugProcessor.writer(varDebug, "!! [" + pair.getKey() + " of " + pair.getValue().get("csv_records") + " : " + pair.getValue().get("soap_response") + "] " + pair.getValue()); + debugProcessor.writer(varDebug, "!! [" + pair.getKey() + " of " + pair.getValue().get("csv_records") + " : " + pair.getValue().get("soap_response_code") + "] " + pair.getValue()); } System.out.println(); if (!thisFinal.get("total").equals(0)) { - debugProcessor.writer(true, "!! Connect User : " + thisFinal.get("user")); + debugProcessor.writer(true, "!! Connecting User : " + thisFinal.get("user")); } - debugProcessor.writer(true, "!! Total records : " + thisFinal.get("total")); - debugProcessor.writer(true, "!! Total passed : " + thisFinal.get("passed")); - debugProcessor.writer(true, "!! Total failed : " + thisFinal.get("failed")); + debugProcessor.writer(true, "!! Total records : " + thisFinal.get("total")); + debugProcessor.writer(true, "!! Records passed : " + thisFinal.get("passed")); + debugProcessor.writer(true, "!! Records failed : " + thisFinal.get("failed")); boolean thisResult = thisFinal.get("total") == thisFinal.get("passed"); - debugProcessor.writer(true, "!! WAS SUCCESSFUL : " + String.valueOf(thisResult).toUpperCase()); + debugProcessor.writer(true, "!! WAS SUCCESSFUL : " + String.valueOf(thisResult).toUpperCase()); if (!thisResult) { - debugProcessor.writer(true, "!! PLEASE CHECK THE DEBUG LOG"); + debugProcessor.writer(true, "!! OUTPUT LOG FILE : debug.log"); } } @@ -284,10 +284,10 @@ public class webService { debugProcessor.writer(varDebug, "[" + varCount + " of " + thisCSV.size() + "] : SOAP call sending data : " + varXML); Map response = soapProcessor.send(varConn, varXML.getBytes()); - debugProcessor.writer(true, "[" + varCount + " of " + thisCSV.size() + "] : SOAP call response code : " + response.get("code")); + debugProcessor.writer(true, "[" + varCount + " of " + thisCSV.size() + "] : SOAP call response code : " + response.get("response_code")); boolean varSuccess = Boolean.valueOf(response.get("success").toString()); - debugProcessor.writer(!varSuccess, "[" + varCount + " of " + thisCSV.size() + "] : SOAP call response data : " + response.get("response")); + debugProcessor.writer(!varSuccess, "[" + varCount + " of " + thisCSV.size() + "] : SOAP call response data : " + response.get("response_data")); if (!varSuccess) { @@ -299,7 +299,9 @@ public class webService { hashMap.put("csv_records", thisCSV.size()); hashMap.put("date", new Date()); hashMap.put("soap_auth", varAuthRequired); - hashMap.put("soap_response", response.get("code")); + hashMap.put("soap_response", response.get("response_data")); + hashMap.put("soap_response_code", response.get("response_code")); + hashMap.put("soap_response_size", response.get("response_size")); hashMap.put("soap_sent_size", varXML.length()); hashMap.put("soap_success", response.get("success")); hashMap.put("soap_user", (varUsername == null) ? "N/A" : varUsername);