From a2b5bfc1203dfe53de937820d8b8dc59afbf56c3 Mon Sep 17 00:00:00 2001 From: Andreas Fitzek Date: Tue, 6 May 2014 13:26:59 +0200 Subject: added web-client, java SOAP client library --- .../gv/egiz/pdfas/web/client/RemotePDFSigner.java | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 pdf-as-web-client/src/main/java/at/gv/egiz/pdfas/web/client/RemotePDFSigner.java (limited to 'pdf-as-web-client/src/main/java/at') diff --git a/pdf-as-web-client/src/main/java/at/gv/egiz/pdfas/web/client/RemotePDFSigner.java b/pdf-as-web-client/src/main/java/at/gv/egiz/pdfas/web/client/RemotePDFSigner.java new file mode 100644 index 00000000..9e80faf5 --- /dev/null +++ b/pdf-as-web-client/src/main/java/at/gv/egiz/pdfas/web/client/RemotePDFSigner.java @@ -0,0 +1,38 @@ +package at.gv.egiz.pdfas.web.client; + +import java.net.URL; + +import javax.xml.namespace.QName; +import javax.xml.ws.BindingProvider; +import javax.xml.ws.Service; +import javax.xml.ws.soap.SOAPBinding; + +import at.gv.egiz.pdfas.api.ws.PDFASSignParameters; +import at.gv.egiz.pdfas.api.ws.PDFASSigning; + +public class RemotePDFSigner implements PDFASSigning { + + private URL urlEndpoint; + private Service service; + + private PDFASSigning proxy; + + public RemotePDFSigner(URL endpoint, boolean useMTOM) { + this.urlEndpoint = endpoint; + QName qname = new QName("http://ws.web.pdfas.egiz.gv.at/", + "PDFASSigningImplService"); + service = Service.create(endpoint, qname); + + proxy = service.getPort(PDFASSigning.class); + + BindingProvider bp = (BindingProvider) proxy; + SOAPBinding binding = (SOAPBinding) bp.getBinding(); + binding.setMTOMEnabled(useMTOM); + } + + public byte[] signPDFDokument(byte[] inputDocument, + PDFASSignParameters parameters) { + return proxy.signPDFDokument(inputDocument, parameters); + } + +} -- cgit v1.2.3