summaryrefslogtreecommitdiff
path: root/src/test/java/at/gv/util/demo/Clienttests.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/java/at/gv/util/demo/Clienttests.java')
-rw-r--r--src/test/java/at/gv/util/demo/Clienttests.java88
1 files changed, 77 insertions, 11 deletions
diff --git a/src/test/java/at/gv/util/demo/Clienttests.java b/src/test/java/at/gv/util/demo/Clienttests.java
index e233944..b2f90ae 100644
--- a/src/test/java/at/gv/util/demo/Clienttests.java
+++ b/src/test/java/at/gv/util/demo/Clienttests.java
@@ -36,6 +36,7 @@ import javax.xml.bind.JAXBElement;
import javax.xml.namespace.QName;
import javax.xml.transform.TransformerException;
+import org.apache.commons.lang.RandomStringUtils;
import org.apache.cxf.common.util.Base64Utility;
import org.apache.cxf.helpers.IOUtils;
import org.w3c.dom.Element;
@@ -44,6 +45,7 @@ import at.gv.util.BpkUtil;
import at.gv.util.DOMUtils;
import at.gv.util.MiscUtil;
import at.gv.util.client.mis.usp_v2.USPClient;
+import at.gv.util.client.mis_v2.MISV2Client;
import at.gv.util.client.mms.MMSClient;
import at.gv.util.client.szr.SZRClient;
import at.gv.util.client.ur_V5.URClient;
@@ -52,7 +54,12 @@ import at.gv.util.client.ur_V5.URClientException;
import at.gv.util.config.EgovUtilPropertiesConfiguration;
import at.gv.util.data.BPK;
import at.gv.util.ex.EgovUtilException;
+import at.gv.util.wsdl.mis_v2.GetMandatesError;
import at.gv.util.wsdl.szr.SZRException;
+import at.gv.util.xsd.mis_v2.GetMandatesRequestType;
+import at.gv.util.xsd.mis_v2.GetMandatesResponseType;
+import at.gv.util.xsd.mis_v2.PersonInformationType;
+import at.gv.util.xsd.mis_v2.persondata.IdentificationType.Value;
import at.gv.util.xsd.mms.GetMandatesRequest;
import at.gv.util.xsd.mms.GetMandatesRequest.MandateIdentifiers;
import at.gv.util.xsd.mms.GetMandatesResponse;
@@ -134,7 +141,7 @@ public class Clienttests {
SZRClient szrClient = new SZRClient(egovUtilConfiguration);
URClient urClient = new URClient(egovUtilConfiguration, UR_TYPES, ERSB_KEYS, false, true);
MMSClient mmsClient = new MMSClient(egovUtilConfiguration);
-
+ MISV2Client misV2Client = new MISV2Client(egovUtilConfiguration);
PersonInfoType personInfo = new PersonInfoType();
@@ -291,28 +298,87 @@ public class Clienttests {
personName.setFamilyName("Mustermann");
personName.setGivenName("Max");
person.setDateOfBirth("1940-01-01");
+// id.setType(SSPIN_PREFIX + "ZP");
+// id.setValue("nOuO8JELgLMCke6qWSAfNSDPPcM=");
+ id.setType(SSPIN_PREFIX + "ZU");
+ id.setValue("NEK/9ZsnA7e2phK71F/OSdIjwbU=");
+ person.setIdentification(id);
+
+// personName.setFamilyName("Hiptmair");
+// personName.setGivenName("Karl");
+ //person.setDateOfBirth("1968-04-07");
+// id.setType(SSPIN_PREFIX + "ZU");
+// id.setValue("WlDEwRwleyT9gyCRedqhL+vNmBs=");
+
+// id.setType(SSPIN_PREFIX + "ZP");
+// id.setValue("OzlNpKPY4oFt10uu0dQ55G/uaCE=");
+
+ person.setIdentification(id);
+
+
+ //*************************************
+ //MIS v2.0 test
+ GetMandatesRequestType getMandatesRequest = new GetMandatesRequestType();
+ getMandatesRequest.setReqId(RandomStringUtils.randomAlphabetic(10));
+ PersonInformationType pInfo = new PersonInformationType();
+ pInfo.setDateOfBirth(person.getDateOfBirth());
+ pInfo.setGivenName(person.getName().getGivenName());
+ pInfo.setFamilyName(person.getName().getFamilyName());
+ at.gv.util.xsd.mis_v2.persondata.IdentificationType idType = new at.gv.util.xsd.mis_v2.persondata.IdentificationType();
+ idType.setType(person.getIdentification().getType());
+ Value idValue = new Value();
+ idValue.setValue(person.getIdentification().getValue());
+ idType.setValue(idValue );
+ pInfo.setIdentification(idType );
+ getMandatesRequest.setPersonInformation(pInfo );
+
+ try {
+ GetMandatesResponseType getMandatesResp = misV2Client.sendMandateIssueRequest(getMandatesRequest, "https://labda.iaik.tugraz.at:5343/mis/services/GetMandatesRequest");
+ System.out.println("Get result from MIS v2.0 with #" + getMandatesResp.getMisMandate().size() + " mandates");
+
+ } catch (GetMandatesError e) {
+ e.printStackTrace();
+
+ }
+
+ //*************************************
String baseID = szrClient.getStammzahl(personInfo );
- BPK zpBpk = BpkUtil.createBPK(baseID, "ZP");
+ BPK zpBpk;
+ BPK zuBpk;
+ //BPK zuBpk = BpkUtil.createBPK(baseID, "ZU");
+ zuBpk = new BPK("ZU", id.getValue());
+ zpBpk = new BPK("ZP", id.getValue());
+
+// id.setType(SSPIN_PREFIX + zuBpk.getSector());
+// id.setValue(zuBpk.getBpk());
+// person.setDateOfBirth(null);
+// person.setIdentification(id);
+
+
+
// BPK zpBpk = BpkUtil.createBPK(baseID, "ZP-MH");
// System.out.print(zpBpk);
- GetMandatesRequest mmsRequest = new GetMandatesRequest();
- mmsRequest.setBPK(zpBpk.getBpk());
- mmsRequest.setBPKType(BpkUtil.PREFIX_BPK_TYPE + "ZU");
- MandateIdentifiers filters = new MandateIdentifiers();
- filters.getMandateIdentifier().add("GeneralvollmachtBilateral");
- mmsRequest.setMandateIdentifiers(filters );
- GetMandatesResponse mmsResult = mmsClient.sendGetMandatesRequest(mmsRequest, "https://vollmachten.egiz.gv.at/mms-test/services/GetMandatesService");
+// GetMandatesRequest mmsRequest = new GetMandatesRequest();
+// mmsRequest.setBPK(zpBpk.getBpk());
+// mmsRequest.setBPKType(BpkUtil.PREFIX_BPK_TYPE + "ZU");
+// MandateIdentifiers filters = new MandateIdentifiers();
+// filters.getMandateIdentifier().add("GeneralvollmachtBilateral");
+// mmsRequest.setMandateIdentifiers(filters );
+// GetMandatesResponse mmsResult = mmsClient.sendGetMandatesRequest(mmsRequest, "https://vollmachten.egiz.gv.at/mms-test/services/GetMandatesService");
// personInfo.getPerson().setDateOfBirth(null);
-// String test = szrClient.getBPK(personInfo, "BF", "BBA-STA");
+// String test = szrClient.getBPK(personInfo, "ZP", "BBA-STA");
+ String test = szrClient.getBPK(personInfo, "ZP", "BKA");
+ //String test = szrClient.getBPK(personInfo, "ZU", "BKA");
// String encryptedbPK = szrClient.transformBPK(personInfo, zpBpk.getBpk(), SSPIN_PREFIX + "ZP", SSPIN_PREFIX + "WT-UR", "BBA-STA");
- FremdBPKType encryptedbPK = szrClient.transformBPK(personInfo, zpBpk.getBpk(), SSPIN_PREFIX + "ZP", SSPIN_PREFIX + "WT-UR", "BMF");
+// FremdBPKType encryptedbPK = szrClient.transformBPK(personInfo, zpBpk.getBpk(), SSPIN_PREFIX + "ZP", SSPIN_PREFIX + "WT-UR", "BMF");
+ FremdBPKType encryptedbPK = szrClient.transformBPK(personInfo, zuBpk.getBpk(), SSPIN_PREFIX + "ZU", SSPIN_PREFIX + "WT-UR", "BMF");
// String encryptedbPK = szrClient.transformBPK(personInfo, zpBpk.getBpk(), SSPIN_PREFIX + "ZP", SSPIN_PREFIX + "ZU", "ZUSETNVZ");