From 260f5824b5713c8c56faca4e429337f09bb007c7 Mon Sep 17 00:00:00 2001 From: Andreas Fitzek Date: Thu, 5 Jun 2014 15:37:29 +0200 Subject: Fixed SOAP Profile parameter --- .../at/gv/egiz/pdfas/web/client/test/SimpleTest.java | 17 ++++++++++------- .../java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java | 5 ++--- .../gv/egiz/pdfas/web/servlets/ExternSignServlet.java | 3 ++- .../gv/egiz/pdfas/web/servlets/UIEntryPointServlet.java | 3 ++- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/pdf-as-web-client/src/test/java/at/gv/egiz/pdfas/web/client/test/SimpleTest.java b/pdf-as-web-client/src/test/java/at/gv/egiz/pdfas/web/client/test/SimpleTest.java index e922c501..2d40f320 100644 --- a/pdf-as-web-client/src/test/java/at/gv/egiz/pdfas/web/client/test/SimpleTest.java +++ b/pdf-as-web-client/src/test/java/at/gv/egiz/pdfas/web/client/test/SimpleTest.java @@ -15,25 +15,27 @@ public class SimpleTest { public static void main(String[] args) { try { FileInputStream fis = new FileInputStream( - "/home/afitzek/Documents/arm_arm.pdf"); + "/home/afitzek/simple.pdf"); byte[] inputData = IOUtils.readFully(fis, -1, true); PDFASSignParameters signParameters = new PDFASSignParameters(); - signParameters.setConnector(Connector.ONLINEBKU); + signParameters.setConnector(Connector.BKU); signParameters.setPosition(null); - signParameters.setProfile("SIGNATURBLOCK_DE"); + signParameters.setProfile("SIGNATURBLOCK_SMALL_DE"); PDFASSignRequest request = new PDFASSignRequest(); request.setInputData(inputData); request.setParameters(signParameters); request.setRequestID("SOME TEST ID"); - URL endpoint = new - URL("http://demo.egiz.gv.at/demoportal-pdf_as/wssign?wsdl"); + //URL endpoint = new + //URL("http://demo.egiz.gv.at/demoportal-pdf_as/wssign?wsdl"); + //URL endpoint = new + // URL("http://www.buergerkarte.at/pdf-as-extern-4/wssign?wsdl"); //URL endpoint = new URL( // "http://localhost:8080/pdf-as-web/wssign?wsdl"); - //URL endpoint = new URL( - // "http://192.168.56.10/pdf-as-web/wssign?wsdl"); + URL endpoint = new URL( + "http://192.168.56.10/pdf-as-web/wssign?wsdl"); RemotePDFSigner signer = new RemotePDFSigner(endpoint, false); @@ -41,6 +43,7 @@ public class SimpleTest { signrequest.setInputData(inputData); signrequest.setParameters(signParameters); signParameters.setTransactionId("MYID ...."); + signParameters.setPosition("f:80;w:230;p:2"); System.out.println("Simple Request:"); PDFASSignResponse response = signer.signPDFDokument(signrequest); diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java index f64ffac0..98bbd660 100644 --- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java +++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java @@ -388,7 +388,7 @@ public class PdfAsHelper { public static void startSignature(HttpServletRequest request, HttpServletResponse response, ServletContext context, byte[] pdfData, - String connector, String position, String transactionId) + String connector, String position, String transactionId, String profile) throws Exception { // TODO: Protect session so that only one PDF can be signed during one @@ -434,8 +434,7 @@ public class PdfAsHelper { session.setAttribute(PDF_SL_INTERACTIVE, connector); // set Signature Profile (null use default ...) - signParameter.setSignatureProfileId(PdfAsParameterExtractor - .getSigType(request)); + signParameter.setSignatureProfileId(profile); ByteArrayDataSink dataSink = new ByteArrayDataSink(); signParameter.setOutput(dataSink); diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/ExternSignServlet.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/ExternSignServlet.java index 70535573..9d19fd45 100644 --- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/ExternSignServlet.java +++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/ExternSignServlet.java @@ -281,7 +281,8 @@ public class ExternSignServlet extends HttpServlet { } PdfAsHelper.startSignature(request, response, getServletContext(), pdfData, connector, - PdfAsHelper.buildPosString(request, response), transactionId); + PdfAsHelper.buildPosString(request, response), transactionId, PdfAsParameterExtractor + .getSigType(request)); } else if (connector.equals("jks") || connector.equals("moa")) { // start synchronous siganture creation diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/UIEntryPointServlet.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/UIEntryPointServlet.java index 25b2b4c0..755a6c1f 100644 --- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/UIEntryPointServlet.java +++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/UIEntryPointServlet.java @@ -104,7 +104,8 @@ public class UIEntryPointServlet extends HttpServlet { PdfAsHelper.startSignature(req, resp, getServletContext(), pdfAsRequest.getInputData(), connector.toString(), pdfAsRequest.getParameters().getPosition(), - pdfAsRequest.getParameters().getTransactionId()); + pdfAsRequest.getParameters().getTransactionId(), + pdfAsRequest.getParameters().getProfile()); } else { throw new PdfAsWebException("Invalid connector (" + Connector.BKU + " | " + Connector.ONLINEBKU + " | " + Connector.MOBILEBKU + ")"); } -- cgit v1.2.3