Allineamento Master Ril. MNP_SM_2459 - inserimento sessionID per i servizi SOAP IBK50, IBK61, IBK63, IBK65

+ Aggiunti log Lotto_7
This commit is contained in:
manuelstefanile
2024-12-11 17:52:12 +01:00
parent b7868b5a26
commit 22c50b1a85
15 changed files with 121 additions and 58 deletions

View File

@@ -1,3 +1,3 @@
############### Middleware Modernization 2024: Servizi GISP lotto7 - BEGIN - #################
ESO_RETRIEVE_REST_POST_ENABLED = 1
ESO_RETRIEVE_REST_POST_URL = "pippo"
ESO_RETRIEVE_REST_POST_ENABLED = 0
ESO_RETRIEVE_REST_POST_URL = "URL_WS_ESO"

View File

@@ -28,7 +28,7 @@ import it.telecomitalia.soa.soap.soapheader.x20230406.holders.HeaderTypeHolder;
@WLHttpTransport(contextPath="wsgispesito",serviceUri="EsitoCessMnp",portName="EsitoCessMnp")
public class EsitoCessMnpPortTypeImpl implements EsitoCessMnpPortType, Loggable {
private final String codiceLog = "ZF";
private final String codiceLog = "HB";
private String versione = "1.0";
private ProcessLogger log = null;
@@ -82,20 +82,20 @@ public class EsitoCessMnpPortTypeImpl implements EsitoCessMnpPortType, Loggable
private void logInput(HeaderTypeHolder header, EsitoCessMnpRequest body) {
log.write("9999", "richiesta in ingresso header= " + header);
log.write("9999", "richiesta in ingresso body= " + body);
if (header != null && header.value != null) {
log.write("9999", "EsitoCessMnpRequest Header:");
log.write("9999", "getBusinessID = " + header.value.getBusinessID());
log.write("9999", "getMessageID = " + header.value.getMessageID());
log.write("9999", "getSourceSystem = " + header.value.getSourceSystem());
log.write("9999", "getSourceSystem = " + header.value.getChannel());
log.write("9999", "getChannel = " + header.value.getChannel());
log.write("9999", "getTransactionID = " + header.value.getTransactionID());
log.write("9999", "getInteractionDate = " + header.value.getInteractionDate());
log.write("9999", "getEventType = " + header.value.getEventType());
log.write("9999", "getSessionID = " + header.value.getSessionID());
}
if (body != null) {
log.write("9999", "EsitoCessMnpRequest Body:");
log.write("9999", "Nome_Richiesta = " + body.getNOME_RICHIESTA() + ", EsitoCas = " + body.getESITO_CAS() + ", DescrizioneEsito = " + body.getDESCRIZIONE_ESITO());
}
}

View File

@@ -16,6 +16,7 @@ import mnp.objects.LogInfo;
import mnp.objects.LogProcess;
import mnp.objects.map.GispMap;
import mnp.utility.DateUtils;
import mnp.utility.Func;
import mnp.utility.Resources;
import javax.xml.rpc.Stub;
import it.telecomitalia.soa.soap.soapheader.InteractionDateType;
@@ -104,15 +105,17 @@ public class GISPClient implements Loggable {
header.setEventType(eventType);
header.setBusinessID(new TID().toString());
//MNP_SM_2459 - settaggio del parametro obbligatorio sessionID
header.setSessionID(new TID().toString());
header.setTransactionID(new TID().toString());
header.setMessageID(new TID().toString());
body.setHeader(header);
/*
if (requestHeader != null) {
header.setBusinessID(requestHeader.getBusinessId());
header.setTransactionID(requestHeader.getTransactionId());
}*/
System.out.println("Request Header iBK50RichiestaCessazioneLineaDonor: "+ Func.getFieldDescription(body.getHeader()));
System.out.println("Request Body iBK50RichiestaCessazioneLineaDonor:");
for(com.tibco.tns.bw.json.x1698392386014.RequestParameters req: body.getMessage().getRequestParameters()){
System.out.println(Func.getFieldDescription(req));
}
IBK50ResponseElementType response = endPoint.iBK50RichiestaCessazioneLineaDonor(body);

View File

@@ -29,7 +29,7 @@ import weblogic.transaction.UserTransaction;
public class EsitoRicMvnoPortTypeImpl implements EsitoRicMvnoPortType, Loggable {
/**Implemento anche loggable per poter implementare i metodi di loggable e tenere traccia
* dei log*/
private final String codiceLog = "ZF";
private final String codiceLog = "HB";
private String versione = "1.0";
private ProcessLogger log = null;
public EsitoRicMvnoPortTypeImpl() {
@@ -99,20 +99,20 @@ public class EsitoRicMvnoPortTypeImpl implements EsitoRicMvnoPortType, Loggable
private void logInput(HeaderTypeHolder header, EsitoRicMvnoRequest body) {
log.write("9999", "richiesta in ingresso header= " + header);
log.write("9999", "richiesta in ingresso body= " + body);
if (header != null && header.value != null) {
log.write("9999", "EsitoRicMvnoRequest Header:");
log.write("9999", "getBusinessID = " + header.value.getBusinessID());
log.write("9999", "getMessageID = " + header.value.getMessageID());
log.write("9999", "getSourceSystem = " + header.value.getSourceSystem());
log.write("9999", "getSourceSystem = " + header.value.getChannel());
log.write("9999", "getChannel = " + header.value.getChannel());
log.write("9999", "getTransactionID = " + header.value.getTransactionID());
log.write("9999", "getInteractionDate = " + header.value.getInteractionDate());
log.write("9999", "getEventType = " + header.value.getEventType());
log.write("9999", "getSessionID = " + header.value.getSessionID());
}
if (body != null) {
log.write("9999", "EsitoRicMvnoRequest Body:");
log.write("9999", "Nome_Richiesta = " + body.getNOME_RICHIESTA() + ", EsitoCas = " + body.getCAS() + ", DescrizioneEsito = " + body.getDESCRIZIONE_ESITO());
}
}

View File

@@ -15,6 +15,7 @@ import mnp.objects.LogInfo;
import mnp.objects.LogProcess;
import mnp.utility.DateUtils;
import mnp.utility.Func;
import mnp.utility.Resources;
import org.example.ibk61_responseresource.IBK61_ResponseElementType;
import tim.infobus.data.TID;
@@ -178,7 +179,7 @@ public class IBK61Client implements Loggable {
/**
* Creazione Request servizio richiestaAttivaztioneCessazioneLinea esposto da O2C
* per richieste di attivazione (DISATMNPG)
* per richieste di cessazione (DISATMNPG)
*
* @param MnpGispCessOut oggetto legato al dao che referenzia la tabella MNP_GISP_CESS_OUT
* @return oggetto di tipo IBK61_RequestElementType
@@ -274,9 +275,10 @@ public class IBK61Client implements Loggable {
header.setEventType(eventType);
header.setBusinessID(new TID().toString());
//MNP_SM_2459 - settaggio del parametro obbligatorio sessionID
header.setSessionID(new TID().toString());
header.setTransactionID(new TID().toString());
header.setMessageID(new TID().toString());
//in uniformità alla IBK50 non mettiamo SessionID
body.setHeader(header);

View File

@@ -20,11 +20,11 @@ public class IBK61SOAPHandler extends GenericHandler {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try {
System.out.println("[IBK61SOAPHandler] - Inizio Log Invio Notifica");
System.out.println("[IBK61SOAPHandler] - Inizio Log Request");
System.out.println("----------------------------------------------------------------------------------------------");
soapMsgCtx.getMessage().writeTo(baos);
System.out.println(baos.toString());
System.out.println("[IBK61SOAPHandler] - Fine Log Invio Notifica");
System.out.println("[IBK61SOAPHandler] - Fine Log Request");
} catch (Exception ex) {
ex.printStackTrace();
return false;
@@ -37,11 +37,11 @@ public class IBK61SOAPHandler extends GenericHandler {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try {
System.out.println("[IBK61SOAPHandler] - Inizio Log Errore Invio Notifica");
System.out.println("[IBK61SOAPHandler] - Inizio Log Errore");
System.out.println("----------------------------------------------------------------------------------------------");
soapMsgCtx.getMessage().writeTo(baos);
System.out.println(baos.toString());
System.out.println("[IBK61SOAPHandler] - Fine Log Errore Invio Notifica");
System.out.println("[IBK61SOAPHandler] - Fine Log Errore");
} catch (Exception ex) {
ex.printStackTrace();
return false;
@@ -49,4 +49,21 @@ public class IBK61SOAPHandler extends GenericHandler {
return true;
}
public boolean handleResponse(MessageContext context) {
SOAPMessageContext soapMsgCtx = (SOAPMessageContext) context;
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try {
System.out.println("[IBK61SOAPHandler] - Inizio Log Response");
System.out.println("----------------------------------------------------------------------------------------------");
soapMsgCtx.getMessage().writeTo(baos);
System.out.println(baos.toString());
System.out.println("[IBK61SOAPHandler] - Fine Log Response");
} catch (Exception ex) {
ex.printStackTrace();
return false;
}
return true;
}
}

View File

@@ -12,6 +12,7 @@ import mnp.log.Loggable;
import mnp.log.ProcessLogger;
import mnp.objects.LogInfo;
import mnp.objects.LogProcess;
import mnp.utility.Func;
import mnp.utility.Resources;
import org.example.ibk63_responseresource.IBK63_ResponseElementType;
@@ -191,9 +192,10 @@ public class IBK63Client implements Loggable {
header.setEventType(eventType);
header.setBusinessID(new TID().toString());
//MNP_SM_2459 - settaggio del parametro obbligatorio sessionID
header.setSessionID(new TID().toString());
header.setTransactionID(new TID().toString());
header.setMessageID(new TID().toString());
//in uniformità alla IBK50 non mettiamo SessionID
body.setHeader(header);

View File

@@ -20,11 +20,11 @@ public class IBK63SOAPHandler extends GenericHandler {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try {
System.out.println("[IBK63SOAPHandler] - Inizio Log Invio Notifica");
System.out.println("[IBK63SOAPHandler] - Inizio Log Request");
System.out.println("----------------------------------------------------------------------------------------------");
soapMsgCtx.getMessage().writeTo(baos);
System.out.println(baos.toString());
System.out.println("[IBK63SOAPHandler] - Fine Log Invio Notifica");
System.out.println("[IBK63SOAPHandler] - Fine Log Request");
} catch (Exception ex) {
ex.printStackTrace();
return false;
@@ -37,11 +37,28 @@ public class IBK63SOAPHandler extends GenericHandler {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try {
System.out.println("[IBK63SOAPHandler] - Inizio Log Errore Invio Notifica");
System.out.println("[IBK63SOAPHandler] - Inizio Log Errore");
System.out.println("----------------------------------------------------------------------------------------------");
soapMsgCtx.getMessage().writeTo(baos);
System.out.println(baos.toString());
System.out.println("[IBK63SOAPHandler] - Fine Log Errore Invio Notifica");
System.out.println("[IBK63SOAPHandler] - Fine Log Errore");
} catch (Exception ex) {
ex.printStackTrace();
return false;
}
return true;
}
public boolean handleResponse(MessageContext context) {
SOAPMessageContext soapMsgCtx = (SOAPMessageContext) context;
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try {
System.out.println("[IBK63SOAPHandler] - Inizio Log Response");
System.out.println("----------------------------------------------------------------------------------------------");
soapMsgCtx.getMessage().writeTo(baos);
System.out.println(baos.toString());
System.out.println("[IBK63SOAPHandler] - Fine Log Response");
} catch (Exception ex) {
ex.printStackTrace();
return false;

View File

@@ -11,6 +11,7 @@ import mnp.log.Loggable;
import mnp.log.ProcessLogger;
import mnp.objects.LogInfo;
import mnp.objects.LogProcess;
import mnp.utility.Func;
import mnp.utility.Resources;
import org.example.ibk65_responseresource.IBK65_ResponseElementType;
import tim.infobus.data.TID;
@@ -141,7 +142,6 @@ public class IBK65Client implements Loggable {
message.setRequestParameters(array_param);
richiestaRestituzione.setMessage(message);
return richiestaRestituzione;
}
@@ -172,9 +172,10 @@ public class IBK65Client implements Loggable {
header.setEventType(eventType);
header.setBusinessID(new TID().toString());
//MNP_SM_2459 - settaggio del parametro obbligatorio sessionID
header.setSessionID(new TID().toString());
header.setTransactionID(new TID().toString());
header.setMessageID(new TID().toString());
//in uniformità alla IBK50 non mettiamo SessionID
body.setHeader(header);

View File

@@ -20,11 +20,11 @@ public class IBK65SOAPHandler extends GenericHandler {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try {
System.out.println("[IBK65SOAPHandler] - Inizio Log Invio Notifica");
System.out.println("[IBK65SOAPHandler] - Inizio Log Request");
System.out.println("----------------------------------------------------------------------------------------------");
soapMsgCtx.getMessage().writeTo(baos);
System.out.println(baos.toString());
System.out.println("[IBK65SOAPHandler] - Fine Log Invio Notifica");
System.out.println("[IBK65SOAPHandler] - Fine Log Request");
} catch (Exception ex) {
ex.printStackTrace();
return false;
@@ -37,11 +37,29 @@ public class IBK65SOAPHandler extends GenericHandler {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try {
System.out.println("[IBK65SOAPHandler] - Inizio Log Errore Invio Notifica");
System.out.println("[IBK65SOAPHandler] - Inizio Log Errore");
System.out.println("----------------------------------------------------------------------------------------------");
soapMsgCtx.getMessage().writeTo(baos);
System.out.println(baos.toString());
System.out.println("[IBK65SOAPHandler] - Fine Log Errore Invio Notifica");
System.out.println("[IBK65SOAPHandler] - Fine Log Errore");
} catch (Exception ex) {
ex.printStackTrace();
return false;
}
return true;
}
public boolean handleResponse(MessageContext context) {
SOAPMessageContext soapMsgCtx = (SOAPMessageContext) context;
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try {
System.out.println("[IBK65SOAPHandler] - Inizio Log Response");
System.out.println("----------------------------------------------------------------------------------------------");
soapMsgCtx.getMessage().writeTo(baos);
System.out.println(baos.toString());
System.out.println("[IBK65SOAPHandler] - Fine Log Response");
} catch (Exception ex) {
ex.printStackTrace();
return false;

View File

@@ -24,10 +24,10 @@ import java.io.Serializable;
public class AttributiUsage implements Serializable {
@SerializedName("value")
private String value = null;
private String value = "";
@SerializedName("main_msisdn")
private String mainMsisdn = null;
private String mainMsisdn = "";
public AttributiUsage value(String value) {
this.value = value;

View File

@@ -107,23 +107,26 @@ public class GispRetrieveEventHandler extends AbstractEventHandler{
if (checkRequestForRetrieve(request)) {
//new REST Middleware Modernization: Servizi GISP Lotto 7 - item 311728 - R58-24-1170
if("1".equals(Resources.getESO_RETRIEVE_REST_POST_ENABLED())){
//la variabile si chiama xml, ma in questo caso è json
xml = formatter.getTracciatoForReqESORest(retrieveGisp);
log.write("9999", "REQUEST json da inviare SDP/ESO :[" + xml + "]");
try{
WSRestHandler wsRestHandler = new WSRestHandler(log);
xmlResponse = wsRestHandler.retrieveESORestPost(xml);
log.write("9999", "RESPONSE rest SDP/ESO XML :[" + xmlResponse + "]");
}catch (Exception ex){
log.write("9999", "ERRORE invio rest SDP/ESO XML :[" + xml + "]");
log.write("9999", "ERRORE invio rest SDP/ESO JSON :[" + xml + "]");
throw ex;
}
log.write("9999", "RESPONSE rest SDP/ESO JSON :[" + xmlResponse + "]");
// unmarshall della risposta ESO
try {
retrieveGispResponse = formatter.formatEsoDTO(xmlResponse);
retrieveGispResponse.setMsisdnType(retrieveGisp.getMsisdnType());
}catch (Exception ex){
log.write("9999", "ERRORE formattazione risposta SDP/ESO XML :[" + xmlResponse + "]");
log.write("9999", "ERRORE UNMARSHAL risposta SDP/ESO JSON :[" + xmlResponse + "]");
throw ex;
}
log.write("9999", "RESPONSE MnpGispRetrieveOut rest SDP/ESO :[" + Func.getFieldDescription(retrieveGispResponse) + "]");
}
else {
//old InfoBus

View File

@@ -165,43 +165,43 @@ public class RetrieveGispXAO {
/******* Attributi *******/
//Attributi -> stato
attributi.setStato(new String());
attributi.setStato("");
//AttributiDettaglioStato -> cessazione_mnp
mnp.proxy.ws.sdp.client.AttributiDettaglioStato dettaglioStato= new mnp.proxy.ws.sdp.client.AttributiDettaglioStato();
dettaglioStato.setCessazioneMnp(new String());
dettaglioStato.setCessazioneMnp("");
//Attributi -> prepagato
attributi.setPrepagato(new String());
attributi.setPrepagato("");
//Attributi -> usage
attributi.setUsage(new mnp.proxy.ws.sdp.client.AttributiUsage());
//Attributi -> esp
attributi.setEsp(new String());
attributi.setEsp("");
//Attributi -> profilo
attributi.setProfilo(new String());
attributi.setProfilo("");
//Attributi -> descrizioneProfilo
attributi.setDescrizioneProfilo(new String());
attributi.setDescrizioneProfilo("");
//Attributi -> tipologia
attributi.setTipologia(new String());
attributi.setTipologia("");
//Attributi -> blocco -> fs
mnp.proxy.ws.sdp.client.AttributiBlocco blocco = new mnp.proxy.ws.sdp.client.AttributiBlocco();
blocco.setFs(new String());
blocco.setFraud(new String());
blocco.setAnagr(new String());
blocco.setFs("");
blocco.setFraud("");
blocco.setAnagr("");
//Attributi -> dati_commerciali -> cliente
mnp.proxy.ws.sdp.client.AttributiDatiCommerciali datiCommerciali = new mnp.proxy.ws.sdp.client.AttributiDatiCommerciali();
datiCommerciali.setCliente(new String());
datiCommerciali.setMarcaggioCliente(new String());
datiCommerciali.setCliente("");
datiCommerciali.setMarcaggioCliente("");
/******* Servizi *******/
mnp.proxy.ws.sdp.client.ServiziServizio servizioBear = new mnp.proxy.ws.sdp.client.ServiziServizio();
servizioBear.name(GispMap.SERVIZIO_BEAR);
/******* Carta *******/
carta.setIccId20(new String());
carta.setIccId20("");
/******* Risorse Rete *******/
risorseRete.setStato(new String());
risorseRete.setTipologia(new String());
risorseRete.setDataUltimaOperazione(new String());
risorseRete.setStato("");
risorseRete.setTipologia("");
risorseRete.setDataUltimaOperazione("");
/******* assegnazioni *******/
attributi.setDettaglioStato(dettaglioStato);
@@ -392,7 +392,7 @@ public class RetrieveGispXAO {
* @param xmlResponse String
* @return String
*/
public static MnpGispRetrieveOut getRetrieveESOFromXmlResponse(String xmlResponse) throws NotValidXMLException,Exception{
public static MnpGispRetrieveOut getRetrieveESOFromXmlResponse(String xmlResponse) throws Exception{
MnpGispRetrieveOut retrieveGisp= new MnpGispRetrieveOut();
try {
// databinding con validazione

View File

@@ -5,6 +5,6 @@
<handler>
<j2ee:handler-name>IBK63SOAPHandler</j2ee:handler-name>
<j2ee:handler-class>mnp.proxy.ws.o2c.client.IBK63SOAPHandler</j2ee:handler-class>
<j2ee:handler-class>mnp.proxy.ws.o2c.client.IBK63.IBK63SOAPHandler</j2ee:handler-class>
</handler>
</weblogic-wsee-clientHandlerChain>

View File

@@ -5,6 +5,6 @@
<handler>
<j2ee:handler-name>IBK65SOAPHandler</j2ee:handler-name>
<j2ee:handler-class>mnp.proxy.ws.o2c.client.IBK65SOAPHandler</j2ee:handler-class>
<j2ee:handler-class>mnp.proxy.ws.o2c.client.IBK65.IBK65SOAPHandler</j2ee:handler-class>
</handler>
</weblogic-wsee-clientHandlerChain>