aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-web/src/main/java/at/gv/egiz/pdfas
diff options
context:
space:
mode:
authorAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2014-05-06 15:55:34 +0200
committerAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2014-05-06 15:55:34 +0200
commitaf2d6dad0711f95c280621b94f7ca3da8f91632a (patch)
tree4cc1ec16ca711ed6892cca2c0075177bcc8b9518 /pdf-as-web/src/main/java/at/gv/egiz/pdfas
parenta2b5bfc1203dfe53de937820d8b8dc59afbf56c3 (diff)
downloadpdf-as-4-af2d6dad0711f95c280621b94f7ca3da8f91632a.tar.gz
pdf-as-4-af2d6dad0711f95c280621b94f7ca3da8f91632a.tar.bz2
pdf-as-4-af2d6dad0711f95c280621b94f7ca3da8f91632a.zip
SOAP Bulk Request
Diffstat (limited to 'pdf-as-web/src/main/java/at/gv/egiz/pdfas')
-rw-r--r--pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/ws/PDFASSigningImpl.java39
1 files changed, 39 insertions, 0 deletions
diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/ws/PDFASSigningImpl.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/ws/PDFASSigningImpl.java
index 96829b26..01f9205a 100644
--- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/ws/PDFASSigningImpl.java
+++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/ws/PDFASSigningImpl.java
@@ -1,5 +1,8 @@
package at.gv.egiz.pdfas.web.ws;
+import java.util.ArrayList;
+import java.util.List;
+
import javax.jws.WebService;
import javax.xml.ws.WebServiceException;
import javax.xml.ws.soap.MTOM;
@@ -8,6 +11,8 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import at.gv.egiz.pdfas.api.ws.PDFASSignParameters;
+import at.gv.egiz.pdfas.api.ws.PDFASSignRequest;
+import at.gv.egiz.pdfas.api.ws.PDFASSignResponse;
import at.gv.egiz.pdfas.api.ws.PDFASSigning;
import at.gv.egiz.pdfas.web.config.WebConfiguration;
import at.gv.egiz.pdfas.web.helper.PdfAsHelper;
@@ -33,4 +38,38 @@ public class PDFASSigningImpl implements PDFASSigning {
}
}
+ public PDFASSignResponse signPDFDokument(PDFASSignRequest request) {
+ if(request == null) {
+ logger.warn("SOAP Sign Request is null!");
+ return null;
+ }
+ PDFASSignResponse response = new PDFASSignResponse();
+ try {
+ response.setSignedPDF(signPDFDokument(request.getInputData(), request.getParameters()));
+ } catch(Throwable e) {
+ if(e.getCause() != null) {
+ response.setError(e.getCause().getMessage());
+ } else {
+ response.setError(e.getMessage());
+ }
+ }
+ response.setRequestID(request.getRequestID());
+ return response;
+ }
+
+ public PDFASSignResponse[] signPDFDokument(PDFASSignRequest[] request) {
+ List<PDFASSignResponse> responses = new ArrayList<PDFASSignResponse>();
+ for(int i = 0; i < request.length; i++) {
+ PDFASSignResponse response = signPDFDokument(request[i]);
+ if(response != null) {
+ responses.add(response);
+ }
+ }
+ PDFASSignResponse[] array = new PDFASSignResponse[responses.size()];
+ for(int i = 0; i < responses.size(); i++) {
+ array[i] = responses.get(i);
+ }
+ return array;
+ }
+
}