Skip to content

Commit

Permalink
Risolti problemi da esecuzione test sul servizio Backoffice -> Eventi…
Browse files Browse the repository at this point in the history
… e sulle API-Ragioneria V3.
  • Loading branch information
pintorig committed Jul 23, 2021
1 parent 4d9a88f commit 25f5ae8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 9 deletions.
3 changes: 3 additions & 0 deletions jars/core/src/main/java/it/govpay/core/business/Incassi.java
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,9 @@ public void verificaRiconciliazione(RichiestaIncassoDTO richiestaIncasso) throws
ctx.getApplicationLogger().log("incasso.duplicato", "importo");
throw new IncassiException(FaultType.DUPLICATO, "Incasso gia' registrato con importo diverso: " + incasso.getImporto());
}

// se l'incasso e' gia' acquisito lo restituisco
return;
} catch(NotFoundException nfe) {
// Incasso non registrato. OK
} catch (MultipleResultException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
import it.govpay.core.utils.EventoContext;
import it.govpay.core.utils.EventoContext.Categoria;
import it.govpay.core.utils.EventoContext.Componente;
import it.govpay.core.utils.ExceptionUtils;
import it.govpay.core.utils.GovpayConfig;
import it.govpay.core.utils.client.beans.TipoConnettore;
import it.govpay.core.utils.client.beans.TipoDestinatario;
Expand Down Expand Up @@ -450,8 +451,8 @@ private byte[] send(boolean soap, String azione, byte[] body, boolean isAzioneIn
try {
this.url = new URL(location.concat(azione));
} catch (MalformedURLException e) {
// responseCode = 500;
throw new ClientException("Url di connessione malformata: " + location.concat(azione), e);
responseCode = 500;
throw new ClientException("Url di connessione malformata: " + location.concat(azione), e, responseCode);
}
}
} else {
Expand All @@ -462,13 +463,16 @@ private byte[] send(boolean soap, String azione, byte[] body, boolean isAzioneIn
this.url = new URL(location.concat(path));
log.debug("La richiesta sara' spedita alla URL: ["+this.url+"].");
} catch (MalformedURLException e) {
throw new ClientException("Url di connessione malformata: " + location.concat(path), e);
responseCode = 500;
throw new ClientException("Url di connessione malformata: " + location.concat(path), e, responseCode);
}
}

this.serverInfoContext = new ServerInfoContextManuallyAdd(this.getServerConfig(ctx));
this.serverInfoRequest.setAddress(this.url.toString());
this.serverInfoRequest.setHttpRequestMethod(httpMethod);

this.getEventoCtx().setUrl(this.url.toExternalForm());

if(this.debug)
log.debug("Creazione URL ["+location+"]...");
Expand All @@ -485,7 +489,7 @@ private byte[] send(boolean soap, String azione, byte[] body, boolean isAzioneIn
this.httpClient = buildHttpClient(keepAliveStrategy, this.sslContextFactory, BasicClientCORE.USE_POOL, this.serverID, this.connettore);
} catch (UtilsException e) {
responseCode = 500;
throw new ClientException(e);
throw new ClientException(e,responseCode);
}

// HttpMethod
Expand Down Expand Up @@ -618,7 +622,7 @@ private byte[] send(boolean soap, String azione, byte[] body, boolean isAzioneIn
httpBody = new HttpBodyParameters(httpMethod, contentType);
} catch (UtilsException e) {
responseCode = 500;
throw new ClientException(e);
throw new ClientException(e,responseCode);
}

// Preparazione messaggio da spedire
Expand All @@ -642,7 +646,8 @@ private byte[] send(boolean soap, String azione, byte[] body, boolean isAzioneIn
((HttpEntityEnclosingRequestBase)this.httpRequest).setEntity(httpEntity);
}
else{
throw new ClientException("Tipo ["+this.httpRequest.getClass().getName()+"] non utilizzabile per una richiesta di tipo ["+httpMethod+"]");
responseCode = 500;
throw new ClientException("Tipo ["+this.httpRequest.getClass().getName()+"] non utilizzabile per una richiesta di tipo ["+httpMethod+"]", responseCode);
}
}

Expand All @@ -658,10 +663,15 @@ private byte[] send(boolean soap, String azione, byte[] body, boolean isAzioneIn
httpResponse = this.httpClient.execute(this.httpRequest);
} catch (ClientProtocolException e) {
responseCode = 500;
throw new ClientException(e);
throw new ClientException(e, responseCode);
} catch (IOException e) {
responseCode = 500;
throw new ClientException(e);

// retrocompatibilita'
if(ExceptionUtils.getInnerException(e, java.net.UnknownHostException.class) != null) {
responseCode = 999;
}
throw new ClientException(e, responseCode);
}
this.httpEntityResponse = httpResponse.getEntity();

Expand Down Expand Up @@ -838,7 +848,7 @@ public void disconnect() throws ClientException{

if(listExceptionChiusura!=null && !listExceptionChiusura.isEmpty()) {
org.openspcoop2.utils.UtilsMultiException multiException = new org.openspcoop2.utils.UtilsMultiException(listExceptionChiusura.toArray(new Throwable[1]));
throw new ClientException("Chiusura connessione non riuscita: "+multiException.getMessage(),multiException);
throw new ClientException("Chiusura connessione non riuscita: "+multiException.getMessage(),multiException,500);
}
}

Expand Down

0 comments on commit 25f5ae8

Please sign in to comment.