From ae378f2293528188235be596af8d68504803e082 Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Wed, 28 Jun 2017 12:33:25 +0200 Subject: fix problem in CMS response builder --- .../xmlbind/CreateCMSSignatureResponseBuilder.java | 39 ++++++++++++++-------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/CreateCMSSignatureResponseBuilder.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/CreateCMSSignatureResponseBuilder.java index d808f2b..7ce0871 100644 --- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/CreateCMSSignatureResponseBuilder.java +++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/api/xmlbind/CreateCMSSignatureResponseBuilder.java @@ -80,22 +80,35 @@ public class CreateCMSSignatureResponseBuilder { public Document build(CreateCMSSignatureResponse response) { Iterator iter; - + + + for (iter = response.getResponseElements().iterator(); iter.hasNext();) { - CreateCMSSignatureResponseElement responseElement = - (CreateCMSSignatureResponseElement) iter.next(); - switch (responseElement.getResponseType()) { - case CreateCMSSignatureResponseElement.CMS_SIGNATURE : - CMSSignatureResponse cmsSignatureResponse = (CMSSignatureResponse) responseElement; + Object responseObj = iter.next(); + + if (responseObj instanceof ErrorResponse) { + ErrorResponse errorResponse = (ErrorResponse) responseObj; + addErrorResponse(errorResponse); + + } else if (responseObj instanceof CreateCMSSignatureResponseElement) { + CMSSignatureResponse cmsSignatureResponse = (CMSSignatureResponse) responseObj; addCMSSignature(cmsSignatureResponse); - break; - - case CreateCMSSignatureResponseElement.ERROR_RESPONSE : - ErrorResponse errorResponse = (ErrorResponse) responseElement; - addErrorResponse(errorResponse); - break; - } + + } + +// CreateCMSSignatureResponseElement responseElement = +// (CreateCMSSignatureResponseElement) iter.next(); +// +// switch (responseElement.getResponseType()) { +// case CreateCMSSignatureResponseElement.CMS_SIGNATURE : +// +// break; +// +// case CreateCMSSignatureResponseElement.ERROR_RESPONSE : +// +// break; +// } } -- cgit v1.2.3