Fix MNP_SM_2460 + Rimozione TIMAC
This commit is contained in:
@@ -4,7 +4,6 @@ import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import mnp.database.hb.dto.MnpGinoRetrieveOut;
|
||||
import mnp.database.hb.dto.MnpGispRetrieveOut;
|
||||
import mnp.database.hb.dto.MnpSdpRetrieveOut;
|
||||
import mnp.log.ProcessLogger;
|
||||
import mnp.proxy.ws.fetrcs.*;
|
||||
@@ -329,7 +328,7 @@ public class WSRestHandler extends GenericHandler {
|
||||
logWrite("9999", "retrieveESORestPost: INIZIO CHIAMATA SERVIZIO REST");
|
||||
String risposta = "";
|
||||
try {
|
||||
Header[] headers = setHeader("retriverGispXML");
|
||||
Header[] headers = setHeaderRetrieveESO("retriveESO");
|
||||
String url = Resources.getESO_RETRIEVE_REST_POST_URL();
|
||||
risposta = restPost(url,headers,requestSdpJson,log);
|
||||
logWrite("9999", "retrieveESORestPost: url chiamato: "+url);
|
||||
@@ -363,6 +362,32 @@ public class WSRestHandler extends GenericHandler {
|
||||
return headers;
|
||||
}
|
||||
|
||||
private Header[] setHeaderRetrieveESO(String restService) {
|
||||
Date now = new Date();
|
||||
TID tid = new TID();
|
||||
|
||||
// Authorization HTTP - Basic: recupero credenziali <USERNAME:PASSWORD> codificate in BASE64 dal file di resources.properties
|
||||
String encodedAuth = Resources.getESO_RETRIEVE_REST_POST_AUTHBASIC_BASE64();
|
||||
|
||||
// Headers
|
||||
Header[] headers = new BasicHeader[9];
|
||||
headers[0] = new BasicHeader("Content-Type", "application/json; charset=UTF-8");
|
||||
headers[1] = new BasicHeader("sourceSystem", system);
|
||||
headers[2] = new BasicHeader("channel", system);
|
||||
headers[3] = new BasicHeader("interactionDate-Date", DateUtils.toDcoString(now));
|
||||
headers[4] = new BasicHeader("interactionDate-Time", DateUtils.getHourMinSec(now) + ".000");
|
||||
headers[5] = new BasicHeader("sessionID", tid.toString());
|
||||
headers[6] = new BasicHeader("businessID", tid.toString());
|
||||
headers[7] = new BasicHeader("transactionID", tid.toString());
|
||||
headers[8] = new BasicHeader("Authorization", "Basic " + encodedAuth);
|
||||
|
||||
logWrite("9999", restService + ": HEADER DEL SERVIZIO REST: ");
|
||||
for (Header header : headers) {
|
||||
logWrite("9999", " -> " + header.toString());
|
||||
}
|
||||
return headers;
|
||||
}
|
||||
|
||||
private void manageErrorDTO(Gson gson, String risposta) throws Exception {
|
||||
ErrorDTO errorDTO = gson.fromJson(risposta, ErrorDTO.class);
|
||||
logWrite("9999", "CODICE DI ERRORE DELLA RESPONSE: " + errorDTO.getCode());
|
||||
|
||||
@@ -2515,4 +2515,10 @@ public class Resources {
|
||||
init();
|
||||
return trim(props.getProperty("ESO_RETRIEVE_REST_POST_URL"));
|
||||
}
|
||||
|
||||
public static String getESO_RETRIEVE_REST_POST_AUTHBASIC_BASE64() {
|
||||
init();
|
||||
return trim(props.getProperty("ESO_RETRIEVE_REST_POST_AUTHBASIC_BASE64"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user