From 695ab1f836160d40c4352a2c3127f4f687912817 Mon Sep 17 00:00:00 2001 From: Christof Rabensteiner Date: Mon, 27 May 2019 09:46:36 +0200 Subject: Intercept Incoming DeliveryRequestStatus and Store as byte[] - Add egovutils dependency (Reason: Need DomUtils to serialize / unserialize Soap Message via DOMParser) - Add Incerceptor to MsgClient / -Factory that stores the message content byte-by-byte in the DeliveryRepository. The format is required for successfully validating a DeliveryRequestStatus. - Add SoapUtils, which interacts with byte[] Soap message. - Add CXFMessageUtils, which interacts with CXF Messages from interceptor chains. - Refactor xsd namespaces: Move them out from the PrefixMapper and into a dedicated class. --- .../at/gv/egiz/moazs/scheme/MoaZSPrefixMapper.java | 36 +++++----------------- 1 file changed, 7 insertions(+), 29 deletions(-) (limited to 'src/main/java/at/gv/egiz/moazs/scheme/MoaZSPrefixMapper.java') diff --git a/src/main/java/at/gv/egiz/moazs/scheme/MoaZSPrefixMapper.java b/src/main/java/at/gv/egiz/moazs/scheme/MoaZSPrefixMapper.java index faee8a5..d725ce6 100644 --- a/src/main/java/at/gv/egiz/moazs/scheme/MoaZSPrefixMapper.java +++ b/src/main/java/at/gv/egiz/moazs/scheme/MoaZSPrefixMapper.java @@ -12,43 +12,21 @@ public class MoaZSPrefixMapper extends NamespacePrefixMapper { private final Map map = new HashMap<>(); public MoaZSPrefixMapper() { - map.put(getMsgNamespaceUri(), "msg"); - map.put(getMsgPNamespaceUri(), "msgp"); - map.put(getMzsNamespaceUri(), "mzs"); - map.put(getMzsPNamespaceUri(), "mzsp"); - map.put(getDsigNamespaceUri(), "dsig"); + map.put(NameSpace.MSG, "msg"); + map.put(NameSpace.MSGP, "msgp"); + map.put(NameSpace.MZS, "mzs"); + map.put(NameSpace.MZSP, "mzsp"); + map.put(NameSpace.DSIG, "dsig"); } public MoaZSPrefixMapper(boolean isMzs) { this(); - map.put((isMzs) ? getMzsPNamespaceUri() : getMsgPNamespaceUri(), "p"); - map.put((isMzs) ? getMzsNamespaceUri() : getMsgNamespaceUri(), ""); + map.put((isMzs) ? NameSpace.MZSP : NameSpace.MSGP, "p"); + map.put((isMzs) ? NameSpace.MZS : NameSpace.MSG , ""); } @Override public String getPreferredPrefix(String namespaceUri, String suggestion, boolean requirePrefix) { return map.getOrDefault(namespaceUri, suggestion); } - - private String getMsgNamespaceUri() { - return new at.gv.zustellung.msg.xsd.ObjectFactory().createDeliveryRequest(null).getName().getNamespaceURI(); - } - - private String getMsgPNamespaceUri() { - return new at.gv.zustellung.msg.xsd.persondata.ObjectFactory().createPerson(null).getName().getNamespaceURI(); - } - - private String getMzsNamespaceUri() { - return new at.gv.zustellung.app2mzs.xsd.ObjectFactory().createDeliveryRequest(null).getName().getNamespaceURI(); - } - - private String getMzsPNamespaceUri() { - return new at.gv.zustellung.app2mzs.xsd.persondata.ObjectFactory().createAbstractPersonData(null).getName().getNamespaceURI(); - } - - private String getDsigNamespaceUri() { - return new org.w3._2000._09.xmldsig_.ObjectFactory().createCanonicalizationMethod(null).getName().getNamespaceURI(); - } - - } -- cgit v1.2.3