diff options
| author | Christof Rabensteiner <christof.rabensteiner@iaik.tugraz.at> | 2019-06-28 13:13:35 +0200 | 
|---|---|---|
| committer | Christof Rabensteiner <christof.rabensteiner@iaik.tugraz.at> | 2019-06-28 13:13:35 +0200 | 
| commit | 45c717760a6efc74f4f15dbc3f55bafc5e9a02d9 (patch) | |
| tree | 26a1dd9cb326c6e78a34028827e36aea6e86a8ef /src/main/java | |
| parent | 9bb0e41fc0226d159aa7f6f3c0eadc86b37df2c7 (diff) | |
| download | moa-zs-45c717760a6efc74f4f15dbc3f55bafc5e9a02d9.tar.gz moa-zs-45c717760a6efc74f4f15dbc3f55bafc5e9a02d9.tar.bz2 moa-zs-45c717760a6efc74f4f15dbc3f55bafc5e9a02d9.zip | |
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
Diffstat (limited to 'src/main/java')
| -rw-r--r-- | src/main/java/at/gv/egiz/moazs/msg/StoreSOAPBodyBinaryInRepositoryInterceptor.java | 12 | ||||
| -rw-r--r-- | src/main/java/at/gv/egiz/moazs/scheme/SOAPUtils.java | 2 | 
2 files changed, 8 insertions, 6 deletions
| 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<Message> { @@ -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; | 
