From fab73b839be7c1ae0e003954630f88262927d886 Mon Sep 17 00:00:00 2001 From: Andreas Fitzek Date: Thu, 23 Apr 2015 17:57:17 +0200 Subject: retry on possible worng X14 MOA ID --- .../moa/MOASoapWithAttachmentConnector.java | 23 +++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'pdf-as-lib') diff --git a/pdf-as-lib/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/moa/MOASoapWithAttachmentConnector.java b/pdf-as-lib/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/moa/MOASoapWithAttachmentConnector.java index 3f24ec1..dd13908 100644 --- a/pdf-as-lib/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/moa/MOASoapWithAttachmentConnector.java +++ b/pdf-as-lib/src/main/java/at/knowcenter/wag/egov/egiz/sig/connectors/moa/MOASoapWithAttachmentConnector.java @@ -192,13 +192,34 @@ public class MOASoapWithAttachmentConnector implements Connector { String verify_request_xml = prepareVerifyRequest(data, so, dsig); log.debug("verify_request_xml = " + verify_request_xml); //$NON-NLS-1$ - + log.debug("ID: " + so.id); String url = this.environment.getVerifyURL(); Properties response_properties = sendRequest(url, MOASoapConnection.SERVICE_VERIFY, verify_request_xml, data); SignatureResponse signature_response = analyzeVerifyResponse(response_properties); + if("2".equals(signature_response.getSignatureCheckCode()) && + so.id != null && so.id.startsWith(DetachedLocRefMOAIdFormatter.SIG_ID_PREFIX)) { + log.debug("Retrying using X14 for MOA"); + + so.id = DetachedLocRefMOAIdFormatter.SIG_ID_X14_PREFIX; + + verify_request_xml = prepareVerifyRequest(data, so, dsig); + log.debug("verify_request_xml = " + verify_request_xml); //$NON-NLS-1$ + log.debug("ID: " + so.id); + url = this.environment.getVerifyURL(); + response_properties = sendRequest(url, + MOASoapConnection.SERVICE_VERIFY, verify_request_xml, data); + + SignatureResponse signature_response2 = analyzeVerifyResponse(response_properties); + + if("0".equals(signature_response2.getSignatureCheckCode())) { + log.debug("doVerify finished."); //$NON-NLS-1$ + return signature_response2; + } + } + log.debug("doVerify finished."); //$NON-NLS-1$ return signature_response; } -- cgit v1.2.3