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 +++++++----- src/main/java/at/gv/egiz/moazs/scheme/SOAPUtils.java | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'src/main') 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); } } diff --git a/src/main/java/at/gv/egiz/moazs/scheme/SOAPUtils.java b/src/main/java/at/gv/egiz/moazs/scheme/SOAPUtils.java index eee1152..8b8219a 100644 --- a/src/main/java/at/gv/egiz/moazs/scheme/SOAPUtils.java +++ b/src/main/java/at/gv/egiz/moazs/scheme/SOAPUtils.java @@ -1,6 +1,6 @@ package at.gv.egiz.moazs.scheme; -import at.gv.util.DOMUtils; +import at.gv.egiz.eaaf.core.impl.utils.DOMUtils; import org.apache.cxf.binding.soap.Soap11; import org.springframework.stereotype.Component; import org.w3c.dom.Element; -- cgit v1.2.3