From 242818b75bf379e8a12770991dc67c2058e071b9 Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Thu, 16 Aug 2018 16:38:29 +0200 Subject: update SZR client after first tests --- .../modules/authmodule_eIDASv2/szr/SZRClient.java | 44 +++++++++++++--------- 1 file changed, 27 insertions(+), 17 deletions(-) (limited to 'eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/authmodule_eIDASv2/szr/SZRClient.java') diff --git a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/authmodule_eIDASv2/szr/SZRClient.java b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/authmodule_eIDASv2/szr/SZRClient.java index cec36d4b..4840a5e0 100644 --- a/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/authmodule_eIDASv2/szr/SZRClient.java +++ b/eidas_modules/authmodule-eIDAS-v2/src/main/java/at/asitplus/eidas/specific/modules/authmodule_eIDASv2/szr/SZRClient.java @@ -88,21 +88,28 @@ public class SZRClient { private SZRService szrService = null; private String szrURL = null; private QName qname = null; - - public IdentityLinkType getIdentityLink(PersonInfoType personInfo, List keyValue, Boolean insertERnP) throws SZRCommunicationException { - try { - return szr.getIdentityLink( - personInfo, - keyValue, - insertERnP); - - } catch (SZRException_Exception e) { - log.warn("SZR communication FAILED. Reason: " + e.getMessage(), e); - throw new SZRCommunicationException("ernb.02", new Object[] {e.getMessage()}, e); - - } - - } + + /* + * This method does not return a valid signed IDL, because Apache CXF XML parser switch namespaces!!!! + */ +// public IdentityLinkType getIdentityLink(PersonInfoType personInfo, List keyValue, Boolean insertERnP) throws SZRCommunicationException { +// try { +// return szr.getIdentityLink( +// personInfo, +// keyValue, +// insertERnP); +// +// } catch (SZRException_Exception | SOAPFaultException e) { +// log.warn("SZR communication FAILED. Reason: " + e.getMessage(), e); +// throw new SZRCommunicationException("ernb.02", new Object[] {e.getMessage()}, e); +// +// } catch (Exception e) { +// log.warn("SZR communication FAILED. Reason: " + e.getMessage(), e); +// throw new SZRCommunicationException("ernb.02", new Object[] {e.getMessage()}, e); +// +// } +// +// } public IdentityLinkType getIdentityLinkInRawMode(PersonInfoType personInfo, List keyValue, Boolean insertERnP) throws SZRCommunicationException { try { @@ -139,7 +146,9 @@ public class SZRClient { // ok, we have success Document doc = DOMUtils.parseDocument( new ByteArrayInputStream(szrResponse), - true, XMLNamespaceConstants.ALL_SCHEMA_LOCATIONS, null, null + true, + XMLNamespaceConstants.ALL_SCHEMA_LOCATIONS + " " + Constants.SZR_SCHEMA_LOCATIONS, + null, null ); String xpathExpression = "//saml:Assertion"; Element nsNode = doc.createElementNS("urn:oasis:names:tc:SAML:1.0:assertion", "saml:NSNode"); @@ -288,7 +297,8 @@ public class SZRClient { LoggingHandler loggingHandler = new LoggingHandler(); handlerList.add(loggingHandler); - } + } + bindingProvider.getBinding().setHandlerChain(handlerList); } private SSLContext createSSLContext(String clientType) { -- cgit v1.2.3