From d0879e9058943c6afa1912ccbeae936db2811f26 Mon Sep 17 00:00:00 2001 From: clemenso Date: Tue, 30 Sep 2008 13:54:54 +0000 Subject: backport to JAXWS2.0 STALService initial connect() git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@76 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../at/gv/egiz/bku/online/applet/BKUWorker.java | 189 ++++++------ .../bku/online/applet/WSSignRequestHandler.java | 4 +- .../at/gv/egiz/stal/client/STALServiceTest.java | 20 +- BKUOnline/pom.xml | 37 ++- .../src/main/custom-binding/stalservice-custom.xml | 14 + .../src/main/custom-binding/staltypes-custom.xml | 27 +- .../egiz/stal/service/impl/STALRequestBroker.java | 8 +- .../stal/service/impl/STALRequestBrokerImpl.java | 324 +++++++++++++++------ .../gv/egiz/stal/service/impl/STALServiceImpl.java | 186 ++++++++---- BKUOnline/src/main/webapp/WEB-INF/wsdl/stal.wsdl | 15 + BKUOnline/src/main/webapp/WEB-INF/wsdl/stal.xsd | 227 ++++++++------- .../egiz/stal/service/STALRequestBrokerTest.java | 57 ++-- .../main/java/at/gv/egiz/stal/HashDataInput.java | 18 +- .../src/main/java/at/gv/egiz/stal/STALRequest.java | 13 +- .../main/java/at/gv/egiz/stal/STALResponse.java | 70 ++--- .../egiz/stal/service/GetHashDataInputFault.java | 22 +- .../stal/service/GetHashDataInputFaultType.java | 98 ------- .../stal/service/GetHashDataInputResponseType.java | 255 ---------------- .../gv/egiz/stal/service/GetHashDataInputType.java | 172 ----------- .../stal/service/GetNextRequestResponseType.java | 114 -------- .../gv/egiz/stal/service/GetNextRequestType.java | 114 -------- .../at/gv/egiz/stal/service/ObjectFactory.java | 212 -------------- .../java/at/gv/egiz/stal/service/STALPortType.java | 44 ++- .../java/at/gv/egiz/stal/service/STALService.java | 32 +- .../java/at/gv/egiz/stal/service/package-info.java | 18 -- .../egiz/stal/service/types/ErrorResponseType.java | 84 ++++++ .../service/types/GetHashDataInputFaultType.java | 82 ++++++ .../types/GetHashDataInputResponseType.java | 239 +++++++++++++++ .../stal/service/types/GetHashDataInputType.java | 156 ++++++++++ .../service/types/GetNextRequestResponseType.java | 106 +++++++ .../stal/service/types/GetNextRequestType.java | 106 +++++++ .../stal/service/types/InfoboxReadRequestType.java | 102 +++++++ .../service/types/InfoboxReadResponseType.java | 62 ++++ .../gv/egiz/stal/service/types/ObjectFactory.java | 199 +++++++++++++ .../egiz/stal/service/types/QuitRequestType.java | 32 ++ .../at/gv/egiz/stal/service/types/RequestType.java | 30 ++ .../gv/egiz/stal/service/types/ResponseType.java | 30 ++ .../egiz/stal/service/types/SignRequestType.java | 97 ++++++ .../egiz/stal/service/types/SignResponseType.java | 62 ++++ .../gv/egiz/stal/service/types/package-info.java | 2 + .../java/at/gv/egiz/stal/util/STALTranslator.java | 109 +++++++ pom.xml | 290 +++++++++--------- .../at/gv/egiz/bku/smccstal/AbstractSMCCSTAL.java | 7 +- 43 files changed, 2425 insertions(+), 1660 deletions(-) delete mode 100644 STALService/src/main/java/at/gv/egiz/stal/service/GetHashDataInputFaultType.java delete mode 100644 STALService/src/main/java/at/gv/egiz/stal/service/GetHashDataInputResponseType.java delete mode 100644 STALService/src/main/java/at/gv/egiz/stal/service/GetHashDataInputType.java delete mode 100644 STALService/src/main/java/at/gv/egiz/stal/service/GetNextRequestResponseType.java delete mode 100644 STALService/src/main/java/at/gv/egiz/stal/service/GetNextRequestType.java delete mode 100644 STALService/src/main/java/at/gv/egiz/stal/service/ObjectFactory.java delete mode 100644 STALService/src/main/java/at/gv/egiz/stal/service/package-info.java create mode 100644 STALService/src/main/java/at/gv/egiz/stal/service/types/ErrorResponseType.java create mode 100644 STALService/src/main/java/at/gv/egiz/stal/service/types/GetHashDataInputFaultType.java create mode 100644 STALService/src/main/java/at/gv/egiz/stal/service/types/GetHashDataInputResponseType.java create mode 100644 STALService/src/main/java/at/gv/egiz/stal/service/types/GetHashDataInputType.java create mode 100644 STALService/src/main/java/at/gv/egiz/stal/service/types/GetNextRequestResponseType.java create mode 100644 STALService/src/main/java/at/gv/egiz/stal/service/types/GetNextRequestType.java create mode 100644 STALService/src/main/java/at/gv/egiz/stal/service/types/InfoboxReadRequestType.java create mode 100644 STALService/src/main/java/at/gv/egiz/stal/service/types/InfoboxReadResponseType.java create mode 100644 STALService/src/main/java/at/gv/egiz/stal/service/types/ObjectFactory.java create mode 100644 STALService/src/main/java/at/gv/egiz/stal/service/types/QuitRequestType.java create mode 100644 STALService/src/main/java/at/gv/egiz/stal/service/types/RequestType.java create mode 100644 STALService/src/main/java/at/gv/egiz/stal/service/types/ResponseType.java create mode 100644 STALService/src/main/java/at/gv/egiz/stal/service/types/SignRequestType.java create mode 100644 STALService/src/main/java/at/gv/egiz/stal/service/types/SignResponseType.java create mode 100644 STALService/src/main/java/at/gv/egiz/stal/service/types/package-info.java create mode 100644 STALService/src/main/java/at/gv/egiz/stal/util/STALTranslator.java diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java index 35fe652f..a87b04c4 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java @@ -34,23 +34,23 @@ import at.gv.egiz.bku.smccstal.AbstractSMCCSTAL; import at.gv.egiz.bku.smccstal.SMCCSTALRequestHandler; import at.gv.egiz.smcc.SignatureCard; import at.gv.egiz.smcc.util.SMCCHelper; -import at.gv.egiz.stal.ErrorResponse; -import at.gv.egiz.stal.InfoboxReadRequest; import at.gv.egiz.stal.QuitRequest; import at.gv.egiz.stal.STALRequest; import at.gv.egiz.stal.STALResponse; -import at.gv.egiz.stal.SignRequest; -import at.gv.egiz.stal.service.GetNextRequestResponseType; -import at.gv.egiz.stal.service.GetNextRequestType; -import at.gv.egiz.stal.service.ObjectFactory; +import at.gv.egiz.stal.service.types.GetNextRequestResponseType; +import at.gv.egiz.stal.service.types.GetNextRequestType; +import at.gv.egiz.stal.service.types.ObjectFactory; import at.gv.egiz.stal.service.STALPortType; import at.gv.egiz.stal.service.STALService; +import at.gv.egiz.stal.service.types.ErrorResponseType; +import at.gv.egiz.stal.service.types.RequestType; +import at.gv.egiz.stal.service.types.ResponseType; +import at.gv.egiz.stal.util.STALTranslator; public class BKUWorker extends AbstractSMCCSTAL implements Runnable, - ActionListener, SMCCSTALRequestHandler { + ActionListener, SMCCSTALRequestHandler { private static Log log = LogFactory.getLog(BKUWorker.class); - protected BKUGUIFacade gui; protected BKUApplet parent; private STALPortType stalPort; @@ -65,7 +65,7 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable, * must not be null */ public BKUWorker(BKUGUIFacade gui, BKUApplet parent, - ResourceBundle errorMessageBundle) { + ResourceBundle errorMessageBundle) { if ((gui == null) || (parent == null) || (errorMessageBundle == null)) { throw new NullPointerException("Parameter must not be set to null"); } @@ -73,7 +73,7 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable, this.parent = parent; this.errorMessages = errorMessageBundle; addRequestHandler(QuitRequest.class, this); - // register SignRequestHandler once we have a webservice port + // register SignRequestHandler once we have a webservice port } /** @@ -111,7 +111,7 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable, } log.debug("Found WSDL url: " + wsdlURL); QName endpointName = new QName("http://www.egiz.gv.at/wsdl/stal", - "STALService"); + "STALService"); STALService stal = new STALService(wsdlURL, endpointName); return stal.getSTALPort(); } @@ -135,49 +135,75 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable, return; } try { - ObjectFactory factory = new ObjectFactory(); - GetNextRequestType nextRequest = factory.createGetNextRequestType(); - String sessionId = parent.getMyAppletParameter(BKUApplet.SESSION_ID); if (sessionId == null) { // use the testsession for testing sessionId = "TestSession"; } - nextRequest.setSessionId(sessionId); - addRequestHandler(SignRequest.class, new WSSignRequestHandler(sessionId, - stalPort)); + addRequestHandler(at.gv.egiz.stal.SignRequest.class, new WSSignRequestHandler(sessionId, stalPort)); + + ObjectFactory of = new ObjectFactory(); + GetNextRequestResponseType nextRequestResp = stalPort.connect(sessionId); do { - GetNextRequestResponseType resp = stalPort.getNextRequest(nextRequest); - log.info("Got " + resp.getRequest().size() + " requests from server."); - List stalRequests = resp.getRequest(); + List requests = nextRequestResp.getInfoboxReadRequestOrSignRequestOrQuitRequest(); + List stalRequests = STALTranslator.translateRequests(requests); + + if (log.isInfoEnabled()) { + StringBuilder sb = new StringBuilder("Received "); + sb.append(stalRequests.size()); + sb.append(" STAL requests: "); + for (STALRequest r : stalRequests) { + sb.append(r.getClass()); + sb.append(' '); + } + log.info(sb.toString()); + } + boolean handle = true; for (STALRequest request : stalRequests) { - if (request instanceof InfoboxReadRequest) { - InfoboxReadRequest infobx = (InfoboxReadRequest) request; - if (infobx.getInfoboxIdentifier().equals("IdentityLink")) { - if (infobx.getDomainIdentifier() == null) { - if (!InternalSSLSocketFactory.getInstance().isEgovAgency()) { - handle = false; - } + if (request instanceof at.gv.egiz.stal.InfoboxReadRequest) { + at.gv.egiz.stal.InfoboxReadRequest r = (at.gv.egiz.stal.InfoboxReadRequest) request; + String infoboxId = r.getInfoboxIdentifier(); + String domainId = r.getDomainIdentifier(); + if ("IdentityLink".equals(infoboxId) && domainId == null) { + if (!InternalSSLSocketFactory.getInstance().isEgovAgency()) { + handle = false; } } } } - List responses; + + List responses; if (handle) { - responses = handleRequest(stalRequests); + List stalResponses = handleRequest(stalRequests); + if (log.isInfoEnabled()) { + StringBuilder sb = new StringBuilder(stalResponses.size()); + sb.append(" STAL responses: "); + for (STALResponse r : stalResponses) { + sb.append(r.getClass()); + sb.append(' '); + } + log.info(sb.toString()); + } + responses = STALTranslator.fromSTAL(stalResponses); } else { - responses = new ArrayList(1); - responses.add(new ErrorResponse(6002)); + responses = new ArrayList(1); + ErrorResponseType err = new ErrorResponseType(); + err.setErrorCode(6002); +// err.setErrorMessage(); + responses.add(err); + } + + if (!finished) { + GetNextRequestType nextRequest = of.createGetNextRequestType(); + nextRequest.setSessionId(sessionId); + nextRequest.getInfoboxReadResponseOrSignResponseOrErrorResponse().addAll(responses); + nextRequestResp = stalPort.getNextRequest(nextRequest); } - log.info("Got " + responses.size() + " responses."); - nextRequest = factory.createGetNextRequestType(); - nextRequest.setSessionId(sessionId); - nextRequest.getResponse().addAll(responses); } while (!finished); log.info("Done " + Thread.currentThread().getName()); - // gui.showWelcomeDialog(); } catch (Exception ex) { + log.error(ex.getMessage(), ex); gui.showErrorDialog("Sorry, an internal error occured: " + ex.getMessage()); try { waitForAction(); @@ -196,20 +222,17 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable, URL url = null; if (redirectURL != null) { try { - url = new URL(parent.getCodeBase(), redirectURL + ";jsessionid=" - + parent.getMyAppletParameter(BKUApplet.SESSION_ID)); + url = new URL(parent.getCodeBase(), redirectURL + ";jsessionid=" + parent.getMyAppletParameter(BKUApplet.SESSION_ID)); } catch (MalformedURLException ex) { - log.warn("Parameter 'redirectURL': " + redirectURL - + " not a valid URL.", ex); - // gui.showErrorDialog(errorMsg, okListener, actionCommand) + log.warn("Parameter 'redirectURL': " + redirectURL + " not a valid URL.", ex); + // gui.showErrorDialog(errorMsg, okListener, actionCommand) } if (url != null) { if (redirectTarget == null) { log.info("Done. Trying to redirect to " + url + " ..."); parent.getAppletContext().showDocument(url); } else { - log.info("Done. Trying to redirect to " + url + " (target=" - + redirectTarget + ") ..."); + log.info("Done. Trying to redirect to " + url + " (target=" + redirectTarget + ") ..."); parent.getAppletContext().showDocument(url, redirectTarget); } } @@ -253,48 +276,48 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable, int oldValue = SMCCHelper.PC_SC_NOT_SUPPORTED; // this is a save default while ((signatureCard == null) && (!actionPerformed)) { switch (smccHelper.getResultCode()) { - case SMCCHelper.PC_SC_NOT_SUPPORTED: - actionCommandList.clear(); - actionCommandList.add("ok"); - gui.showErrorDialog(errorMessages.getString("nopcscsupport"), this, - "ok"); - try { - waitForAction(); - } catch (InterruptedException e) { - log.error(e); - } - return true; - case SMCCHelper.TERMINAL_NOT_PRESENT: - actionCommandList.clear(); - actionCommandList.add("ok"); - gui.showErrorDialog(errorMessages.getString("nocardterminal"), this, - "ok"); - try { - waitForAction(); - } catch (InterruptedException e) { - log.error(e); - } - return true; - case SMCCHelper.CARD_NOT_SUPPORTED: - if (oldValue != SMCCHelper.CARD_NOT_SUPPORTED) { + case SMCCHelper.PC_SC_NOT_SUPPORTED: actionCommandList.clear(); - actionCommandList.add("cancel"); - gui.showCardNotSupportedDialog(this, "cancel"); - oldValue = SMCCHelper.CARD_NOT_SUPPORTED; - } - break; - case SMCCHelper.NO_CARD: - if (oldValue != SMCCHelper.NO_CARD) { + actionCommandList.add("ok"); + gui.showErrorDialog(errorMessages.getString("nopcscsupport"), this, + "ok"); + try { + waitForAction(); + } catch (InterruptedException e) { + log.error(e); + } + return true; + case SMCCHelper.TERMINAL_NOT_PRESENT: actionCommandList.clear(); - actionCommandList.add("cancel"); - gui.showInsertCardDialog(this, "cancel"); - oldValue = SMCCHelper.NO_CARD; - } - break; - case SMCCHelper.CARD_FOUND: - // gui.showWaitDialog(null); - signatureCard = smccHelper.getSignatureCard(errorMessages.getLocale()); - return false; + actionCommandList.add("ok"); + gui.showErrorDialog(errorMessages.getString("nocardterminal"), this, + "ok"); + try { + waitForAction(); + } catch (InterruptedException e) { + log.error(e); + } + return true; + case SMCCHelper.CARD_NOT_SUPPORTED: + if (oldValue != SMCCHelper.CARD_NOT_SUPPORTED) { + actionCommandList.clear(); + actionCommandList.add("cancel"); + gui.showCardNotSupportedDialog(this, "cancel"); + oldValue = SMCCHelper.CARD_NOT_SUPPORTED; + } + break; + case SMCCHelper.NO_CARD: + if (oldValue != SMCCHelper.NO_CARD) { + actionCommandList.clear(); + actionCommandList.add("cancel"); + gui.showInsertCardDialog(this, "cancel"); + oldValue = SMCCHelper.NO_CARD; + } + break; + case SMCCHelper.CARD_FOUND: + // gui.showWaitDialog(null); + signatureCard = smccHelper.getSignatureCard(errorMessages.getLocale()); + return false; } smccHelper.update(3000); } diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/WSSignRequestHandler.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/WSSignRequestHandler.java index 6dae264c..5f422164 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/WSSignRequestHandler.java +++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/WSSignRequestHandler.java @@ -20,9 +20,9 @@ import at.gv.egiz.bku.smccstal.SMCCSTALRequestHandler; import at.gv.egiz.bku.smccstal.SignRequestHandler; import at.gv.egiz.stal.HashDataInput; import at.gv.egiz.stal.impl.ByteArrayHashDataInput; -import at.gv.egiz.stal.service.GetHashDataInputResponseType; -import at.gv.egiz.stal.service.GetHashDataInputType; import at.gv.egiz.stal.service.STALPortType; +import at.gv.egiz.stal.service.types.GetHashDataInputResponseType; +import at.gv.egiz.stal.service.types.GetHashDataInputType; import at.gv.egiz.stal.signedinfo.DigestMethodType; import at.gv.egiz.stal.signedinfo.ReferenceType; import java.security.DigestException; diff --git a/BKUApplet/src/test/java/at/gv/egiz/stal/client/STALServiceTest.java b/BKUApplet/src/test/java/at/gv/egiz/stal/client/STALServiceTest.java index 9b58798d..63da8225 100644 --- a/BKUApplet/src/test/java/at/gv/egiz/stal/client/STALServiceTest.java +++ b/BKUApplet/src/test/java/at/gv/egiz/stal/client/STALServiceTest.java @@ -33,12 +33,14 @@ import org.junit.Test; import at.gv.egiz.stal.InfoboxReadRequest; import at.gv.egiz.stal.STALRequest; import at.gv.egiz.stal.service.GetHashDataInputFault; -import at.gv.egiz.stal.service.GetHashDataInputResponseType; -import at.gv.egiz.stal.service.GetHashDataInputType; -import at.gv.egiz.stal.service.GetNextRequestResponseType; -import at.gv.egiz.stal.service.GetNextRequestType; import at.gv.egiz.stal.service.STALPortType; import at.gv.egiz.stal.service.STALService; +import at.gv.egiz.stal.service.types.GetHashDataInputResponseType; +import at.gv.egiz.stal.service.types.GetHashDataInputType; +import at.gv.egiz.stal.service.types.GetNextRequestResponseType; +import at.gv.egiz.stal.service.types.GetNextRequestType; +import at.gv.egiz.stal.service.types.InfoboxReadRequestType; +import at.gv.egiz.stal.service.types.RequestType; /** * @@ -60,11 +62,11 @@ public class STALServiceTest { // req.getResponse().add(new ErrorResponse(1234)); GetNextRequestResponseType nrResp = port.getNextRequest(nrReq); assertNotNull(nrResp); - System.out.println("got response: " + nrResp.getRequest().size()); - for (STALRequest stalReq : nrResp.getRequest()) { - if (stalReq instanceof InfoboxReadRequest) { - String ibid = ((InfoboxReadRequest) stalReq).getInfoboxIdentifier(); - String did = ((InfoboxReadRequest) stalReq).getDomainIdentifier(); + System.out.println("got response: " + nrResp.getInfoboxReadRequestOrSignRequestOrQuitRequest().size()); + for (RequestType stalReq : nrResp.getInfoboxReadRequestOrSignRequestOrQuitRequest()) { + if (stalReq instanceof InfoboxReadRequestType) { + String ibid = ((InfoboxReadRequestType) stalReq).getInfoboxIdentifier(); + String did = ((InfoboxReadRequestType) stalReq).getDomainIdentifier(); System.out.println(" received InfoboxReadRequest for " + ibid + ", " + did); } else { System.out.println(" received STAL request " + stalReq.getClass().getName()); diff --git a/BKUOnline/pom.xml b/BKUOnline/pom.xml index e699d16b..5cdf5356 100644 --- a/BKUOnline/pom.xml +++ b/BKUOnline/pom.xml @@ -72,6 +72,7 @@ com.sun.xml.ws jaxws-rt 2.1.4 + - maven-war-plugin diff --git a/BKUOnline/src/main/custom-binding/stalservice-custom.xml b/BKUOnline/src/main/custom-binding/stalservice-custom.xml index 384b04f7..9c35cbdf 100644 --- a/BKUOnline/src/main/custom-binding/stalservice-custom.xml +++ b/BKUOnline/src/main/custom-binding/stalservice-custom.xml @@ -42,6 +42,20 @@ + + + + Initial connection, get the first request. + + + + + + + true + false + + diff --git a/BKUOnline/src/main/custom-binding/staltypes-custom.xml b/BKUOnline/src/main/custom-binding/staltypes-custom.xml index 2ea42082..3e150363 100644 --- a/BKUOnline/src/main/custom-binding/staltypes-custom.xml +++ b/BKUOnline/src/main/custom-binding/staltypes-custom.xml @@ -35,36 +35,13 @@ - + - + - - - - - - - - - - - - diff --git a/BKUOnline/src/main/java/at/gv/egiz/stal/service/impl/STALRequestBroker.java b/BKUOnline/src/main/java/at/gv/egiz/stal/service/impl/STALRequestBroker.java index 560282ac..af886eec 100644 --- a/BKUOnline/src/main/java/at/gv/egiz/stal/service/impl/STALRequestBroker.java +++ b/BKUOnline/src/main/java/at/gv/egiz/stal/service/impl/STALRequestBroker.java @@ -22,8 +22,8 @@ package at.gv.egiz.stal.service.impl; import at.gv.egiz.stal.HashDataInput; import at.gv.egiz.stal.STAL; -import at.gv.egiz.stal.STALRequest; -import at.gv.egiz.stal.STALResponse; +import at.gv.egiz.stal.service.types.RequestType; +import at.gv.egiz.stal.service.types.ResponseType; import java.util.List; /** @@ -35,7 +35,9 @@ public interface STALRequestBroker extends STAL { public static final int ERR_6000 = 6000; public static final long DEFAULT_TIMEOUT_MS = 1000*60*5; //5mn - public List nextRequest(List response); + public List connect(); + + public List nextRequest(List response); public List getHashDataInput(); } diff --git a/BKUOnline/src/main/java/at/gv/egiz/stal/service/impl/STALRequestBrokerImpl.java b/BKUOnline/src/main/java/at/gv/egiz/stal/service/impl/STALRequestBrokerImpl.java index dc3cc6d3..bfa83dd4 100644 --- a/BKUOnline/src/main/java/at/gv/egiz/stal/service/impl/STALRequestBrokerImpl.java +++ b/BKUOnline/src/main/java/at/gv/egiz/stal/service/impl/STALRequestBrokerImpl.java @@ -22,10 +22,17 @@ package at.gv.egiz.stal.service.impl; import at.gv.egiz.stal.ErrorResponse; import at.gv.egiz.stal.HashDataInput; +import at.gv.egiz.stal.InfoboxReadRequest; import at.gv.egiz.stal.QuitRequest; import at.gv.egiz.stal.STALRequest; import at.gv.egiz.stal.STALResponse; import at.gv.egiz.stal.SignRequest; +import at.gv.egiz.stal.service.types.InfoboxReadRequestType; +import at.gv.egiz.stal.service.types.QuitRequestType; +import at.gv.egiz.stal.service.types.RequestType; +import at.gv.egiz.stal.service.types.ResponseType; +import at.gv.egiz.stal.service.types.SignRequestType; +import at.gv.egiz.stal.util.STALTranslator; import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -48,18 +55,26 @@ public class STALRequestBrokerImpl implements STALRequestBroker { private static final Log log = LogFactory.getLog(STALRequestBrokerImpl.class); - private boolean expectingResponse = false; +// private boolean expectingResponse = false; private boolean interrupted = false; - private final RequestsMonitor reqMon = new RequestsMonitor(); - private final ResponsesMonitor respMon = new ResponsesMonitor(); +// private final RequestsMonitor reqMon = new RequestsMonitor(); +// private final ResponsesMonitor respMon = new ResponsesMonitor(); + + protected ArrayList requests; + protected ArrayList responses; + + protected ArrayList hashDataInputs; private long timeout; public STALRequestBrokerImpl(long timeoutMillisec) { if (timeoutMillisec <= 0) timeoutMillisec = DEFAULT_TIMEOUT_MS; - this.timeout = timeoutMillisec; + timeout = timeoutMillisec; + requests = new ArrayList(); + responses = new ArrayList(); + hashDataInputs = new ArrayList(); } /** @@ -73,52 +88,80 @@ public class STALRequestBrokerImpl implements STALRequestBroker { * @pre requests: either single SignRequest, QuitRequest or multiple ReadInfoboxRequests */ @Override - public List handleRequest(List requests) { + public List handleRequest(List stalRequests) { if (interrupted) { return null; } try { - synchronized (reqMon) { + synchronized (requests) { log.trace("produce request"); - reqMon.produce(requests); - reqMon.setHashDataInput(null); - for (STALRequest request : requests) { - if (request instanceof SignRequest) { - log.trace("Received SignRequest, keep HashDataInput."); - reqMon.setHashDataInput(((SignRequest) request).getHashDataInput()); - break; - } else if (request instanceof QuitRequest) { - log.trace("Received QuitRequest, do not wait for responses."); - log.trace("notifying request consumers"); - reqMon.notify(); - return new ArrayList(); - } else if (log.isTraceEnabled()) { - log.trace("Received STAL request: " + request.getClass().getName()); + requests.clear(); + hashDataInputs.clear(); +// reqMon.produce(requests); +// reqMon.setHashDataInput(null); + + for (STALRequest stalRequest : stalRequests) { + if (stalRequest instanceof SignRequest) { + log.trace("Received SignRequest, keep HashDataInput."); + SignRequestType req = new SignRequestType(); + req.setKeyIdentifier(((SignRequest) stalRequest).getKeyIdentifier()); + req.setSignedInfo(((SignRequest) stalRequest).getSignedInfo()); + requests.add(req); + hashDataInputs.addAll(((SignRequest) stalRequest).getHashDataInput()); + break; + } else if (stalRequest instanceof InfoboxReadRequest) { + log.trace("Received InfoboxReadRequest"); + InfoboxReadRequestType req = new InfoboxReadRequestType(); + req.setInfoboxIdentifier(((InfoboxReadRequest) stalRequest).getInfoboxIdentifier()); + req.setDomainIdentifier(((InfoboxReadRequest) stalRequest).getDomainIdentifier()); + requests.add(req); + } else if (stalRequest instanceof QuitRequest) { + log.trace("Received QuitRequest, do not wait for responses."); + requests.add(new QuitRequestType()); + log.trace("notifying request consumers"); + requests.notify(); +// reqMon.notify(); + return new ArrayList(); + } else { + log.error("Received unsupported STAL request: " + stalRequest.getClass().getName() + ", send QUIT"); + requests.clear(); + requests.add(new QuitRequestType()); + log.trace("notifying request consumers"); + requests.notify(); + return new ArrayList(); } } log.trace("notifying request consumers"); - reqMon.notify(); + requests.notify(); +// reqMon.notify(); } - synchronized (respMon) { + synchronized (responses) { //respMon) { long beforeWait = System.currentTimeMillis(); - while (respMon.responses == null) { +// while (respMon.responses == null) { + while (responses.isEmpty()) { log.trace("waiting to consume response"); - respMon.wait(timeout); +// respMon.wait(timeout); + responses.wait(timeout); if (System.currentTimeMillis() - beforeWait >= timeout) { log.warn("timeout while waiting to consume response, cleanup requests"); - reqMon.consume(); //TODO check deadlock? - reqMon.setHashDataInput(null); +// reqMon.consume(); //TODO check deadlock? +// reqMon.setHashDataInput(null); + requests.clear(); //TODO sync on requests? + hashDataInputs.clear(); return Collections.singletonList((STALResponse) new ErrorResponse(ERR_6000)); } } log.trace("consuming responses"); - List responses = respMon.consume(); +// List responses = respMon.consume(); + List resps = STALTranslator.toSTAL(responses); + responses.clear(); log.trace("notifying response producers"); - respMon.notify(); + responses.notify(); +// respMon.notify(); - return responses; + return resps; } } catch (InterruptedException ex) { log.warn("interrupt in handleRequest(): " + ex.getMessage()); @@ -127,6 +170,36 @@ public class STALRequestBrokerImpl implements STALRequestBroker { } } + @Override + public List connect() { + if (interrupted) { + return null; + } + try { + synchronized (requests) { + long beforeWait = System.currentTimeMillis(); + while (requests.isEmpty()) { + log.trace("waiting to consume request"); + requests.wait(timeout); + if (System.currentTimeMillis() - beforeWait >= timeout) { + log.warn("timeout while waiting to consume request"); + return Collections.singletonList((RequestType) new QuitRequestType()); + } + } + log.trace("consume request"); + List reqs = new ArrayList(); + reqs.addAll(requests); + + requests.clear(); + return reqs; + } + } catch (InterruptedException ex) { + log.warn("interrupt in nextRequest(): " + ex.getMessage()); + interrupted = true; + return null; + } + } + /** * This method is thread-safe, except for * an 'initial' call to nextRequest(null) followed by a @@ -139,63 +212,74 @@ public class STALRequestBrokerImpl implements STALRequestBroker { * @return QUIT if expected responses are not provided */ @Override - public List nextRequest(List responses) { + public List nextRequest(List resps) { if (interrupted) { return null; } try { - synchronized (respMon) { - if (responses != null && responses.size() > 0) { - if (!expectingResponse) { - log.warn("Received unexpected response in nextRequest(), return QUIT"); - return Collections.singletonList((STALRequest) new QuitRequest()); - } + synchronized (responses) { //respMon) { + if (resps != null && resps.size() > 0) { +// if (!expectingResponse) { +// log.warn("Received unexpected response in nextRequest(), return QUIT"); +// return Collections.singletonList((RequestType) new QuitRequestType()); +// } long beforeWait = System.currentTimeMillis(); - while (respMon.responses != null) { +// while (respMon.responses != null) { + while (!responses.isEmpty()) { log.trace("waiting to produce response"); - respMon.wait(timeout); +// respMon.wait(timeout); + responses.wait(timeout); if (System.currentTimeMillis() - beforeWait >= timeout) { log.warn("timeout while waiting to produce response"); - return Collections.singletonList((STALRequest) new QuitRequest()); + return Collections.singletonList((RequestType) new QuitRequestType()); } } log.trace("produce response"); - respMon.produce(responses); +// respMon.produce(resps); + responses.addAll(resps); //reset HashDataInputCallback iff SignResponse if (log.isTraceEnabled()) { - for (STALResponse response : responses) { + for (ResponseType response : resps) { log.trace("Received STAL response: " + response.getClass().getName()); } } log.trace("notifying response consumers"); - respMon.notify(); +// respMon.notify(); + responses.notify(); } else { - if (expectingResponse) { - log.warn("Did not receive expected response(s) in nextRequest(), return QUIT"); - return Collections.singletonList((STALRequest) new QuitRequest()); - } - log.trace("expecting non-null response in next nextRequest(response)"); - expectingResponse = true; +// if (expectingResponse) { +// log.warn("Did not receive expected response(s) in nextRequest(), return QUIT"); +// return Collections.singletonList((RequestType) new QuitRequestType()); +// } +// log.trace("expecting non-null response in next nextRequest(response)"); +// expectingResponse = true; + log.error("Received NextRequest without responses, return QUIT"); + return Collections.singletonList((RequestType) new QuitRequestType()); } } - synchronized (reqMon) { + synchronized (requests) { //reqMon) { long beforeWait = System.currentTimeMillis(); - while (reqMon.requests == null) { +// while (reqMon.requests == null) { + while (requests.isEmpty()) { log.trace("waiting to consume request"); - reqMon.wait(timeout); +// reqMon.wait(timeout); + requests.wait(timeout); if (System.currentTimeMillis() - beforeWait >= timeout) { log.warn("timeout while waiting to consume request"); - return Collections.singletonList((STALRequest) new QuitRequest()); + return Collections.singletonList((RequestType) new QuitRequestType()); } } log.trace("consume request"); - List requests = reqMon.consume(); - if (requests.size() > 0 && requests.get(0) instanceof QuitRequest) { - log.trace("expecting no response in next nextRequest()"); - expectingResponse = false; - } - return requests; + List reqs = new ArrayList(); // reqMon.consume(); + reqs.addAll(requests); + +// if (requests.size() > 0 && requests.get(0) instanceof QuitRequestType) { +// log.trace("expecting no response in next nextRequest()"); +// expectingResponse = false; +// } + requests.clear(); + return reqs; } } catch (InterruptedException ex) { log.warn("interrupt in nextRequest(): " + ex.getMessage()); @@ -205,49 +289,95 @@ public class STALRequestBrokerImpl implements STALRequestBroker { } @Override - public synchronized List getHashDataInput() { - log.trace("return " + reqMon.hashDataInput.size() + " current HashDataInput(s) "); - return reqMon.getHashDataInput(); + public List getHashDataInput() { + synchronized (requests) { + log.trace("return " + hashDataInputs.size() + " current HashDataInput(s) "); + return hashDataInputs; //reqMon.getHashDataInput(); + } } @Override public void setLocale(Locale locale) { } - class RequestsMonitor { - List requests; - List hashDataInput; - - void produce(List req) { - requests = req; - } - - synchronized List consume() { - List reqs = requests; - requests = null; - return reqs; - } - - void setHashDataInput(List hdi) { - hashDataInput = hdi; - } - - List getHashDataInput() { - return hashDataInput; - } - } - - class ResponsesMonitor { - List responses; - - void produce(List resp) { - responses = resp; - } - - synchronized List consume() { - List resps = responses; - responses = null; - return resps; - } - } +// class RequestsMonitor { +// List requests; +// List hashDataInput; +// +// void produce(List req) { +// requests = req; +// } +// +// synchronized List consume() { +// List reqs = new ArrayList(); +// for (STALRequest request : requests) { +// if (request instanceof SignRequest) { +// at.gv.egiz.stal.service.types.SignRequest r = new at.gv.egiz.stal.service.types.SignRequest(); +// r.setKeyIdentifier(((SignRequest) request).getKeyIdentifier()); +// r.setSignedInfo(((SignRequest) request).getSignedInfo()); +// reqs.add(r); +// } else if (request instanceof InfoboxReadRequest) { +// at.gv.egiz.stal.service.types.InfoboxReadRequest r = new at.gv.egiz.stal.service.types.InfoboxReadRequest(); +// r.setDomainIdentifier(((InfoboxReadRequest) request).getDomainIdentifier()); +// r.setInfoboxIdentifier(((InfoboxReadRequest) request).getInfoboxIdentifier()); +// reqs.add(r); +// } else if (request instanceof QuitRequest) { +// at.gv.egiz.stal.service.types.QuitRequest r = new at.gv.egiz.stal.service.types.QuitRequest(); +// reqs.add(r); +// } else { +// log.error("unknown STAL request type: " + request.getClass()); +// requests = null; +// return Collections.singletonList((at.gv.egiz.stal.service.types.STALRequest) new at.gv.egiz.stal.service.types.QuitRequest()); +// } +// } +// requests = null; +// return reqs; +// } +// +// void setHashDataInput(List hdi) { +// hashDataInput = hdi; +// } +// +// List getHashDataInput() { +// return hashDataInput; +// } +// } +// +// /** TODO: now, that responses are not nulled, synchronize directly on responses? */ +// class ResponsesMonitor { +// List responses; +// +// void produce(List resp) { +// responses = resp; +// } +// +// synchronized List consume() { +// List resps = new ArrayList(); +// +// for (at.gv.egiz.stal.service.types.STALResponse response : responses) { +// if (response instanceof at.gv.egiz.stal.service.types.InfoboxReadResponse) { +// InfoboxReadResponse r = new InfoboxReadResponse(); +// r.setInfoboxValue(((at.gv.egiz.stal.service.types.InfoboxReadResponse) response).getInfoboxValue()); +// resps.add(r); +// } else if (response instanceof at.gv.egiz.stal.service.types.SignResponse) { +// SignResponse r = new SignResponse(); +// r.setSignatureValue(((at.gv.egiz.stal.service.types.SignResponse) response).getSignatureValue()); +// resps.add(r); +// } else if (response instanceof at.gv.egiz.stal.service.types.ErrorResponse) { +// ErrorResponse r = new ErrorResponse(); +// r.setErrorCode(((at.gv.egiz.stal.service.types.ErrorResponse) response).getErrorCode()); +// r.setErrorMessage(((at.gv.egiz.stal.service.types.ErrorResponse) response).getErrorMessage()); +// resps.add(r); +// } else { +// log.error("unknown STAL response type: " + response.getClass()); +// ErrorResponse r = new ErrorResponse(4000); +// r.setErrorMessage("unknown STAL response type: " + response.getClass()); +// responses = null; +// return Collections.singletonList((STALResponse) r); +// } +// } +// responses = null; +// return resps; +// } +// } } diff --git a/BKUOnline/src/main/java/at/gv/egiz/stal/service/impl/STALServiceImpl.java b/BKUOnline/src/main/java/at/gv/egiz/stal/service/impl/STALServiceImpl.java index d3d6c8db..bcee1e77 100644 --- a/BKUOnline/src/main/java/at/gv/egiz/stal/service/impl/STALServiceImpl.java +++ b/BKUOnline/src/main/java/at/gv/egiz/stal/service/impl/STALServiceImpl.java @@ -22,22 +22,27 @@ package at.gv.egiz.stal.service.impl; import at.gv.egiz.bku.binding.BindingProcessor; import at.gv.egiz.bku.binding.BindingProcessorManager; -import at.gv.egiz.stal.HashDataInput; -import at.gv.egiz.stal.service.*; import at.gv.egiz.bku.binding.Id; import at.gv.egiz.bku.binding.IdFactory; -import at.gv.egiz.stal.ErrorResponse; -import at.gv.egiz.stal.STALRequest; -import at.gv.egiz.stal.STALResponse; -import at.gv.egiz.stal.InfoboxReadRequest; -import at.gv.egiz.stal.QuitRequest; -import at.gv.egiz.stal.SignRequest; - -import java.io.ByteArrayInputStream; + +import at.gv.egiz.stal.HashDataInput; +import at.gv.egiz.stal.service.GetHashDataInputFault; +import at.gv.egiz.stal.service.STALPortType; +import at.gv.egiz.stal.service.types.ErrorResponseType; +import at.gv.egiz.stal.service.types.GetHashDataInputFaultType; +import at.gv.egiz.stal.service.types.GetHashDataInputResponseType; +import at.gv.egiz.stal.service.types.GetHashDataInputType; +import at.gv.egiz.stal.service.types.GetNextRequestResponseType; +import at.gv.egiz.stal.service.types.GetNextRequestType; +import at.gv.egiz.stal.service.types.InfoboxReadRequestType; +import at.gv.egiz.stal.service.types.QuitRequestType; +import at.gv.egiz.stal.service.types.RequestType; +import at.gv.egiz.stal.service.types.ResponseType; +import at.gv.egiz.stal.service.types.SignRequestType; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; -import java.util.Collections; +import java.nio.charset.Charset; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -63,57 +68,90 @@ public class STALServiceImpl implements STALPortType { WebServiceContext wsContext; protected IdFactory idF = IdFactory.getInstance(); + @Override - public GetNextRequestResponseType getNextRequest(GetNextRequestType request) { - - Id sessionId = idF.createId(request.getSessionId()); - - List responsesIn = request.getResponse(); - - GetNextRequestResponseType response = new GetNextRequestResponseType(); - response.setSessionId(sessionId.toString()); + public GetNextRequestResponseType connect(String sessId) { + + if (sessId == null) { + throw new NullPointerException("No session id provided"); + } + + Id sessionId = idF.createId(sessId); + if (log.isDebugEnabled()) { + log.debug("Received Connect [" + sessionId + "]"); + } + if (TEST_SESSION_ID.equals(sessionId)) { - if (responsesIn.size() > 0 && responsesIn.get(0) instanceof ErrorResponse) { - log.info("Received TestSession GetNextRequest(ErrorResponse), returning QuitRequest"); - response.getRequest().add(new QuitRequest()); - } else { - log.info("Received TestSession GetNextRequest, returning InfoboxReadRequest "); - SignRequest sig = new SignRequest(); - sig.setKeyIdentifier("SecureSignatureKeypair"); - sig.setSignedInfo(" id('signed-data-object-0-1214921968-27971781-13578')/node() H1IePEEfGQ2SG03H6LTzw1TpCuM=yV6Q+I60buqR4mMaxA7fi+CV35A=".getBytes()); - response.getRequest().add(sig); - InfoboxReadRequest req = new InfoboxReadRequest(); - req.setInfoboxIdentifier("IdentityLink"); - req.setDomainIdentifier("hansiwurzel"); - response.getRequest().add(req); - req = new InfoboxReadRequest(); - req.setInfoboxIdentifier("CertifiedKeypair"); - response.getRequest().add(req); - req = new InfoboxReadRequest(); - req.setInfoboxIdentifier("SecureSignatureKeypair"); - response.getRequest().add(req); - } - return response; + return getTestSessionNextRequestResponse(null); } + + GetNextRequestResponseType response = new GetNextRequestResponseType(); + response.setSessionId(sessionId.toString()); STALRequestBroker stal = getStal(sessionId); if (stal != null) { + + List requestsOut = ((STALRequestBroker) stal).connect(); + response.getInfoboxReadRequestOrSignRequestOrQuitRequest().addAll(requestsOut); + if (log.isDebugEnabled()) { - StringBuilder sb = new StringBuilder("Received GetNextRequest ["); + StringBuilder sb = new StringBuilder("Returning initial GetNextRequestResponse ["); sb.append(sessionId.toString()); sb.append("] containing "); - sb.append(responsesIn.size()); - sb.append(" responses: "); - for (STALResponse respIn : responsesIn) { - sb.append(respIn); + sb.append(requestsOut.size()); + sb.append(" requests: "); + for (RequestType reqOut : requestsOut) { + sb.append(reqOut.getClass()); sb.append(' '); } + log.debug(sb.toString()); } + } else { + log.error("Failed to get STAL for session " + sessionId + ", returning QuitRequest"); + response.getInfoboxReadRequestOrSignRequestOrQuitRequest().add(new QuitRequestType()); + } + return response; + } + + @Override + public GetNextRequestResponseType getNextRequest(GetNextRequestType request) { + + if (request.getSessionId() == null) { + throw new NullPointerException("No session id provided"); + } + + Id sessionId = idF.createId(request.getSessionId()); + + List responsesIn = request.getInfoboxReadResponseOrSignResponseOrErrorResponse();//getResponse(); + + if (log.isDebugEnabled()) { + StringBuilder sb = new StringBuilder("Received GetNextRequest ["); + sb.append(sessionId.toString()); + sb.append("] containing "); + sb.append(responsesIn.size()); + sb.append(" responses: "); + for (ResponseType respIn : responsesIn) { + sb.append(respIn.getClass()); + sb.append(' '); + } + log.debug(sb.toString()); + } + + if (TEST_SESSION_ID.equals(sessionId)) { + return getTestSessionNextRequestResponse(responsesIn); + } - List requestsOut = ((STALRequestBroker) stal).nextRequest(responsesIn); - response.getRequest().addAll(requestsOut); + GetNextRequestResponseType response = new GetNextRequestResponseType(); + response.setSessionId(sessionId.toString()); + + STALRequestBroker stal = getStal(sessionId); + + if (stal != null) { + + List requestsOut = ((STALRequestBroker) stal).nextRequest(responsesIn); + response.getInfoboxReadRequestOrSignRequestOrQuitRequest().addAll(requestsOut); if (log.isDebugEnabled()) { StringBuilder sb = new StringBuilder("Returning GetNextRequestResponse ["); @@ -121,14 +159,15 @@ public class STALServiceImpl implements STALPortType { sb.append("] containing "); sb.append(requestsOut.size()); sb.append(" requests: "); - for (STALRequest reqOut : requestsOut) { - sb.append(reqOut); + for (RequestType reqOut : requestsOut) { + sb.append(reqOut.getClass()); sb.append(' '); } + log.debug(sb.toString()); } } else { log.error("Failed to get STAL for session " + sessionId + ", returning QuitRequest"); - response.getRequest().add(new QuitRequest()); + response.getInfoboxReadRequestOrSignRequestOrQuitRequest().add(new QuitRequestType()); } return response; } @@ -136,6 +175,10 @@ public class STALServiceImpl implements STALPortType { @Override public GetHashDataInputResponseType getHashDataInput(GetHashDataInputType request) throws GetHashDataInputFault { + if (request.getSessionId() == null) { + throw new NullPointerException("No session id provided"); + } + Id sessionId = idF.createId(request.getSessionId()); if (log.isDebugEnabled()) { @@ -150,8 +193,17 @@ public class STALServiceImpl implements STALPortType { GetHashDataInputResponseType.Reference ref = new GetHashDataInputResponseType.Reference(); ref.setID("Reference-" + TEST_SESSION_ID + "-001"); ref.setMimeType("text/plain"); - ref.setEncoding("UTF-8"); - ref.setValue("hashdatainput-öäüß@€-00000000001".getBytes()); + + Charset charset; + try { + charset = Charset.forName("iso-8859-15"); + ref.setEncoding("iso-8859-15"); + } catch (Exception ex) { + log.warn(ex.getMessage()); + charset = Charset.defaultCharset(); + ref.setEncoding(charset.toString()); + } + ref.setValue("hashdatainput-öäüß@€-00000000001".getBytes(charset)); response.getReference().add(ref); return response; } else { @@ -244,10 +296,40 @@ public class STALServiceImpl implements STALPortType { } private STALRequestBroker getStal(Id sessionId) { + if (log.isTraceEnabled()) { + log.trace("resolve STAL for session " + sessionId); + } MessageContext mCtx = wsContext.getMessageContext(); ServletContext sCtx = (ServletContext) mCtx.get(MessageContext.SERVLET_CONTEXT); BindingProcessorManager bpMgr = (BindingProcessorManager) sCtx.getAttribute(BINDING_PROCESSOR_MANAGER); BindingProcessor bp = bpMgr.getBindingProcessor(sessionId); return (bp == null) ? null : (bp.isFinished() ? null : (STALRequestBroker) bp.getSTAL()); } + + private GetNextRequestResponseType getTestSessionNextRequestResponse(List responsesIn) { + GetNextRequestResponseType response = new GetNextRequestResponseType(); + response.setSessionId(TEST_SESSION_ID.toString()); + + if (responsesIn != null && responsesIn.size() > 0 && responsesIn.get(0) instanceof ErrorResponseType) { + log.info("Received TestSession GetNextRequest(ErrorResponse), returning QuitRequest"); + response.getInfoboxReadRequestOrSignRequestOrQuitRequest().add(new QuitRequestType()); + } else { + log.info("Received TestSession GetNextRequest, returning InfoboxReadRequest "); + SignRequestType sig = new SignRequestType(); + sig.setKeyIdentifier("SecureSignatureKeypair"); + sig.setSignedInfo(" id('signed-data-object-0-1214921968-27971781-13578')/node() H1IePEEfGQ2SG03H6LTzw1TpCuM=yV6Q+I60buqR4mMaxA7fi+CV35A=".getBytes()); + response.getInfoboxReadRequestOrSignRequestOrQuitRequest().add(sig); + InfoboxReadRequestType req = new InfoboxReadRequestType(); + req.setInfoboxIdentifier("IdentityLink"); + req.setDomainIdentifier("hansiwurzel"); + response.getInfoboxReadRequestOrSignRequestOrQuitRequest().add(req); + req = new InfoboxReadRequestType(); + req.setInfoboxIdentifier("CertifiedKeypair"); + response.getInfoboxReadRequestOrSignRequestOrQuitRequest().add(req); + req = new InfoboxReadRequestType(); + req.setInfoboxIdentifier("SecureSignatureKeypair"); + response.getInfoboxReadRequestOrSignRequestOrQuitRequest().add(req); + } + return response; + } } diff --git a/BKUOnline/src/main/webapp/WEB-INF/wsdl/stal.wsdl b/BKUOnline/src/main/webapp/WEB-INF/wsdl/stal.wsdl index a9f16a12..344e5ce2 100644 --- a/BKUOnline/src/main/webapp/WEB-INF/wsdl/stal.wsdl +++ b/BKUOnline/src/main/webapp/WEB-INF/wsdl/stal.wsdl @@ -24,6 +24,9 @@ + + + @@ -40,6 +43,10 @@ + + + + @@ -52,6 +59,14 @@ + + + + + + + + diff --git a/BKUOnline/src/main/webapp/WEB-INF/wsdl/stal.xsd b/BKUOnline/src/main/webapp/WEB-INF/wsdl/stal.xsd index b3c4841a..6f3946dc 100644 --- a/BKUOnline/src/main/webapp/WEB-INF/wsdl/stal.xsd +++ b/BKUOnline/src/main/webapp/WEB-INF/wsdl/stal.xsd @@ -18,121 +18,136 @@ - - - - - - + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + - - - - - + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + - - + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BKUOnline/src/test/java/at/gv/egiz/stal/service/STALRequestBrokerTest.java b/BKUOnline/src/test/java/at/gv/egiz/stal/service/STALRequestBrokerTest.java index d6ce2720..8830a81c 100644 --- a/BKUOnline/src/test/java/at/gv/egiz/stal/service/STALRequestBrokerTest.java +++ b/BKUOnline/src/test/java/at/gv/egiz/stal/service/STALRequestBrokerTest.java @@ -32,6 +32,13 @@ import at.gv.egiz.stal.STALRequest; import at.gv.egiz.stal.STALResponse; import at.gv.egiz.stal.SignResponse; import at.gv.egiz.stal.SignRequest; +import at.gv.egiz.stal.service.types.InfoboxReadRequestType; +import at.gv.egiz.stal.service.types.InfoboxReadResponseType; +import at.gv.egiz.stal.service.types.QuitRequestType; +import at.gv.egiz.stal.service.types.RequestType; +import at.gv.egiz.stal.service.types.ResponseType; +import at.gv.egiz.stal.service.types.SignRequestType; +import at.gv.egiz.stal.service.types.SignResponseType; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; @@ -277,19 +284,19 @@ public class STALRequestBrokerTest { public void run() { try { log.debug("calling stal.nextRequest(oldResponse)"); - STALResponse oldResp = new InfoboxReadResponse(); - List requests = stal.nextRequest(Collections.singletonList(oldResp)); + ResponseType oldResp = new InfoboxReadResponseType(); + List requests = stal.nextRequest(Collections.singletonList(oldResp)); log.debug("got " + requests.size() + " requests. processing..."); Thread.sleep(1); - List responses = new ArrayList(); - for (STALRequest request : requests) { - if (request instanceof InfoboxReadRequest) { + List responses = new ArrayList(); + for (RequestType request : requests) { + if (request instanceof InfoboxReadRequestType) { log.debug("received UNEXPECTED READINFOBOX request"); - InfoboxReadResponse r = new InfoboxReadResponse(); + InfoboxReadResponseType r = new InfoboxReadResponseType(); r.setInfoboxValue("dummyInfobox".getBytes()); responses.add(r); - } else if (request instanceof SignRequest) { + } else if (request instanceof SignRequestType) { log.debug("received UNEXPECTED SIGN request"); @@ -304,10 +311,10 @@ public class STALRequestBrokerTest { log.debug("got HashDataInput " + new String(data)); - SignResponse r = new SignResponse(); + SignResponseType r = new SignResponseType(); r.setSignatureValue("dummySignature".getBytes()); responses.add(r); - } else if (request instanceof QuitRequest) { + } else if (request instanceof QuitRequestType) { log.debug("received EXPECTED QUIT request"); return; } @@ -319,8 +326,8 @@ public class STALRequestBrokerTest { // } log.debug("calling stal.nextRequest with " + responses.size() + " responses"); requests = stal.nextRequest(responses); - for (STALRequest request : requests) { - if (request instanceof QuitRequest) { + for (RequestType request : requests) { + if (request instanceof QuitRequestType) { log.debug("got QUIT request"); } else { log.debug("expected QUIT request, got " + request.getClass().getName()); @@ -342,16 +349,16 @@ public class STALRequestBrokerTest { try { // first call w/ empty response list log.debug("calling stal.nextRequest"); - List requests = stal.nextRequest(null); //new ArrayList()); + List requests = stal.nextRequest(null); //new ArrayList()); log.debug("got " + requests.size() + " requests. processing..."); Thread.sleep(1); - List responses = new ArrayList(); - for (STALRequest request : requests) { - if (request instanceof InfoboxReadRequest) { - InfoboxReadResponse r = new InfoboxReadResponse(); + List responses = new ArrayList(); + for (RequestType request : requests) { + if (request instanceof InfoboxReadRequestType) { + InfoboxReadResponseType r = new InfoboxReadResponseType(); r.setInfoboxValue("dummyInfobox".getBytes()); responses.add(r); - } else if (request instanceof SignRequest) { + } else if (request instanceof SignRequestType) { log.debug("calling stal.getCurrentHashDataInputCallback"); List hdis = stal.getHashDataInput(); @@ -364,10 +371,10 @@ public class STALRequestBrokerTest { log.debug("got HashDataInput " + new String(data)); - SignResponse r = new SignResponse(); + SignResponseType r = new SignResponseType(); r.setSignatureValue("dummySignature".getBytes()); responses.add(r); - } else if (request instanceof QuitRequest) { + } else if (request instanceof QuitRequestType) { log.debug("received UNEXPECTED QUIT request"); return; } @@ -379,8 +386,8 @@ public class STALRequestBrokerTest { // } log.debug("calling stal.nextRequest with " + responses.size() + " responses"); requests = stal.nextRequest(responses); - for (STALRequest request : requests) { - if (request instanceof QuitRequest) { + for (RequestType request : requests) { + if (request instanceof QuitRequestType) { log.debug("got QUIT request"); } else { log.debug("expected QUIT request, got " + request.getClass().getName()); @@ -401,12 +408,12 @@ public class STALRequestBrokerTest { try { // first call w/ empty response list log.debug("calling stal.nextRequest"); - List requests = stal.nextRequest(null); //new ArrayList()); + List requests = stal.nextRequest(null); //new ArrayList()); log.debug("got " + requests.size() + " requests. processing..."); Thread.sleep(1); - for (STALRequest request : requests) { + for (RequestType request : requests) { // if (request instanceof InfoboxReadRequest) { - if (request instanceof SignRequest) { + if (request instanceof SignRequestType) { log.debug("calling stal.getCurrentHashDataInputCallback"); List hdis = stal.getHashDataInput(); assertNotNull(hdis); @@ -416,7 +423,7 @@ public class STALRequestBrokerTest { byte[] data = new byte[hd.available()]; hd.read(data); log.debug("got HashDataInput " + new String(data)); - } else if (request instanceof QuitRequest) { + } else if (request instanceof QuitRequestType) { log.debug("received UNEXPECTED QUIT requests"); return; } diff --git a/STAL/src/main/java/at/gv/egiz/stal/HashDataInput.java b/STAL/src/main/java/at/gv/egiz/stal/HashDataInput.java index 1c648531..62c25fc4 100644 --- a/STAL/src/main/java/at/gv/egiz/stal/HashDataInput.java +++ b/STAL/src/main/java/at/gv/egiz/stal/HashDataInput.java @@ -1,7 +1,19 @@ /* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ +* Copyright 2008 Federal Chancellery Austria and +* Graz University of Technology +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ package at.gv.egiz.stal; diff --git a/STAL/src/main/java/at/gv/egiz/stal/STALRequest.java b/STAL/src/main/java/at/gv/egiz/stal/STALRequest.java index 0c3f88c2..226ac277 100644 --- a/STAL/src/main/java/at/gv/egiz/stal/STALRequest.java +++ b/STAL/src/main/java/at/gv/egiz/stal/STALRequest.java @@ -19,7 +19,8 @@ package at.gv.egiz.stal; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlSeeAlso; +//import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.bind.annotation.XmlTransient; import javax.xml.bind.annotation.XmlType; @@ -43,11 +44,11 @@ import javax.xml.bind.annotation.XmlType; */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "RequestType") -@XmlSeeAlso({ - SignRequest.class, - InfoboxReadRequest.class, - QuitRequest.class -}) +//@XmlSeeAlso({ +// SignRequest.class, +// InfoboxReadRequest.class, +// QuitRequest.class +//}) public abstract class STALRequest { diff --git a/STAL/src/main/java/at/gv/egiz/stal/STALResponse.java b/STAL/src/main/java/at/gv/egiz/stal/STALResponse.java index 91ef3c24..f561a2aa 100644 --- a/STAL/src/main/java/at/gv/egiz/stal/STALResponse.java +++ b/STAL/src/main/java/at/gv/egiz/stal/STALResponse.java @@ -22,7 +22,7 @@ import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlID; import javax.xml.bind.annotation.XmlSchemaType; -import javax.xml.bind.annotation.XmlSeeAlso; +//import javax.xml.bind.annotation.XmlSeeAlso; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; @@ -49,41 +49,41 @@ import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "ResponseType") -@XmlSeeAlso({ - ErrorResponse.class, - SignResponse.class, - InfoboxReadResponse.class -}) +//@XmlSeeAlso({ +// ErrorResponse.class, +// SignResponse.class, +// InfoboxReadResponse.class +//}) public abstract class STALResponse { - @XmlAttribute(name = "Id") - @XmlJavaTypeAdapter(CollapsedStringAdapter.class) - @XmlID - @XmlSchemaType(name = "ID") - protected String id; - - /** - * Gets the value of the id property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getId() { - return id; - } - - /** - * Sets the value of the id property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setId(String value) { - this.id = value; - } +// @XmlAttribute(name = "Id") +// @XmlJavaTypeAdapter(CollapsedStringAdapter.class) +// @XmlID +// @XmlSchemaType(name = "ID") +// protected String id; +// +// /** +// * Gets the value of the id property. +// * +// * @return +// * possible object is +// * {@link String } +// * +// */ +// public String getId() { +// return id; +// } +// +// /** +// * Sets the value of the id property. +// * +// * @param value +// * allowed object is +// * {@link String } +// * +// */ +// public void setId(String value) { +// this.id = value; +// } } diff --git a/STALService/src/main/java/at/gv/egiz/stal/service/GetHashDataInputFault.java b/STALService/src/main/java/at/gv/egiz/stal/service/GetHashDataInputFault.java index 4db6a91c..df42ab47 100644 --- a/STALService/src/main/java/at/gv/egiz/stal/service/GetHashDataInputFault.java +++ b/STALService/src/main/java/at/gv/egiz/stal/service/GetHashDataInputFault.java @@ -1,28 +1,14 @@ -/* -* Copyright 2008 Federal Chancellery Austria and -* Graz University of Technology -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ package at.gv.egiz.stal.service; import javax.xml.ws.WebFault; +import at.gv.egiz.stal.service.types.GetHashDataInputFaultType; + /** * This class was generated by the JAX-WS RI. * JAX-WS RI 2.1.3-b02- - * Generated source version: 2.1 + * Generated source version: 2.0 * */ @WebFault(name = "GetHashDataInputFault", targetNamespace = "http://www.egiz.gv.at/stal") @@ -60,7 +46,7 @@ public class GetHashDataInputFault /** * * @return - * returns fault bean: at.gv.egiz.stal.GetHashDataInputFaultType + * returns fault bean: at.gv.egiz.stal.service.types.GetHashDataInputFaultType */ public GetHashDataInputFaultType getFaultInfo() { return faultInfo; diff --git a/STALService/src/main/java/at/gv/egiz/stal/service/GetHashDataInputFaultType.java b/STALService/src/main/java/at/gv/egiz/stal/service/GetHashDataInputFaultType.java deleted file mode 100644 index 5301a3bd..00000000 --- a/STALService/src/main/java/at/gv/egiz/stal/service/GetHashDataInputFaultType.java +++ /dev/null @@ -1,98 +0,0 @@ -/* -* Copyright 2008 Federal Chancellery Austria and -* Graz University of Technology -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -package at.gv.egiz.stal.service; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for GetHashDataInputFaultType complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="GetHashDataInputFaultType">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="ErrorCode" type="{http://www.w3.org/2001/XMLSchema}int"/>
- *         <element name="ErrorMessage" type="{http://www.w3.org/2001/XMLSchema}string"/>
- *       </sequence>
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "GetHashDataInputFaultType", propOrder = { - "errorCode", - "errorMessage" -}) -public class GetHashDataInputFaultType { - - @XmlElement(name = "ErrorCode") - protected int errorCode; - @XmlElement(name = "ErrorMessage", required = true) - protected String errorMessage; - - /** - * Gets the value of the errorCode property. - * - */ - public int getErrorCode() { - return errorCode; - } - - /** - * Sets the value of the errorCode property. - * - */ - public void setErrorCode(int value) { - this.errorCode = value; - } - - /** - * Gets the value of the errorMessage property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getErrorMessage() { - return errorMessage; - } - - /** - * Sets the value of the errorMessage property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setErrorMessage(String value) { - this.errorMessage = value; - } - -} diff --git a/STALService/src/main/java/at/gv/egiz/stal/service/GetHashDataInputResponseType.java b/STALService/src/main/java/at/gv/egiz/stal/service/GetHashDataInputResponseType.java deleted file mode 100644 index f02d1ce6..00000000 --- a/STALService/src/main/java/at/gv/egiz/stal/service/GetHashDataInputResponseType.java +++ /dev/null @@ -1,255 +0,0 @@ -/* -* Copyright 2008 Federal Chancellery Austria and -* Graz University of Technology -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -package at.gv.egiz.stal.service; - -import java.util.ArrayList; -import java.util.List; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.XmlValue; - - -/** - *

Java class for GetHashDataInputResponseType complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="GetHashDataInputResponseType">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="Reference" maxOccurs="unbounded">
- *           <complexType>
- *             <simpleContent>
- *               <extension base="<http://www.w3.org/2001/XMLSchema>base64Binary">
- *                 <attribute name="ID" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                 <attribute name="MimeType" type="{http://www.w3.org/2001/XMLSchema}string" />
- *                 <attribute name="Encoding" type="{http://www.w3.org/2001/XMLSchema}string" />
- *               </extension>
- *             </simpleContent>
- *           </complexType>
- *         </element>
- *       </sequence>
- *       <attribute name="sessionId" type="{http://www.w3.org/2001/XMLSchema}string" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "GetHashDataInputResponseType", propOrder = { - "reference" -}) -public class GetHashDataInputResponseType { - - @XmlElement(name = "Reference", required = true) - protected List reference; - @XmlAttribute - protected String sessionId; - - /** - * Gets the value of the reference property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the reference property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getReference().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link GetHashDataInputResponseType.Reference } - * - * - */ - public List getReference() { - if (reference == null) { - reference = new ArrayList(); - } - return this.reference; - } - - /** - * Gets the value of the sessionId property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getSessionId() { - return sessionId; - } - - /** - * Sets the value of the sessionId property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setSessionId(String value) { - this.sessionId = value; - } - - - /** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

-     * <complexType>
-     *   <simpleContent>
-     *     <extension base="<http://www.w3.org/2001/XMLSchema>base64Binary">
-     *       <attribute name="ID" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *       <attribute name="MimeType" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *       <attribute name="Encoding" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *     </extension>
-     *   </simpleContent>
-     * </complexType>
-     * 
- * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "", propOrder = { - "value" - }) - public static class Reference { - - @XmlValue - protected byte[] value; - @XmlAttribute(name = "ID") - protected String id; - @XmlAttribute(name = "MimeType") - protected String mimeType; - @XmlAttribute(name = "Encoding") - protected String encoding; - - /** - * Gets the value of the value property. - * - * @return - * possible object is - * byte[] - */ - public byte[] getValue() { - return value; - } - - /** - * Sets the value of the value property. - * - * @param value - * allowed object is - * byte[] - */ - public void setValue(byte[] value) { - this.value = ((byte[]) value); - } - - /** - * Gets the value of the id property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getID() { - return id; - } - - /** - * Sets the value of the id property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setID(String value) { - this.id = value; - } - - /** - * Gets the value of the mimeType property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getMimeType() { - return mimeType; - } - - /** - * Sets the value of the mimeType property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setMimeType(String value) { - this.mimeType = value; - } - - /** - * Gets the value of the encoding property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getEncoding() { - return encoding; - } - - /** - * Sets the value of the encoding property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setEncoding(String value) { - this.encoding = value; - } - - } - -} diff --git a/STALService/src/main/java/at/gv/egiz/stal/service/GetHashDataInputType.java b/STALService/src/main/java/at/gv/egiz/stal/service/GetHashDataInputType.java deleted file mode 100644 index 970b0744..00000000 --- a/STALService/src/main/java/at/gv/egiz/stal/service/GetHashDataInputType.java +++ /dev/null @@ -1,172 +0,0 @@ -/* -* Copyright 2008 Federal Chancellery Austria and -* Graz University of Technology -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -package at.gv.egiz.stal.service; - -import java.util.ArrayList; -import java.util.List; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for GetHashDataInputType complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="GetHashDataInputType">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="Reference" maxOccurs="unbounded">
- *           <complexType>
- *             <complexContent>
- *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *                 <attribute name="ID" type="{http://www.w3.org/2001/XMLSchema}string" />
- *               </restriction>
- *             </complexContent>
- *           </complexType>
- *         </element>
- *       </sequence>
- *       <attribute name="sessionId" type="{http://www.w3.org/2001/XMLSchema}string" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "GetHashDataInputType", propOrder = { - "reference" -}) -public class GetHashDataInputType { - - @XmlElement(name = "Reference", required = true) - protected List reference; - @XmlAttribute - protected String sessionId; - - /** - * Gets the value of the reference property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the reference property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getReference().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link GetHashDataInputType.Reference } - * - * - */ - public List getReference() { - if (reference == null) { - reference = new ArrayList(); - } - return this.reference; - } - - /** - * Gets the value of the sessionId property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getSessionId() { - return sessionId; - } - - /** - * Sets the value of the sessionId property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setSessionId(String value) { - this.sessionId = value; - } - - - /** - *

Java class for anonymous complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

-     * <complexType>
-     *   <complexContent>
-     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
-     *       <attribute name="ID" type="{http://www.w3.org/2001/XMLSchema}string" />
-     *     </restriction>
-     *   </complexContent>
-     * </complexType>
-     * 
- * - * - */ - @XmlAccessorType(XmlAccessType.FIELD) - @XmlType(name = "") - public static class Reference { - - @XmlAttribute(name = "ID") - protected String id; - - /** - * Gets the value of the id property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getID() { - return id; - } - - /** - * Sets the value of the id property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setID(String value) { - this.id = value; - } - - } - -} diff --git a/STALService/src/main/java/at/gv/egiz/stal/service/GetNextRequestResponseType.java b/STALService/src/main/java/at/gv/egiz/stal/service/GetNextRequestResponseType.java deleted file mode 100644 index 7a723431..00000000 --- a/STALService/src/main/java/at/gv/egiz/stal/service/GetNextRequestResponseType.java +++ /dev/null @@ -1,114 +0,0 @@ -/* -* Copyright 2008 Federal Chancellery Austria and -* Graz University of Technology -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -package at.gv.egiz.stal.service; - -import at.gv.egiz.stal.STALRequest; -import java.util.ArrayList; -import java.util.List; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for GetNextRequestResponseType complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="GetNextRequestResponseType">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="Request" type="{http://www.egiz.gv.at/stal}RequestType" maxOccurs="unbounded" minOccurs="0"/>
- *       </sequence>
- *       <attribute name="sessionId" type="{http://www.w3.org/2001/XMLSchema}string" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "GetNextRequestResponseType", propOrder = { - "request" -}) -public class GetNextRequestResponseType { - - @XmlElement(name = "Request") - protected List request; - @XmlAttribute - protected String sessionId; - - /** - * Gets the value of the request property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the request property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getRequest().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link STALRequest } - * - * - */ - public List getRequest() { - if (request == null) { - request = new ArrayList(); - } - return this.request; - } - - /** - * Gets the value of the sessionId property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getSessionId() { - return sessionId; - } - - /** - * Sets the value of the sessionId property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setSessionId(String value) { - this.sessionId = value; - } - -} diff --git a/STALService/src/main/java/at/gv/egiz/stal/service/GetNextRequestType.java b/STALService/src/main/java/at/gv/egiz/stal/service/GetNextRequestType.java deleted file mode 100644 index 410f1d8d..00000000 --- a/STALService/src/main/java/at/gv/egiz/stal/service/GetNextRequestType.java +++ /dev/null @@ -1,114 +0,0 @@ -/* -* Copyright 2008 Federal Chancellery Austria and -* Graz University of Technology -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -package at.gv.egiz.stal.service; - -import at.gv.egiz.stal.STALResponse; -import java.util.ArrayList; -import java.util.List; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlType; - - -/** - *

Java class for GetNextRequestType complex type. - * - *

The following schema fragment specifies the expected content contained within this class. - * - *

- * <complexType name="GetNextRequestType">
- *   <complexContent>
- *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       <sequence>
- *         <element name="Response" type="{http://www.egiz.gv.at/stal}ResponseType" maxOccurs="unbounded" minOccurs="0"/>
- *       </sequence>
- *       <attribute name="sessionId" type="{http://www.w3.org/2001/XMLSchema}string" />
- *     </restriction>
- *   </complexContent>
- * </complexType>
- * 
- * - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "GetNextRequestType", propOrder = { - "response" -}) -public class GetNextRequestType { - - @XmlElement(name = "Response") - protected List response; - @XmlAttribute - protected String sessionId; - - /** - * Gets the value of the response property. - * - *

- * This accessor method returns a reference to the live list, - * not a snapshot. Therefore any modification you make to the - * returned list will be present inside the JAXB object. - * This is why there is not a set method for the response property. - * - *

- * For example, to add a new item, do as follows: - *

-     *    getResponse().add(newItem);
-     * 
- * - * - *

- * Objects of the following type(s) are allowed in the list - * {@link STALResponse } - * - * - */ - public List getResponse() { - if (response == null) { - response = new ArrayList(); - } - return this.response; - } - - /** - * Gets the value of the sessionId property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getSessionId() { - return sessionId; - } - - /** - * Sets the value of the sessionId property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setSessionId(String value) { - this.sessionId = value; - } - -} diff --git a/STALService/src/main/java/at/gv/egiz/stal/service/ObjectFactory.java b/STALService/src/main/java/at/gv/egiz/stal/service/ObjectFactory.java deleted file mode 100644 index 11ad1101..00000000 --- a/STALService/src/main/java/at/gv/egiz/stal/service/ObjectFactory.java +++ /dev/null @@ -1,212 +0,0 @@ -/* -* Copyright 2008 Federal Chancellery Austria and -* Graz University of Technology -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -package at.gv.egiz.stal.service; - - -import at.gv.egiz.stal.ErrorResponse; -import at.gv.egiz.stal.InfoboxReadRequest; -import at.gv.egiz.stal.InfoboxReadResponse; -import at.gv.egiz.stal.QuitRequest; -import at.gv.egiz.stal.SignRequest; -import at.gv.egiz.stal.SignResponse; -import javax.xml.bind.JAXBElement; -import javax.xml.bind.annotation.XmlElementDecl; -import javax.xml.bind.annotation.XmlRegistry; -import javax.xml.namespace.QName; - - -/** - * This object contains factory methods for each - * Java content interface and Java element interface - * generated in the at.gv.egiz.stal package. - *

An ObjectFactory allows you to programatically - * construct new instances of the Java representation - * for XML content. The Java representation of XML - * content can consist of schema derived interfaces - * and classes representing the binding of schema - * type definitions, element declarations and model - * groups. Factory methods for each of these are - * provided in this class. - * - */ -@XmlRegistry -public class ObjectFactory { - - private final static QName _GetHashDataInputFault_QNAME = new QName("http://www.egiz.gv.at/stal", "GetHashDataInputFault"); - private final static QName _GetHashDataInput_QNAME = new QName("http://www.egiz.gv.at/stal", "GetHashDataInput"); - private final static QName _GetNextRequestResponse_QNAME = new QName("http://www.egiz.gv.at/stal", "GetNextRequestResponse"); - private final static QName _GetHashDataInputResponse_QNAME = new QName("http://www.egiz.gv.at/stal", "GetHashDataInputResponse"); - private final static QName _GetNextRequest_QNAME = new QName("http://www.egiz.gv.at/stal", "GetNextRequest"); - - /** - * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: at.gv.egiz.stal - * - */ - public ObjectFactory() { - } - - /** - * Create an instance of {@link GetNextRequestType } - * - */ - public GetNextRequestType createGetNextRequestType() { - return new GetNextRequestType(); - } - - /** - * Create an instance of {@link SignRequest } - * - */ - public SignRequest createSignRequest() { - return new SignRequest(); - } - - /** - * Create an instance of {@link GetHashDataInputResponseType } - * - */ - public GetHashDataInputResponseType createGetHashDataInputResponseType() { - return new GetHashDataInputResponseType(); - } - - /** - * Create an instance of {@link InfoboxReadResponse } - * - */ - public InfoboxReadResponse createInfoboxReadResponse() { - return new InfoboxReadResponse(); - } - - /** - * Create an instance of {@link ErrorResponse } - * - */ - public ErrorResponse createErrorResponse() { - return new ErrorResponse(); - } - - /** - * Create an instance of {@link GetHashDataInputFaultType } - * - */ - public GetHashDataInputFaultType createGetHashDataInputFaultType() { - return new GetHashDataInputFaultType(); - } - - /** - * Create an instance of {@link GetHashDataInputType.Reference } - * - */ - public GetHashDataInputType.Reference createGetHashDataInputTypeReference() { - return new GetHashDataInputType.Reference(); - } - - /** - * Create an instance of {@link InfoboxReadRequest } - * - */ - public InfoboxReadRequest createInfoboxReadRequest() { - return new InfoboxReadRequest(); - } - - /** - * Create an instance of {@link SignResponse } - * - */ - public SignResponse createSignResponse() { - return new SignResponse(); - } - - /** - * Create an instance of {@link GetNextRequestResponseType } - * - */ - public GetNextRequestResponseType createGetNextRequestResponseType() { - return new GetNextRequestResponseType(); - } - - /** - * Create an instance of {@link GetHashDataInputType } - * - */ - public GetHashDataInputType createGetHashDataInputType() { - return new GetHashDataInputType(); - } - - /** - * Create an instance of {@link QuitRequest } - * - */ - public QuitRequest createQuitRequest() { - return new QuitRequest(); - } - - /** - * Create an instance of {@link GetHashDataInputResponseType.Reference } - * - */ - public GetHashDataInputResponseType.Reference createGetHashDataInputResponseTypeReference() { - return new GetHashDataInputResponseType.Reference(); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link GetHashDataInputFaultType }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://www.egiz.gv.at/stal", name = "GetHashDataInputFault") - public JAXBElement createGetHashDataInputFault(GetHashDataInputFaultType value) { - return new JAXBElement(_GetHashDataInputFault_QNAME, GetHashDataInputFaultType.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link GetHashDataInputType }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://www.egiz.gv.at/stal", name = "GetHashDataInput") - public JAXBElement createGetHashDataInput(GetHashDataInputType value) { - return new JAXBElement(_GetHashDataInput_QNAME, GetHashDataInputType.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link GetNextRequestResponseType }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://www.egiz.gv.at/stal", name = "GetNextRequestResponse") - public JAXBElement createGetNextRequestResponse(GetNextRequestResponseType value) { - return new JAXBElement(_GetNextRequestResponse_QNAME, GetNextRequestResponseType.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link GetHashDataInputResponseType }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://www.egiz.gv.at/stal", name = "GetHashDataInputResponse") - public JAXBElement createGetHashDataInputResponse(GetHashDataInputResponseType value) { - return new JAXBElement(_GetHashDataInputResponse_QNAME, GetHashDataInputResponseType.class, null, value); - } - - /** - * Create an instance of {@link JAXBElement }{@code <}{@link GetNextRequestType }{@code >}} - * - */ - @XmlElementDecl(namespace = "http://www.egiz.gv.at/stal", name = "GetNextRequest") - public JAXBElement createGetNextRequest(GetNextRequestType value) { - return new JAXBElement(_GetNextRequest_QNAME, GetNextRequestType.class, null, value); - } - -} diff --git a/STALService/src/main/java/at/gv/egiz/stal/service/STALPortType.java b/STALService/src/main/java/at/gv/egiz/stal/service/STALPortType.java index 8d1f9f9c..6ac6b10a 100644 --- a/STALService/src/main/java/at/gv/egiz/stal/service/STALPortType.java +++ b/STALService/src/main/java/at/gv/egiz/stal/service/STALPortType.java @@ -1,19 +1,3 @@ -/* -* Copyright 2008 Federal Chancellery Austria and -* Graz University of Technology -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ package at.gv.egiz.stal.service; @@ -22,28 +6,42 @@ import javax.jws.WebParam; import javax.jws.WebResult; import javax.jws.WebService; import javax.jws.soap.SOAPBinding; -import javax.xml.bind.annotation.XmlSeeAlso; +import at.gv.egiz.stal.service.types.GetHashDataInputResponseType; +import at.gv.egiz.stal.service.types.GetHashDataInputType; +import at.gv.egiz.stal.service.types.GetNextRequestResponseType; +import at.gv.egiz.stal.service.types.GetNextRequestType; + /** * This class was generated by the JAX-WS RI. * JAX-WS RI 2.1.3-b02- - * Generated source version: 2.1 + * Generated source version: 2.0 * */ @WebService(name = "STALPortType", targetNamespace = "http://www.egiz.gv.at/wsdl/stal") @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE) -@XmlSeeAlso({ - ObjectFactory.class -}) public interface STALPortType { + /** + * Initial connection, get the first request. + * + * @param sessionId + * @return + * returns at.gv.egiz.stal.service.types.GetNextRequestResponseType + */ + @WebMethod + @WebResult(name = "GetNextRequestResponse", targetNamespace = "http://www.egiz.gv.at/stal", partName = "part1") + public GetNextRequestResponseType connect( + @WebParam(name = "SessionId", targetNamespace = "http://www.egiz.gv.at/stal", partName = "part1") + String sessionId); + /** * Fetch the next request. * * @param request * @return - * returns at.gv.egiz.stal.GetNextRequestResponseType + * returns at.gv.egiz.stal.service.types.GetNextRequestResponseType */ @WebMethod(operationName = "nextRequest") @WebResult(name = "GetNextRequestResponse", targetNamespace = "http://www.egiz.gv.at/stal", partName = "part1") @@ -56,7 +54,7 @@ public interface STALPortType { * * @param request * @return - * returns at.gv.egiz.stal.GetHashDataInputResponseType + * returns at.gv.egiz.stal.service.types.GetHashDataInputResponseType * @throws GetHashDataInputFault */ @WebMethod diff --git a/STALService/src/main/java/at/gv/egiz/stal/service/STALService.java b/STALService/src/main/java/at/gv/egiz/stal/service/STALService.java index 7023b02a..d4b58af9 100644 --- a/STALService/src/main/java/at/gv/egiz/stal/service/STALService.java +++ b/STALService/src/main/java/at/gv/egiz/stal/service/STALService.java @@ -1,36 +1,18 @@ -/* -* Copyright 2008 Federal Chancellery Austria and -* Graz University of Technology -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ package at.gv.egiz.stal.service; -import java.net.MalformedURLException; import java.net.URL; import java.util.logging.Logger; import javax.xml.namespace.QName; import javax.xml.ws.Service; import javax.xml.ws.WebEndpoint; import javax.xml.ws.WebServiceClient; -import javax.xml.ws.WebServiceFeature; /** * This class was generated by the JAX-WS RI. * JAX-WS RI 2.1.3-b02- - * Generated source version: 2.1 + * Generated source version: 2.0 * */ @WebServiceClient(name = "STALService", targetNamespace = "http://www.egiz.gv.at/wsdl/stal") @@ -54,16 +36,4 @@ public class STALService return super.getPort(new QName("http://www.egiz.gv.at/wsdl/stal", "STALPort"), STALPortType.class); } - /** - * - * @param features - * A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the features parameter will have their default values. - * @return - * returns STALPortType - */ - @WebEndpoint(name = "STALPort") - public STALPortType getSTALPort(WebServiceFeature... features) { - return super.getPort(new QName("http://www.egiz.gv.at/wsdl/stal", "STALPort"), STALPortType.class, features); - } - } diff --git a/STALService/src/main/java/at/gv/egiz/stal/service/package-info.java b/STALService/src/main/java/at/gv/egiz/stal/service/package-info.java deleted file mode 100644 index eb3e29dd..00000000 --- a/STALService/src/main/java/at/gv/egiz/stal/service/package-info.java +++ /dev/null @@ -1,18 +0,0 @@ -/* -* Copyright 2008 Federal Chancellery Austria and -* Graz University of Technology -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.egiz.gv.at/stal", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) -package at.gv.egiz.stal.service; diff --git a/STALService/src/main/java/at/gv/egiz/stal/service/types/ErrorResponseType.java b/STALService/src/main/java/at/gv/egiz/stal/service/types/ErrorResponseType.java new file mode 100644 index 00000000..14ae0d39 --- /dev/null +++ b/STALService/src/main/java/at/gv/egiz/stal/service/types/ErrorResponseType.java @@ -0,0 +1,84 @@ + +package at.gv.egiz.stal.service.types; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for ErrorResponseType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="ErrorResponseType">
+ *   <complexContent>
+ *     <extension base="{http://www.egiz.gv.at/stal}ResponseType">
+ *       <sequence>
+ *         <element name="ErrorCode" type="{http://www.w3.org/2001/XMLSchema}int"/>
+ *         <element name="ErrorMessage" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *       </sequence>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "ErrorResponseType", propOrder = { + "errorCode", + "errorMessage" +}) +public class ErrorResponseType + extends ResponseType +{ + + @XmlElement(name = "ErrorCode") + protected int errorCode; + @XmlElement(name = "ErrorMessage", required = true) + protected String errorMessage; + + /** + * Gets the value of the errorCode property. + * + */ + public int getErrorCode() { + return errorCode; + } + + /** + * Sets the value of the errorCode property. + * + */ + public void setErrorCode(int value) { + this.errorCode = value; + } + + /** + * Gets the value of the errorMessage property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getErrorMessage() { + return errorMessage; + } + + /** + * Sets the value of the errorMessage property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setErrorMessage(String value) { + this.errorMessage = value; + } + +} diff --git a/STALService/src/main/java/at/gv/egiz/stal/service/types/GetHashDataInputFaultType.java b/STALService/src/main/java/at/gv/egiz/stal/service/types/GetHashDataInputFaultType.java new file mode 100644 index 00000000..bf9f96ab --- /dev/null +++ b/STALService/src/main/java/at/gv/egiz/stal/service/types/GetHashDataInputFaultType.java @@ -0,0 +1,82 @@ + +package at.gv.egiz.stal.service.types; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for GetHashDataInputFaultType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="GetHashDataInputFaultType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="ErrorCode" type="{http://www.w3.org/2001/XMLSchema}int"/>
+ *         <element name="ErrorMessage" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "GetHashDataInputFaultType", propOrder = { + "errorCode", + "errorMessage" +}) +public class GetHashDataInputFaultType { + + @XmlElement(name = "ErrorCode") + protected int errorCode; + @XmlElement(name = "ErrorMessage", required = true) + protected String errorMessage; + + /** + * Gets the value of the errorCode property. + * + */ + public int getErrorCode() { + return errorCode; + } + + /** + * Sets the value of the errorCode property. + * + */ + public void setErrorCode(int value) { + this.errorCode = value; + } + + /** + * Gets the value of the errorMessage property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getErrorMessage() { + return errorMessage; + } + + /** + * Sets the value of the errorMessage property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setErrorMessage(String value) { + this.errorMessage = value; + } + +} diff --git a/STALService/src/main/java/at/gv/egiz/stal/service/types/GetHashDataInputResponseType.java b/STALService/src/main/java/at/gv/egiz/stal/service/types/GetHashDataInputResponseType.java new file mode 100644 index 00000000..7536d936 --- /dev/null +++ b/STALService/src/main/java/at/gv/egiz/stal/service/types/GetHashDataInputResponseType.java @@ -0,0 +1,239 @@ + +package at.gv.egiz.stal.service.types; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlValue; + + +/** + *

Java class for GetHashDataInputResponseType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="GetHashDataInputResponseType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="Reference" maxOccurs="unbounded">
+ *           <complexType>
+ *             <simpleContent>
+ *               <extension base="<http://www.w3.org/2001/XMLSchema>base64Binary">
+ *                 <attribute name="ID" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                 <attribute name="MimeType" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *                 <attribute name="Encoding" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *               </extension>
+ *             </simpleContent>
+ *           </complexType>
+ *         </element>
+ *       </sequence>
+ *       <attribute name="SessionId" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "GetHashDataInputResponseType", propOrder = { + "reference" +}) +public class GetHashDataInputResponseType { + + @XmlElement(name = "Reference", required = true) + protected List reference; + @XmlAttribute(name = "SessionId") + protected String sessionId; + + /** + * Gets the value of the reference property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the reference property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getReference().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link GetHashDataInputResponseType.Reference } + * + * + */ + public List getReference() { + if (reference == null) { + reference = new ArrayList(); + } + return this.reference; + } + + /** + * Gets the value of the sessionId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSessionId() { + return sessionId; + } + + /** + * Sets the value of the sessionId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSessionId(String value) { + this.sessionId = value; + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+     * <complexType>
+     *   <simpleContent>
+     *     <extension base="<http://www.w3.org/2001/XMLSchema>base64Binary">
+     *       <attribute name="ID" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *       <attribute name="MimeType" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *       <attribute name="Encoding" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *     </extension>
+     *   </simpleContent>
+     * </complexType>
+     * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "", propOrder = { + "value" + }) + public static class Reference { + + @XmlValue + protected byte[] value; + @XmlAttribute(name = "ID") + protected String id; + @XmlAttribute(name = "MimeType") + protected String mimeType; + @XmlAttribute(name = "Encoding") + protected String encoding; + + /** + * Gets the value of the value property. + * + * @return + * possible object is + * byte[] + */ + public byte[] getValue() { + return value; + } + + /** + * Sets the value of the value property. + * + * @param value + * allowed object is + * byte[] + */ + public void setValue(byte[] value) { + this.value = ((byte[]) value); + } + + /** + * Gets the value of the id property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getID() { + return id; + } + + /** + * Sets the value of the id property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setID(String value) { + this.id = value; + } + + /** + * Gets the value of the mimeType property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getMimeType() { + return mimeType; + } + + /** + * Sets the value of the mimeType property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setMimeType(String value) { + this.mimeType = value; + } + + /** + * Gets the value of the encoding property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getEncoding() { + return encoding; + } + + /** + * Sets the value of the encoding property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setEncoding(String value) { + this.encoding = value; + } + + } + +} diff --git a/STALService/src/main/java/at/gv/egiz/stal/service/types/GetHashDataInputType.java b/STALService/src/main/java/at/gv/egiz/stal/service/types/GetHashDataInputType.java new file mode 100644 index 00000000..5309482a --- /dev/null +++ b/STALService/src/main/java/at/gv/egiz/stal/service/types/GetHashDataInputType.java @@ -0,0 +1,156 @@ + +package at.gv.egiz.stal.service.types; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for GetHashDataInputType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="GetHashDataInputType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="Reference" maxOccurs="unbounded">
+ *           <complexType>
+ *             <complexContent>
+ *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *                 <attribute name="ID" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *               </restriction>
+ *             </complexContent>
+ *           </complexType>
+ *         </element>
+ *       </sequence>
+ *       <attribute name="SessionId" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "GetHashDataInputType", propOrder = { + "reference" +}) +public class GetHashDataInputType { + + @XmlElement(name = "Reference", required = true) + protected List reference; + @XmlAttribute(name = "SessionId") + protected String sessionId; + + /** + * Gets the value of the reference property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the reference property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getReference().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link GetHashDataInputType.Reference } + * + * + */ + public List getReference() { + if (reference == null) { + reference = new ArrayList(); + } + return this.reference; + } + + /** + * Gets the value of the sessionId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSessionId() { + return sessionId; + } + + /** + * Sets the value of the sessionId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSessionId(String value) { + this.sessionId = value; + } + + + /** + *

Java class for anonymous complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+     * <complexType>
+     *   <complexContent>
+     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+     *       <attribute name="ID" type="{http://www.w3.org/2001/XMLSchema}string" />
+     *     </restriction>
+     *   </complexContent>
+     * </complexType>
+     * 
+ * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "") + public static class Reference { + + @XmlAttribute(name = "ID") + protected String id; + + /** + * Gets the value of the id property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getID() { + return id; + } + + /** + * Sets the value of the id property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setID(String value) { + this.id = value; + } + + } + +} diff --git a/STALService/src/main/java/at/gv/egiz/stal/service/types/GetNextRequestResponseType.java b/STALService/src/main/java/at/gv/egiz/stal/service/types/GetNextRequestResponseType.java new file mode 100644 index 00000000..6f8204cc --- /dev/null +++ b/STALService/src/main/java/at/gv/egiz/stal/service/types/GetNextRequestResponseType.java @@ -0,0 +1,106 @@ + +package at.gv.egiz.stal.service.types; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlElements; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for GetNextRequestResponseType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="GetNextRequestResponseType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <choice maxOccurs="unbounded">
+ *         <element name="InfoboxReadRequest" type="{http://www.egiz.gv.at/stal}InfoboxReadRequestType"/>
+ *         <element name="SignRequest" type="{http://www.egiz.gv.at/stal}SignRequestType"/>
+ *         <element name="QuitRequest" type="{http://www.egiz.gv.at/stal}QuitRequestType"/>
+ *       </choice>
+ *       <attribute name="SessionId" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "GetNextRequestResponseType", propOrder = { + "infoboxReadRequestOrSignRequestOrQuitRequest" +}) +public class GetNextRequestResponseType { + + @XmlElements({ + @XmlElement(name = "InfoboxReadRequest", type = InfoboxReadRequestType.class), + @XmlElement(name = "QuitRequest", type = QuitRequestType.class), + @XmlElement(name = "SignRequest", type = SignRequestType.class) + }) + protected List infoboxReadRequestOrSignRequestOrQuitRequest; + @XmlAttribute(name = "SessionId") + protected String sessionId; + + /** + * Gets the value of the infoboxReadRequestOrSignRequestOrQuitRequest property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the infoboxReadRequestOrSignRequestOrQuitRequest property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getInfoboxReadRequestOrSignRequestOrQuitRequest().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link InfoboxReadRequestType } + * {@link QuitRequestType } + * {@link SignRequestType } + * + * + */ + public List getInfoboxReadRequestOrSignRequestOrQuitRequest() { + if (infoboxReadRequestOrSignRequestOrQuitRequest == null) { + infoboxReadRequestOrSignRequestOrQuitRequest = new ArrayList(); + } + return this.infoboxReadRequestOrSignRequestOrQuitRequest; + } + + /** + * Gets the value of the sessionId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSessionId() { + return sessionId; + } + + /** + * Sets the value of the sessionId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSessionId(String value) { + this.sessionId = value; + } + +} diff --git a/STALService/src/main/java/at/gv/egiz/stal/service/types/GetNextRequestType.java b/STALService/src/main/java/at/gv/egiz/stal/service/types/GetNextRequestType.java new file mode 100644 index 00000000..eab3d40b --- /dev/null +++ b/STALService/src/main/java/at/gv/egiz/stal/service/types/GetNextRequestType.java @@ -0,0 +1,106 @@ + +package at.gv.egiz.stal.service.types; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlElements; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for GetNextRequestType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="GetNextRequestType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <choice maxOccurs="unbounded">
+ *         <element name="InfoboxReadResponse" type="{http://www.egiz.gv.at/stal}InfoboxReadResponseType"/>
+ *         <element name="SignResponse" type="{http://www.egiz.gv.at/stal}SignResponseType"/>
+ *         <element name="ErrorResponse" type="{http://www.egiz.gv.at/stal}ErrorResponseType"/>
+ *       </choice>
+ *       <attribute name="SessionId" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "GetNextRequestType", propOrder = { + "infoboxReadResponseOrSignResponseOrErrorResponse" +}) +public class GetNextRequestType { + + @XmlElements({ + @XmlElement(name = "SignResponse", type = SignResponseType.class), + @XmlElement(name = "InfoboxReadResponse", type = InfoboxReadResponseType.class), + @XmlElement(name = "ErrorResponse", type = ErrorResponseType.class) + }) + protected List infoboxReadResponseOrSignResponseOrErrorResponse; + @XmlAttribute(name = "SessionId") + protected String sessionId; + + /** + * Gets the value of the infoboxReadResponseOrSignResponseOrErrorResponse property. + * + *

+ * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a set method for the infoboxReadResponseOrSignResponseOrErrorResponse property. + * + *

+ * For example, to add a new item, do as follows: + *

+     *    getInfoboxReadResponseOrSignResponseOrErrorResponse().add(newItem);
+     * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link SignResponseType } + * {@link InfoboxReadResponseType } + * {@link ErrorResponseType } + * + * + */ + public List getInfoboxReadResponseOrSignResponseOrErrorResponse() { + if (infoboxReadResponseOrSignResponseOrErrorResponse == null) { + infoboxReadResponseOrSignResponseOrErrorResponse = new ArrayList(); + } + return this.infoboxReadResponseOrSignResponseOrErrorResponse; + } + + /** + * Gets the value of the sessionId property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getSessionId() { + return sessionId; + } + + /** + * Sets the value of the sessionId property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setSessionId(String value) { + this.sessionId = value; + } + +} diff --git a/STALService/src/main/java/at/gv/egiz/stal/service/types/InfoboxReadRequestType.java b/STALService/src/main/java/at/gv/egiz/stal/service/types/InfoboxReadRequestType.java new file mode 100644 index 00000000..0ab6f5f3 --- /dev/null +++ b/STALService/src/main/java/at/gv/egiz/stal/service/types/InfoboxReadRequestType.java @@ -0,0 +1,102 @@ + +package at.gv.egiz.stal.service.types; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for InfoboxReadRequestType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="InfoboxReadRequestType">
+ *   <complexContent>
+ *     <extension base="{http://www.egiz.gv.at/stal}RequestType">
+ *       <sequence>
+ *         <element name="InfoboxIdentifier">
+ *           <simpleType>
+ *             <restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ *               <enumeration value="Certificates"/>
+ *               <enumeration value="IdentityLink"/>
+ *               <enumeration value="Mandates"/>
+ *             </restriction>
+ *           </simpleType>
+ *         </element>
+ *         <element name="DomainIdentifier" type="{http://www.w3.org/2001/XMLSchema}anyURI" minOccurs="0"/>
+ *       </sequence>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "InfoboxReadRequestType", propOrder = { + "infoboxIdentifier", + "domainIdentifier" +}) +public class InfoboxReadRequestType + extends RequestType +{ + + @XmlElement(name = "InfoboxIdentifier", required = true) + protected String infoboxIdentifier; + @XmlElement(name = "DomainIdentifier") + @XmlSchemaType(name = "anyURI") + protected String domainIdentifier; + + /** + * Gets the value of the infoboxIdentifier property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getInfoboxIdentifier() { + return infoboxIdentifier; + } + + /** + * Sets the value of the infoboxIdentifier property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setInfoboxIdentifier(String value) { + this.infoboxIdentifier = value; + } + + /** + * Gets the value of the domainIdentifier property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getDomainIdentifier() { + return domainIdentifier; + } + + /** + * Sets the value of the domainIdentifier property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setDomainIdentifier(String value) { + this.domainIdentifier = value; + } + +} diff --git a/STALService/src/main/java/at/gv/egiz/stal/service/types/InfoboxReadResponseType.java b/STALService/src/main/java/at/gv/egiz/stal/service/types/InfoboxReadResponseType.java new file mode 100644 index 00000000..1d88737d --- /dev/null +++ b/STALService/src/main/java/at/gv/egiz/stal/service/types/InfoboxReadResponseType.java @@ -0,0 +1,62 @@ + +package at.gv.egiz.stal.service.types; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for InfoboxReadResponseType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="InfoboxReadResponseType">
+ *   <complexContent>
+ *     <extension base="{http://www.egiz.gv.at/stal}ResponseType">
+ *       <sequence>
+ *         <element name="InfoboxValue" type="{http://www.w3.org/2001/XMLSchema}base64Binary"/>
+ *       </sequence>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "InfoboxReadResponseType", propOrder = { + "infoboxValue" +}) +public class InfoboxReadResponseType + extends ResponseType +{ + + @XmlElement(name = "InfoboxValue", required = true) + protected byte[] infoboxValue; + + /** + * Gets the value of the infoboxValue property. + * + * @return + * possible object is + * byte[] + */ + public byte[] getInfoboxValue() { + return infoboxValue; + } + + /** + * Sets the value of the infoboxValue property. + * + * @param value + * allowed object is + * byte[] + */ + public void setInfoboxValue(byte[] value) { + this.infoboxValue = ((byte[]) value); + } + +} diff --git a/STALService/src/main/java/at/gv/egiz/stal/service/types/ObjectFactory.java b/STALService/src/main/java/at/gv/egiz/stal/service/types/ObjectFactory.java new file mode 100644 index 00000000..d485f1e1 --- /dev/null +++ b/STALService/src/main/java/at/gv/egiz/stal/service/types/ObjectFactory.java @@ -0,0 +1,199 @@ + +package at.gv.egiz.stal.service.types; + +import javax.xml.bind.JAXBElement; +import javax.xml.bind.annotation.XmlElementDecl; +import javax.xml.bind.annotation.XmlRegistry; +import javax.xml.namespace.QName; + + +/** + * This object contains factory methods for each + * Java content interface and Java element interface + * generated in the at.gv.egiz.stal.service.types package. + *

An ObjectFactory allows you to programatically + * construct new instances of the Java representation + * for XML content. The Java representation of XML + * content can consist of schema derived interfaces + * and classes representing the binding of schema + * type definitions, element declarations and model + * groups. Factory methods for each of these are + * provided in this class. + * + */ +@XmlRegistry +public class ObjectFactory { + + private final static QName _GetHashDataInputFault_QNAME = new QName("http://www.egiz.gv.at/stal", "GetHashDataInputFault"); + private final static QName _GetHashDataInput_QNAME = new QName("http://www.egiz.gv.at/stal", "GetHashDataInput"); + private final static QName _GetNextRequestResponse_QNAME = new QName("http://www.egiz.gv.at/stal", "GetNextRequestResponse"); + private final static QName _GetHashDataInputResponse_QNAME = new QName("http://www.egiz.gv.at/stal", "GetHashDataInputResponse"); + private final static QName _GetNextRequest_QNAME = new QName("http://www.egiz.gv.at/stal", "GetNextRequest"); + private final static QName _SessionId_QNAME = new QName("http://www.egiz.gv.at/stal", "SessionId"); + + /** + * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: at.gv.egiz.stal.service.types + * + */ + public ObjectFactory() { + } + + /** + * Create an instance of {@link GetNextRequestType } + * + */ + public GetNextRequestType createGetNextRequestType() { + return new GetNextRequestType(); + } + + /** + * Create an instance of {@link InfoboxReadRequestType } + * + */ + public InfoboxReadRequestType createInfoboxReadRequestType() { + return new InfoboxReadRequestType(); + } + + /** + * Create an instance of {@link GetHashDataInputResponseType.Reference } + * + */ + public GetHashDataInputResponseType.Reference createGetHashDataInputResponseTypeReference() { + return new GetHashDataInputResponseType.Reference(); + } + + /** + * Create an instance of {@link ErrorResponseType } + * + */ + public ErrorResponseType createErrorResponseType() { + return new ErrorResponseType(); + } + + /** + * Create an instance of {@link GetHashDataInputType } + * + */ + public GetHashDataInputType createGetHashDataInputType() { + return new GetHashDataInputType(); + } + + /** + * Create an instance of {@link SignRequestType } + * + */ + public SignRequestType createSignRequestType() { + return new SignRequestType(); + } + + /** + * Create an instance of {@link GetHashDataInputFaultType } + * + */ + public GetHashDataInputFaultType createGetHashDataInputFaultType() { + return new GetHashDataInputFaultType(); + } + + /** + * Create an instance of {@link SignResponseType } + * + */ + public SignResponseType createSignResponseType() { + return new SignResponseType(); + } + + /** + * Create an instance of {@link GetHashDataInputType.Reference } + * + */ + public GetHashDataInputType.Reference createGetHashDataInputTypeReference() { + return new GetHashDataInputType.Reference(); + } + + /** + * Create an instance of {@link GetHashDataInputResponseType } + * + */ + public GetHashDataInputResponseType createGetHashDataInputResponseType() { + return new GetHashDataInputResponseType(); + } + + /** + * Create an instance of {@link InfoboxReadResponseType } + * + */ + public InfoboxReadResponseType createInfoboxReadResponseType() { + return new InfoboxReadResponseType(); + } + + /** + * Create an instance of {@link QuitRequestType } + * + */ + public QuitRequestType createQuitRequestType() { + return new QuitRequestType(); + } + + /** + * Create an instance of {@link GetNextRequestResponseType } + * + */ + public GetNextRequestResponseType createGetNextRequestResponseType() { + return new GetNextRequestResponseType(); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetHashDataInputFaultType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.egiz.gv.at/stal", name = "GetHashDataInputFault") + public JAXBElement createGetHashDataInputFault(GetHashDataInputFaultType value) { + return new JAXBElement(_GetHashDataInputFault_QNAME, GetHashDataInputFaultType.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetHashDataInputType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.egiz.gv.at/stal", name = "GetHashDataInput") + public JAXBElement createGetHashDataInput(GetHashDataInputType value) { + return new JAXBElement(_GetHashDataInput_QNAME, GetHashDataInputType.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetNextRequestResponseType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.egiz.gv.at/stal", name = "GetNextRequestResponse") + public JAXBElement createGetNextRequestResponse(GetNextRequestResponseType value) { + return new JAXBElement(_GetNextRequestResponse_QNAME, GetNextRequestResponseType.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetHashDataInputResponseType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.egiz.gv.at/stal", name = "GetHashDataInputResponse") + public JAXBElement createGetHashDataInputResponse(GetHashDataInputResponseType value) { + return new JAXBElement(_GetHashDataInputResponse_QNAME, GetHashDataInputResponseType.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link GetNextRequestType }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.egiz.gv.at/stal", name = "GetNextRequest") + public JAXBElement createGetNextRequest(GetNextRequestType value) { + return new JAXBElement(_GetNextRequest_QNAME, GetNextRequestType.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}} + * + */ + @XmlElementDecl(namespace = "http://www.egiz.gv.at/stal", name = "SessionId") + public JAXBElement createSessionId(String value) { + return new JAXBElement(_SessionId_QNAME, String.class, null, value); + } + +} diff --git a/STALService/src/main/java/at/gv/egiz/stal/service/types/QuitRequestType.java b/STALService/src/main/java/at/gv/egiz/stal/service/types/QuitRequestType.java new file mode 100644 index 00000000..7dc4197f --- /dev/null +++ b/STALService/src/main/java/at/gv/egiz/stal/service/types/QuitRequestType.java @@ -0,0 +1,32 @@ + +package at.gv.egiz.stal.service.types; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for QuitRequestType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="QuitRequestType">
+ *   <complexContent>
+ *     <extension base="{http://www.egiz.gv.at/stal}RequestType">
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "QuitRequestType") +public class QuitRequestType + extends RequestType +{ + + +} diff --git a/STALService/src/main/java/at/gv/egiz/stal/service/types/RequestType.java b/STALService/src/main/java/at/gv/egiz/stal/service/types/RequestType.java new file mode 100644 index 00000000..32b7894f --- /dev/null +++ b/STALService/src/main/java/at/gv/egiz/stal/service/types/RequestType.java @@ -0,0 +1,30 @@ + +package at.gv.egiz.stal.service.types; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for RequestType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="RequestType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "RequestType") +public abstract class RequestType { + + +} diff --git a/STALService/src/main/java/at/gv/egiz/stal/service/types/ResponseType.java b/STALService/src/main/java/at/gv/egiz/stal/service/types/ResponseType.java new file mode 100644 index 00000000..c94bcbe8 --- /dev/null +++ b/STALService/src/main/java/at/gv/egiz/stal/service/types/ResponseType.java @@ -0,0 +1,30 @@ + +package at.gv.egiz.stal.service.types; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for ResponseType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="ResponseType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "ResponseType") +public abstract class ResponseType { + + +} diff --git a/STALService/src/main/java/at/gv/egiz/stal/service/types/SignRequestType.java b/STALService/src/main/java/at/gv/egiz/stal/service/types/SignRequestType.java new file mode 100644 index 00000000..09e30967 --- /dev/null +++ b/STALService/src/main/java/at/gv/egiz/stal/service/types/SignRequestType.java @@ -0,0 +1,97 @@ + +package at.gv.egiz.stal.service.types; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for SignRequestType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="SignRequestType">
+ *   <complexContent>
+ *     <extension base="{http://www.egiz.gv.at/stal}RequestType">
+ *       <sequence>
+ *         <element name="KeyIdentifier">
+ *           <simpleType>
+ *             <restriction base="{http://www.w3.org/2001/XMLSchema}string">
+ *               <enumeration value="SecureSignatureKeypair"/>
+ *               <enumeration value="CertifiedKeypair"/>
+ *             </restriction>
+ *           </simpleType>
+ *         </element>
+ *         <element name="SignedInfo" type="{http://www.w3.org/2001/XMLSchema}base64Binary"/>
+ *       </sequence>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "SignRequestType", propOrder = { + "keyIdentifier", + "signedInfo" +}) +public class SignRequestType + extends RequestType +{ + + @XmlElement(name = "KeyIdentifier", required = true) + protected String keyIdentifier; + @XmlElement(name = "SignedInfo", required = true) + protected byte[] signedInfo; + + /** + * Gets the value of the keyIdentifier property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getKeyIdentifier() { + return keyIdentifier; + } + + /** + * Sets the value of the keyIdentifier property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setKeyIdentifier(String value) { + this.keyIdentifier = value; + } + + /** + * Gets the value of the signedInfo property. + * + * @return + * possible object is + * byte[] + */ + public byte[] getSignedInfo() { + return signedInfo; + } + + /** + * Sets the value of the signedInfo property. + * + * @param value + * allowed object is + * byte[] + */ + public void setSignedInfo(byte[] value) { + this.signedInfo = ((byte[]) value); + } + +} diff --git a/STALService/src/main/java/at/gv/egiz/stal/service/types/SignResponseType.java b/STALService/src/main/java/at/gv/egiz/stal/service/types/SignResponseType.java new file mode 100644 index 00000000..a33fb34c --- /dev/null +++ b/STALService/src/main/java/at/gv/egiz/stal/service/types/SignResponseType.java @@ -0,0 +1,62 @@ + +package at.gv.egiz.stal.service.types; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + + +/** + *

Java class for SignResponseType complex type. + * + *

The following schema fragment specifies the expected content contained within this class. + * + *

+ * <complexType name="SignResponseType">
+ *   <complexContent>
+ *     <extension base="{http://www.egiz.gv.at/stal}ResponseType">
+ *       <sequence>
+ *         <element name="SignatureValue" type="{http://www.w3.org/2001/XMLSchema}base64Binary"/>
+ *       </sequence>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "SignResponseType", propOrder = { + "signatureValue" +}) +public class SignResponseType + extends ResponseType +{ + + @XmlElement(name = "SignatureValue", required = true) + protected byte[] signatureValue; + + /** + * Gets the value of the signatureValue property. + * + * @return + * possible object is + * byte[] + */ + public byte[] getSignatureValue() { + return signatureValue; + } + + /** + * Sets the value of the signatureValue property. + * + * @param value + * allowed object is + * byte[] + */ + public void setSignatureValue(byte[] value) { + this.signatureValue = ((byte[]) value); + } + +} diff --git a/STALService/src/main/java/at/gv/egiz/stal/service/types/package-info.java b/STALService/src/main/java/at/gv/egiz/stal/service/types/package-info.java new file mode 100644 index 00000000..3328fdc0 --- /dev/null +++ b/STALService/src/main/java/at/gv/egiz/stal/service/types/package-info.java @@ -0,0 +1,2 @@ +@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.egiz.gv.at/stal", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) +package at.gv.egiz.stal.service.types; diff --git a/STALService/src/main/java/at/gv/egiz/stal/util/STALTranslator.java b/STALService/src/main/java/at/gv/egiz/stal/util/STALTranslator.java new file mode 100644 index 00000000..b8681084 --- /dev/null +++ b/STALService/src/main/java/at/gv/egiz/stal/util/STALTranslator.java @@ -0,0 +1,109 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package at.gv.egiz.stal.util; + +import at.gv.egiz.stal.ErrorResponse; +import at.gv.egiz.stal.InfoboxReadRequest; +import at.gv.egiz.stal.InfoboxReadResponse; +import at.gv.egiz.stal.QuitRequest; +import at.gv.egiz.stal.STALRequest; +import at.gv.egiz.stal.STALResponse; +import at.gv.egiz.stal.SignRequest; +import at.gv.egiz.stal.SignResponse; +import at.gv.egiz.stal.service.types.*; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * + * @author clemens + */ +public class STALTranslator { + + protected static final Log log = LogFactory.getLog(STALTranslator.class); + + public static List translateRequests(List requests) { + List stalRequests = new ArrayList(requests.size()); + for (RequestType request : requests) { + if (request instanceof InfoboxReadRequestType) { + InfoboxReadRequest stalReq = new InfoboxReadRequest(); + stalReq.setDomainIdentifier(((InfoboxReadRequestType) request).getDomainIdentifier()); + stalReq.setInfoboxIdentifier(((InfoboxReadRequestType) request).getInfoboxIdentifier()); + stalRequests.add(stalReq); + } else if (request instanceof SignRequestType) { + SignRequest stalReq = new SignRequest(); + stalReq.setKeyIdentifier(((SignRequestType) request).getKeyIdentifier()); + stalReq.setSignedInfo(((SignRequestType) request).getSignedInfo()); + stalRequests.add(stalReq); + } else if (request instanceof QuitRequestType) { + stalRequests.add(new QuitRequest()); + } else { + log.error("unknown STALService request type: " + request.getClass()); + stalRequests = Collections.singletonList((STALRequest) new QuitRequest()); + break; + } + } + return stalRequests; + } + + public static List fromSTAL(List stalResponses) { + List responses = new ArrayList(stalResponses.size()); + for (STALResponse stalResp : stalResponses) { + if (stalResp instanceof InfoboxReadResponse) { + InfoboxReadResponseType resp = new InfoboxReadResponseType(); + resp.setInfoboxValue(((InfoboxReadResponse) stalResp).getInfoboxValue()); + responses.add(resp); + } else if (stalResp instanceof SignResponse) { + SignResponseType resp = new SignResponseType(); + resp.setSignatureValue(((SignResponse) stalResp).getSignatureValue()); + responses.add(resp); + } else if (stalResp instanceof ErrorResponse) { + ErrorResponseType resp = new ErrorResponseType(); + resp.setErrorCode(((ErrorResponse) stalResp).getErrorCode()); + resp.setErrorMessage(((ErrorResponse) stalResp).getErrorMessage()); + responses.add(resp); + } else { + log.error("unknown STAL response type: " + stalResp.getClass()); + ErrorResponseType resp = new ErrorResponseType(); + resp.setErrorCode(4000); + resp.setErrorMessage("unknown STAL response type: " + stalResp.getClass()); + responses = Collections.singletonList((ResponseType) resp); + break; + } + } + return responses; + } + + public static List toSTAL(List responses) { + List stalResponses = new ArrayList(responses.size()); + for (ResponseType resp : responses) { + if (resp instanceof InfoboxReadResponseType) { + InfoboxReadResponse stalResp = new InfoboxReadResponse(); + stalResp.setInfoboxValue(((InfoboxReadResponseType) resp).getInfoboxValue()); + stalResponses.add(stalResp); + } else if (resp instanceof SignResponseType) { + SignResponse stalResp = new SignResponse(); + stalResp.setSignatureValue(((SignResponseType) resp).getSignatureValue()); + stalResponses.add(stalResp); + } else if (resp instanceof ErrorResponseType) { + ErrorResponse stalResp = new ErrorResponse(); + stalResp.setErrorCode(((ErrorResponseType) resp).getErrorCode()); + stalResp.setErrorMessage(((ErrorResponseType) resp).getErrorMessage()); + stalResponses.add(stalResp); + } else { + log.error("unknown STALService response type: " + resp.getClass()); + ErrorResponse stalResp = new ErrorResponse(); + stalResp.setErrorCode(4000); + stalResp.setErrorMessage("unknown STALService response type: " + resp.getClass()); + stalResponses = Collections.singletonList((STALResponse) stalResp); + break; + } + } + return stalResponses; + } +} diff --git a/pom.xml b/pom.xml index 3438e596..dbe2812e 100644 --- a/pom.xml +++ b/pom.xml @@ -1,12 +1,12 @@ - - 4.0.0 - at.gv.egiz - bku - pom - 1.0-SNAPSHOT - BKU - http://bku.egiz.gv.at + + 4.0.0 + at.gv.egiz + bku + pom + 1.0-SNAPSHOT + BKU + http://bku.egiz.gv.at utils bkucommon @@ -18,7 +18,7 @@ smccSTAL STALService BKUCommonGUI - BKUViewer + BKUViewer @@ -43,74 +43,74 @@ E-Government Innovation Center (EGIZ) http://www.egiz.gv.at - - - - - - maven-compiler-plugin - org.apache.maven.plugins - 2.0.2 - - - 1.6 - 1.6 - true - true - - - - maven-assembly-plugin - org.apache.maven.plugins - 2.2-beta-2 - - - maven-dependency-plugin - org.apache.maven.plugins - 2.0 - - - maven-jaxb2-plugin - org.jvnet.jaxb2.maven2 - 0.6.0 - - - jaxws-maven-plugin - org.codehaus.mojo - 1.10 - - - - - - maven-assembly-plugin - - - ${basedir}/src/main/assemblies/assembly-test.xml - - - - - - + + + + + + maven-compiler-plugin + org.apache.maven.plugins + 2.0.2 + + + 1.6 + 1.6 + true + true + + + + maven-assembly-plugin + org.apache.maven.plugins + 2.2-beta-2 + + + maven-dependency-plugin + org.apache.maven.plugins + 2.0 + + + + jaxws-maven-plugin + org.codehaus.mojo + 1.10 + + + + + + maven-assembly-plugin + + + ${basedir}/src/main/assemblies/assembly-test.xml + + + + + + @@ -129,39 +129,39 @@ http://download.java.net/maven/1/ legacy - - - - log4j - log4j - runtime - - - junit - junit - test - - - - - - log4j - log4j - 1.2.12 - runtime - - - commons-logging - commons-logging - 1.1.1 - compile - - - junit - junit - 4.4 - test - + + + + log4j + log4j + runtime + + + junit + junit + test + + + + + + log4j + log4j + 1.2.12 + runtime + + + commons-logging + commons-logging + 1.1.1 + compile + + + junit + junit + 4.4 + test + xerces xercesImpl @@ -172,39 +172,39 @@ xalan 2.7.0 - - iaik - iaik_jce_full_signed - 3.16 - compile - - - iaik - iaik_jce_me4se - 3.04 - - - iaik - iaik_ecc_signed - 2.15 - - - iaik - iaik_xsect - 1.14 - - - commons-fileupload - commons-fileupload - 1.2.1 - compile - - - commons-httpclient - commons-httpclient - 3.1 - compile - - - + + iaik + iaik_jce_full_signed + 3.16 + compile + + + iaik + iaik_jce_me4se + 3.04 + + + iaik + iaik_ecc_signed + 2.15 + + + iaik + iaik_xsect + 1.14 + + + commons-fileupload + commons-fileupload + 1.2.1 + compile + + + commons-httpclient + commons-httpclient + 3.1 + compile + + + \ No newline at end of file diff --git a/smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/AbstractSMCCSTAL.java b/smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/AbstractSMCCSTAL.java index f3b94078..8ee70f1a 100644 --- a/smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/AbstractSMCCSTAL.java +++ b/smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/AbstractSMCCSTAL.java @@ -65,7 +65,7 @@ public abstract class AbstractSMCCSTAL implements STAL { List responseList = new ArrayList(requestList .size()); for (STALRequest request : requestList) { - log.info("Processing: " + request); + log.info("Processing: " + request.getClass()); SMCCSTALRequestHandler handler = null; handler = handlerMap.get(request.getClass().getSimpleName()); if (handler != null) { @@ -78,7 +78,10 @@ public abstract class AbstractSMCCSTAL implements STAL { try { handler = handler.newInstance(); handler.init(signatureCard, getGUI()); - responseList.add(handler.handleRequest(request)); + STALResponse response = handler.handleRequest(request); + if (response != null) { + responseList.add(response); + } } catch (Exception e) { log.info("Error while handling STAL request:" + e); responseList.add(new ErrorResponse(6000)); -- cgit v1.2.3