From 45c717760a6efc74f4f15dbc3f55bafc5e9a02d9 Mon Sep 17 00:00:00 2001 From: Christof Rabensteiner Date: Fri, 28 Jun 2019 13:13:35 +0200 Subject: Remove EgovUtils Dependency - EgovUtils were needed because of DomUtils. Replace it with eaaf components' DomUtils. - Add test case to ensure SoapUtils still works as intended. - Remove unused import statement --- .../msg/StoreSOAPBodyBinaryInRepositoryInterceptor.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/main/java/at/gv/egiz/moazs/msg') diff --git a/src/main/java/at/gv/egiz/moazs/msg/StoreSOAPBodyBinaryInRepositoryInterceptor.java b/src/main/java/at/gv/egiz/moazs/msg/StoreSOAPBodyBinaryInRepositoryInterceptor.java index d007286..4ebd2d0 100644 --- a/src/main/java/at/gv/egiz/moazs/msg/StoreSOAPBodyBinaryInRepositoryInterceptor.java +++ b/src/main/java/at/gv/egiz/moazs/msg/StoreSOAPBodyBinaryInRepositoryInterceptor.java @@ -15,8 +15,9 @@ import org.xml.sax.SAXException; import javax.xml.parsers.ParserConfigurationException; import java.io.IOException; +import java.nio.charset.StandardCharsets; -import static at.gv.egiz.moazs.MoaZSException.moaZSExceptionBuilder; +import static at.gv.egiz.moazs.MoaZSException.moaZSException; @Component public class StoreSOAPBodyBinaryInRepositoryInterceptor extends AbstractPhaseInterceptor { @@ -41,17 +42,18 @@ public class StoreSOAPBodyBinaryInRepositoryInterceptor extends AbstractPhaseInt try { byte[] content = messageUtils.copyContent(message); + log.trace("Interceptor received this SOAP message: {}. ", new String(content, StandardCharsets.UTF_8)); + if(content.length > 0) { Element document = soapUtils.toDOM(content); byte[] status = soapUtils.unwrapSoapEnvelope(document); String appDeliveryID = soapUtils.getAppDeliveryIDFrom(document); repository.addSignedDeliveryRequestStatus(status, appDeliveryID); - log.info("Store binary DeliveryRequestStatus with AppDeliveryID={}", appDeliveryID); + log.trace("DeliveryRequestStatus with AppDeliveryID={} unwrapped and stored: {}. ", + appDeliveryID, new String(status, StandardCharsets.UTF_8)); } } catch (ParserConfigurationException | SAXException | IOException | NullPointerException e) { - throw moaZSExceptionBuilder("Could not extract signed data from message.") - .withCause(e) - .build(); + throw moaZSException("Could not extract signed data from message.", e); } } -- cgit v1.2.3