aboutsummaryrefslogtreecommitdiff
path: root/spss.test/src/at
diff options
context:
space:
mode:
authorgregor <gregor@d688527b-c9ab-4aba-bd8d-4036d912da1d>2003-11-11 22:36:36 +0000
committergregor <gregor@d688527b-c9ab-4aba-bd8d-4036d912da1d>2003-11-11 22:36:36 +0000
commit643b4096cdd0f0ed98f21c9b5b681ed89bcb08dc (patch)
tree9e750c9103ad923b291820bc85fcbd669c2e7900 /spss.test/src/at
parentbc620256eb9b4dc6a33244b1105e58773358dbe6 (diff)
downloadmoa-id-spss-643b4096cdd0f0ed98f21c9b5b681ed89bcb08dc.tar.gz
moa-id-spss-643b4096cdd0f0ed98f21c9b5b681ed89bcb08dc.tar.bz2
moa-id-spss-643b4096cdd0f0ed98f21c9b5b681ed89bcb08dc.zip
git-svn-id: https://joinup.ec.europa.eu/svn/moa-idspss/trunk@51 d688527b-c9ab-4aba-bd8d-4036d912da1d
Diffstat (limited to 'spss.test/src/at')
-rw-r--r--spss.test/src/at/gv/egovernment/moa/spss/client/call/MOACaller.java38
-rw-r--r--spss.test/src/at/gv/egovernment/moa/spss/client/call/SignatureCreationCaller.java23
-rw-r--r--spss.test/src/at/gv/egovernment/moa/spss/client/call/SignatureVerificationCaller.java28
3 files changed, 89 insertions, 0 deletions
diff --git a/spss.test/src/at/gv/egovernment/moa/spss/client/call/MOACaller.java b/spss.test/src/at/gv/egovernment/moa/spss/client/call/MOACaller.java
new file mode 100644
index 000000000..13a06b2fb
--- /dev/null
+++ b/spss.test/src/at/gv/egovernment/moa/spss/client/call/MOACaller.java
@@ -0,0 +1,38 @@
+package at.gv.egovernment.moa.spss.client.call;
+
+import java.rmi.RemoteException;
+import java.util.Vector;
+
+import javax.xml.namespace.QName;
+import javax.xml.rpc.Call;
+import javax.xml.rpc.Service;
+import javax.xml.rpc.ServiceException;
+import javax.xml.rpc.ServiceFactory;
+
+import org.apache.axis.message.SOAPBodyElement;
+import org.w3c.dom.Element;
+
+/**
+ * @author Patrick Peck
+ * @version $Id$
+ */
+public class MOACaller {
+
+ protected Element doCall(QName serviceName, Element request, String endPoint)
+ throws RemoteException, ServiceException, Exception {
+ Service service = ServiceFactory.newInstance().createService(serviceName);
+ Call call = service.createCall();
+ SOAPBodyElement body =
+ new SOAPBodyElement(request);
+ SOAPBodyElement[] params = new SOAPBodyElement[] {body};
+ Vector responses;
+ SOAPBodyElement response;
+
+ call.setTargetEndpointAddress(endPoint);
+ responses = (Vector) call.invoke(params);
+ response = (SOAPBodyElement) responses.get(0);
+
+ return response.getAsDOM();
+ }
+
+}
diff --git a/spss.test/src/at/gv/egovernment/moa/spss/client/call/SignatureCreationCaller.java b/spss.test/src/at/gv/egovernment/moa/spss/client/call/SignatureCreationCaller.java
new file mode 100644
index 000000000..0ca4a23c0
--- /dev/null
+++ b/spss.test/src/at/gv/egovernment/moa/spss/client/call/SignatureCreationCaller.java
@@ -0,0 +1,23 @@
+package at.gv.egovernment.moa.spss.client.call;
+
+import java.rmi.RemoteException;
+
+import javax.xml.namespace.QName;
+import javax.xml.rpc.ServiceException;
+
+import org.w3c.dom.Element;
+
+/**
+ * @author Patrick Peck
+ * @version $Id$
+ */
+public class SignatureCreationCaller extends MOACaller {
+
+ private static final QName SERVICE_QNAME = new QName("SignatureCreation");
+
+ public Element createXMLSignature(Element request, String endPoint)
+ throws ServiceException, RemoteException, Exception {
+ return doCall(SERVICE_QNAME, request, endPoint);
+ }
+
+}
diff --git a/spss.test/src/at/gv/egovernment/moa/spss/client/call/SignatureVerificationCaller.java b/spss.test/src/at/gv/egovernment/moa/spss/client/call/SignatureVerificationCaller.java
new file mode 100644
index 000000000..612a1d345
--- /dev/null
+++ b/spss.test/src/at/gv/egovernment/moa/spss/client/call/SignatureVerificationCaller.java
@@ -0,0 +1,28 @@
+package at.gv.egovernment.moa.spss.client.call;
+
+import java.rmi.RemoteException;
+
+import javax.xml.namespace.QName;
+import javax.xml.rpc.ServiceException;
+
+import org.w3c.dom.Element;
+
+/**
+ * @author Patrick Peck
+ * @version $Id$
+ */
+public class SignatureVerificationCaller extends MOACaller {
+
+ private static final QName SERVICE_QNAME = new QName("SignatureVerification");
+
+ public Element verifyCMSSignature(Element request, String endPoint)
+ throws ServiceException, RemoteException, Exception {
+ return doCall(SERVICE_QNAME, request, endPoint);
+ }
+
+ public Element verifyXMLSignature(Element request, String endPoint)
+ throws ServiceException, RemoteException, Exception {
+ return doCall(SERVICE_QNAME, request, endPoint);
+ }
+
+}