summaryrefslogtreecommitdiff
path: root/BKUOnline/src
diff options
context:
space:
mode:
Diffstat (limited to 'BKUOnline/src')
-rw-r--r--BKUOnline/src/main/custom-binding/cardchannel-custom.xml40
-rw-r--r--BKUOnline/src/main/custom-binding/stalservice-custom.xml2
-rw-r--r--BKUOnline/src/main/custom-binding/staltypes-custom.xml2
-rw-r--r--BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/BKURequestHandler.java93
-rw-r--r--BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/HashDataInputServlet.java144
-rw-r--r--BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/ResultServlet.java23
-rw-r--r--BKUOnline/src/main/java/at/gv/egiz/stal/service/impl/STALRequestBroker.java5
-rw-r--r--BKUOnline/src/main/java/at/gv/egiz/stal/service/impl/STALRequestBrokerImpl.java197
-rw-r--r--BKUOnline/src/main/java/at/gv/egiz/stal/service/impl/STALServiceImpl.java127
-rw-r--r--BKUOnline/src/main/java/at/gv/egiz/stal/service/impl/STALXJAXBContextFactory.java61
-rw-r--r--BKUOnline/src/main/webapp/WEB-INF/applicationContext.xml58
-rw-r--r--BKUOnline/src/main/webapp/WEB-INF/web.xml12
-rw-r--r--BKUOnline/src/main/webapp/WEB-INF/wsdl/stal.wsdl24
-rw-r--r--BKUOnline/src/main/webapp/applet.jsp70
-rw-r--r--BKUOnline/src/main/webapp/appletPage.jsp71
-rw-r--r--BKUOnline/src/main/webapp/css/login.css16
-rw-r--r--BKUOnline/src/main/webapp/help.jsp18
-rw-r--r--BKUOnline/src/main/webapp/helpfiles/de/error.pcsc.html14
-rw-r--r--BKUOnline/src/main/webapp/helpfiles/de/help.hashdataviewer.html1
-rw-r--r--BKUOnline/src/main/webapp/ieView.html31
-rw-r--r--BKUOnline/src/main/webapp/img/BackgroundEcard.pngbin0 -> 31706 bytes
-rw-r--r--BKUOnline/src/main/webapp/index.html2
-rw-r--r--BKUOnline/src/main/webapp/js/deployJava.js15
-rw-r--r--BKUOnline/src/main/webapp/multiHashDataInput.html37
-rw-r--r--BKUOnline/src/main/webapp/slRequestForm.html (renamed from BKUOnline/src/main/webapp/HTTP-ohne.html)11
-rw-r--r--BKUOnline/src/main/wsdl/CardChannel.xsd148
-rw-r--r--BKUOnline/src/main/wsdl/stal-service.wsdl114
-rw-r--r--BKUOnline/src/main/wsdl/stal-service.xsd168
-rw-r--r--BKUOnline/src/test/java/at/gv/egiz/stal/service/STALRequestBrokerTest.java51
29 files changed, 970 insertions, 585 deletions
diff --git a/BKUOnline/src/main/custom-binding/cardchannel-custom.xml b/BKUOnline/src/main/custom-binding/cardchannel-custom.xml
new file mode 100644
index 00000000..b46aa6a8
--- /dev/null
+++ b/BKUOnline/src/main/custom-binding/cardchannel-custom.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<!--
+ Binding customization for STAL schema (stal.xsd)
+ Use JAXB version 2.1 which supports "schema component designator" (SCD, http://www.w3.org/TR/xmlschema-ref/)
+
+ All request/response types are generated to at.gv.egiz.stal
+ and renamed (...Type suffix removed),
+ except for the base types of the modified implClasses ErrorResponse and SignRequest
+
+ IMPORTANT: WHEN REGENERATING CLASSES MAKE SURE TO BACKUP MODIFIED IMPLCLASSES (ErrorResponse and SignRequest)
+-->
+<bindings xmlns='http://java.sun.com/xml/ns/jaxb' version='2.1'
+ xmlns:xs='http://www.w3.org/2001/XMLSchema'
+ xmlns:xjc='http://java.sun.com/xml/ns/jaxb/xjc'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
+ schemaLocation='../wsdl/CardChannel.xsd'
+ xsi:schemaLocation='http://java.sun.com/xml/ns/jaxb http://java.sun.com/xml/ns/jaxb/bindingschema_2_0.xsd
+ http://www.w3.org/2001/XMLSchema http://www.w3.org/2001/XMLSchema.xsd'>
+
+ <!-- cannot use scd, CardChannel.xsd has no namespace?! -->
+ <schemaBindings>
+ <package name="at.buergerkarte.namespaces.cardchannel.service"/>
+ </schemaBindings>
+</bindings>
diff --git a/BKUOnline/src/main/custom-binding/stalservice-custom.xml b/BKUOnline/src/main/custom-binding/stalservice-custom.xml
index 9c35cbdf..7c5f604d 100644
--- a/BKUOnline/src/main/custom-binding/stalservice-custom.xml
+++ b/BKUOnline/src/main/custom-binding/stalservice-custom.xml
@@ -23,7 +23,7 @@
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
- wsdlLocation="../webapp/WEB-INF/wsdl/stal.wsdl">
+ wsdlLocation="../wsdl/stal-service.wsdl">
<!-- default settings
diff --git a/BKUOnline/src/main/custom-binding/staltypes-custom.xml b/BKUOnline/src/main/custom-binding/staltypes-custom.xml
index 3e150363..2925fb91 100644
--- a/BKUOnline/src/main/custom-binding/staltypes-custom.xml
+++ b/BKUOnline/src/main/custom-binding/staltypes-custom.xml
@@ -27,7 +27,7 @@
-->
<bindings xmlns='http://java.sun.com/xml/ns/jaxb' version='2.1'
xmlns:xs='http://www.w3.org/2001/XMLSchema'
- xmlns:stal="http://www.egiz.gv.at/stal"
+ xmlns:stal="http://www.egiz.gv.at/stal"
xmlns:xjc='http://java.sun.com/xml/ns/jaxb/xjc'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xsi:schemaLocation='http://java.sun.com/xml/ns/jaxb http://java.sun.com/xml/ns/jaxb/bindingschema_2_0.xsd
diff --git a/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/BKURequestHandler.java b/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/BKURequestHandler.java
index 660fee78..d9be0981 100644
--- a/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/BKURequestHandler.java
+++ b/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/BKURequestHandler.java
@@ -24,6 +24,7 @@ import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
+import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -32,6 +33,7 @@ import javax.servlet.http.HttpSession;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import at.gv.egiz.bku.binding.BindingProcessor;
import at.gv.egiz.bku.binding.HTTPBindingProcessor;
import at.gv.egiz.bku.binding.HttpUtil;
import at.gv.egiz.bku.binding.IdFactory;
@@ -43,14 +45,16 @@ import at.gv.egiz.org.apache.tomcat.util.http.AcceptLanguage;
*
*/
public class BKURequestHandler extends SpringBKUServlet {
+ public static final String BKU_APPLET_JSP = "BKUApplet";
private static final long serialVersionUID = 1L;
- public final static String REDIRECT_URL = "appletPage.jsp";
+ public final static String REDIRECT_URL_SESSION_ATTRIBUTE="redirectUrl";
protected Log log = LogFactory.getLog(BKURequestHandler.class);
- private static String getStringFromStream(InputStream is, String encoding) throws IOException {
+ private static String getStringFromStream(InputStream is, String encoding)
+ throws IOException {
if (is == null) {
return null;
}
@@ -61,28 +65,41 @@ public class BKURequestHandler extends SpringBKUServlet {
StreamUtil.copyStream(is, os);
return new String(os.toByteArray(), encoding);
}
-
-
+
+ @Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, java.io.IOException {
- log.debug("Got new request");
- HttpSession session = req.getSession();
- String lang = req.getHeader("Accept-Language");
- Locale locale = AcceptLanguage.getLocale(lang);
- log.debug("Using locale: " + locale);
-
+ log.debug("Received new request");
+
+ HttpSession session = req.getSession(false);
if (session != null) {
log.warn("Already a session with id: " + session.getId()
- + " active, deleting this one");
- getBindingProcessorManager().removeBindingProcessor(
+ + " active, trying to get Bindingprocessor");
+ BindingProcessor bp = getBindingProcessorManager().getBindingProcessor(
IdFactory.getInstance().createId(session.getId()));
+ if (bp != null) {
+ log.debug("Found binding processor, using this one");
+ RequestDispatcher dispatcher = getServletContext().getNamedDispatcher(
+ BKU_APPLET_JSP);
+ log.debug("forward to applet");
+ dispatcher.forward(req, resp);
+ return;
+ }
+ log.debug("Did not find a binding processor, creating new ...");
}
- String id = req.getSession(true).getId();
- log.debug("Using session id: " + id);
- HTTPBindingProcessor bindingProcessor;
+ session = req.getSession(true);
+ if (log.isDebugEnabled()) {
+ log.debug("Using session id: " + session.getId());
+ }
+
+ String acceptLanguage = req.getHeader("Accept-Language");
+ Locale locale = AcceptLanguage.getLocale(acceptLanguage);
+ log.debug("Accept-Language locale: " + locale);
+ HTTPBindingProcessor bindingProcessor;
bindingProcessor = (HTTPBindingProcessor) getBindingProcessorManager()
- .createBindingProcessor(req.getRequestURL().toString(), id, locale);
+ .createBindingProcessor(req.getRequestURL().toString(),
+ session.getId(), locale);
Map<String, String> headerMap = new HashMap<String, String>();
for (Enumeration<String> headerName = req.getHeaderNames(); headerName
@@ -102,13 +119,20 @@ public class BKURequestHandler extends SpringBKUServlet {
bindingProcessor.consumeRequestStream(req.getInputStream());
req.getInputStream().close();
getBindingProcessorManager().process(bindingProcessor);
-
+
log.trace("Trying to find applet parameters in request");
- String width = getStringFromStream(bindingProcessor.getFormData("appletWidth"), charset);
- String height = getStringFromStream(bindingProcessor.getFormData("appletHeight"), charset);
- String background = getStringFromStream(bindingProcessor.getFormData("appletBackground"), charset);
- String guiStyle = getStringFromStream(bindingProcessor.getFormData("appletGuiStyle"), charset);
- String hashDataDisplay = getStringFromStream(bindingProcessor.getFormData("appletHashDataDisplay"), charset);
+ String width = getStringFromStream(bindingProcessor
+ .getFormData("appletWidth"), charset);
+ String height = getStringFromStream(bindingProcessor
+ .getFormData("appletHeight"), charset);
+ String background = getStringFromStream(bindingProcessor
+ .getFormData("appletBackground"), charset);
+ String guiStyle = getStringFromStream(bindingProcessor
+ .getFormData("appletGuiStyle"), charset);
+ String hashDataDisplay = getStringFromStream(bindingProcessor
+ .getFormData("appletHashDataDisplay"), charset);
+ String localeFormParam = getStringFromStream(bindingProcessor
+ .getFormData("locale"), charset);
if (width != null) {
try {
log.trace("Found applet width parameter: " + width);
@@ -139,11 +163,30 @@ public class BKURequestHandler extends SpringBKUServlet {
log.trace("Found applet hash data display parameter: " + hashDataDisplay);
session.setAttribute("appletHashDataDisplay", hashDataDisplay);
}
- String redirectUrl = REDIRECT_URL+";jsessionid="+session.getId();
- log.debug("Redirecting to: "+redirectUrl);
- resp.sendRedirect(redirectUrl);
+ if (localeFormParam != null) {
+ log.debug("overrule accept-language locale " + locale
+ + " with form param " + localeFormParam);
+ locale = new Locale(localeFormParam);
+ }
+ if (locale != null) {
+ log.debug("Using locale " + locale);
+ session.setAttribute("locale", locale.toString());
+ }
+
+ // handle server side redirect url after processing
+ String redirectUrl = bindingProcessor.getRedirectURL();
+ if ( redirectUrl != null) {
+ log.debug("Got redirect URL "+redirectUrl+". Deferring browser redirect.");
+ session.setAttribute(REDIRECT_URL_SESSION_ATTRIBUTE, redirectUrl);
+ }
+ // TODO error if no dispatcher found
+ RequestDispatcher dispatcher = getServletContext().getNamedDispatcher(
+ BKU_APPLET_JSP);
+ log.debug("forward to applet");
+ dispatcher.forward(req, resp);
}
+ @Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, java.io.IOException {
doPost(req, resp);
diff --git a/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/HashDataInputServlet.java b/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/HashDataInputServlet.java
deleted file mode 100644
index c095fcc8..00000000
--- a/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/HashDataInputServlet.java
+++ /dev/null
@@ -1,144 +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.bku.online.webapp;
-
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.OutputStreamWriter;
-import java.io.Reader;
-import java.io.Writer;
-import java.util.List;
-
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import at.gv.egiz.bku.binding.BindingProcessor;
-import at.gv.egiz.bku.binding.Id;
-import at.gv.egiz.bku.binding.IdFactory;
-import at.gv.egiz.bku.slexceptions.SLRuntimeException;
-import at.gv.egiz.bku.utils.StreamUtil;
-import at.gv.egiz.stal.HashDataInput;
-import at.gv.egiz.stal.STAL;
-import at.gv.egiz.stal.service.impl.STALRequestBroker;
-
-public class HashDataInputServlet extends SpringBKUServlet {
-
- private static Log log = LogFactory.getLog(HashDataInputServlet.class);
-
- public HashDataInputServlet() {
-
- }
-
- private STALRequestBroker getSTAL(Id id) {
- BindingProcessor bp = getBindingProcessorManager().getBindingProcessor(id);
- if (bp == null) {
- return null;
- }
- STAL stal = bp.getSTAL();
- if (stal instanceof STALRequestBroker) {
- return (STALRequestBroker) stal;
- } else {
- throw new SLRuntimeException("Unexpected STAL type");
- }
- }
-
- private static boolean isMSIE(HttpServletRequest req) {
- String useragent = req.getHeader("User-Agent");
- String user = useragent.toLowerCase();
- return (user.indexOf("msie") != -1);
- }
-
- @Override
- protected void doGet(HttpServletRequest req, HttpServletResponse resp)
- throws ServletException, IOException {
- if ((req.getSession() == null) && (req.getSession().getId() != null)) {
- log.warn("Got request for hashdatainput without session info");
- resp.sendRedirect("expired.html");
- return;
- }
- Id sessionId = IdFactory.getInstance().createId(req.getSession().getId());
- log.debug("Got request for hashdata for session " + sessionId);
- STALRequestBroker rb = getSTAL(sessionId);
- if (rb == null) {
- log.info("STAL instance not found for session: " + sessionId);
- resp.sendRedirect("expired.html");
- return;
- }
- List<HashDataInput> hdi = rb.getHashDataInput();
- log.debug("Got hashdata list with " + hdi.size() + " entries");
- String param = req.getParameter("refId");
- log.debug("Got request for refId:" + param);
- if ((param == null) && (hdi.size() > 1)) {
- resp.sendRedirect("multiHashDataInput.html");
- return;
- }
-
- if ((param == null) && (hdi.size() == 1)) {
- param = hdi.get(0).getReferenceId();
- log.debug("Request parameter not set, setting to: " + param);
- }
- for (HashDataInput hd : hdi) {
- if (hd.getReferenceId().equals(param)) {
- log.debug("Found hashdatainput for refId:" + param);
- resp.setContentType(hd.getMimeType());
-
- String charSet = hd.getEncoding();
- if (charSet == null) {
- charSet = "UTF-8";
- }
- resp.setCharacterEncoding(charSet);
- if (isMSIE(req)) {
- String fileExt = hd.getMimeType().equalsIgnoreCase("text/plain") ? ".txt"
- : ".xhtml";
- if (fileExt.equals(".xhtml")) {
- if (req.getParameter("ieCType") == null) {
- resp.sendRedirect("ieView.html");
- return;
- } else {
- resp.setContentType(req.getParameter("ieCType"));
- if (req.getParameter("ieCType").equals("application/xhtml+xml")) {
- resp.addHeader("content-disposition", "attachment; filename="
- + param + ".xhtml");
- }
- }
- }
- }
- Reader r = new InputStreamReader(hd.getHashDataInput(), charSet);
- Writer w = new OutputStreamWriter(resp.getOutputStream(), charSet);
- StreamUtil.copyStream(r, w);
- w.flush();
- return;
-
- }
- }
- log.error("Cannot find hashdata for id:" + param);
- resp.sendError(404);
- return;
- }
-
- @Override
- protected void doPost(HttpServletRequest req, HttpServletResponse resp)
- throws ServletException, IOException {
- doGet(req, resp);
- }
-
-}
diff --git a/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/ResultServlet.java b/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/ResultServlet.java
index 9e69099d..f271dfc9 100644
--- a/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/ResultServlet.java
+++ b/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/ResultServlet.java
@@ -31,7 +31,7 @@ import org.apache.commons.logging.LogFactory;
import at.gv.egiz.bku.binding.HTTPBindingProcessor;
import at.gv.egiz.bku.binding.HttpUtil;
import at.gv.egiz.bku.binding.IdFactory;
-import at.gv.egiz.bku.conf.Configurator;
+import at.gv.egiz.bku.utils.NullOutputStream;
/**
* Delivers the result to the browser
@@ -99,9 +99,20 @@ public class ResultServlet extends SpringBKUServlet {
resp.sendRedirect(expiredPage);
return;
}
-
- if (bp.getRedirectURL() != null) {
- resp.sendRedirect(bp.getRedirectURL());
+ String redirectUrl = (String) session
+ .getAttribute(BKURequestHandler.REDIRECT_URL_SESSION_ATTRIBUTE);
+ if (redirectUrl == null) {
+ redirectUrl = bp.getRedirectURL();
+ }
+ if (redirectUrl != null) {
+ try {
+ bp.writeResultTo(new NullOutputStream(), encoding);
+ getBindingProcessorManager().removeBindingProcessor(bp.getId());
+ } finally {
+ log.debug("Executing deferred browser redirect to: " + redirectUrl);
+ resp.sendRedirect(redirectUrl);
+ session.invalidate();
+ }
return;
}
resp.setStatus(bp.getResponseCode());
@@ -109,8 +120,8 @@ public class ResultServlet extends SpringBKUServlet {
resp.setHeader("Pragma", "no-cache"); // HTTP 1.0
resp.setDateHeader("Expires", 0);
if (configurator.getProperty(USER_AGENT_PROPERTY_KEY) != null) {
- resp.setHeader(HttpUtil.HTTP_HEADER_USER_AGENT, configurator.getProperty(
- USER_AGENT_PROPERTY_KEY));
+ resp.setHeader(HttpUtil.HTTP_HEADER_USER_AGENT, configurator
+ .getProperty(USER_AGENT_PROPERTY_KEY));
} else {
resp.setHeader(HttpUtil.HTTP_HEADER_USER_AGENT,
"citizen-card-environment/1.2 MOCCA Unknown");
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 d1fe045a..b77f7660 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,6 +22,7 @@ import at.gv.egiz.stal.STAL;
import at.gv.egiz.stal.service.types.RequestType;
import at.gv.egiz.stal.service.types.ResponseType;
import java.util.List;
+import javax.xml.bind.JAXBElement;
/**
*
@@ -32,9 +33,9 @@ public interface STALRequestBroker extends STAL {
public static final int ERR_4500 = 4500;
public static final long DEFAULT_TIMEOUT_MS = 1000*60*5; //5mn
- public List<RequestType> connect();
+ public List<JAXBElement<? extends RequestType>> connect();
- public List<RequestType> nextRequest(List<ResponseType> response);
+ public List<JAXBElement<? extends RequestType>> nextRequest(List<JAXBElement<? extends ResponseType>> responses);
public List<HashDataInput> 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 e7fb928a..252327d3 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
@@ -25,6 +25,7 @@ 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.ObjectFactory;
import at.gv.egiz.stal.service.types.QuitRequestType;
import at.gv.egiz.stal.service.types.RequestType;
import at.gv.egiz.stal.service.types.ResponseType;
@@ -34,6 +35,7 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Locale;
+import javax.xml.bind.JAXBElement;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -52,14 +54,12 @@ public class STALRequestBrokerImpl implements STALRequestBroker {
private static final Log log = LogFactory.getLog(STALRequestBrokerImpl.class);
-// private boolean expectingResponse = false;
+ private ObjectFactory stalObjFactory = new ObjectFactory();
+
private boolean interrupted = false;
-// private final RequestsMonitor reqMon = new RequestsMonitor();
-// private final ResponsesMonitor respMon = new ResponsesMonitor();
-
- protected ArrayList<RequestType> requests;
- protected ArrayList<ResponseType> responses;
+ protected final ArrayList<JAXBElement<? extends RequestType>> requests;
+ protected final ArrayList<JAXBElement<? extends ResponseType>> responses;
protected ArrayList<HashDataInput> hashDataInputs;
@@ -69,8 +69,8 @@ public class STALRequestBrokerImpl implements STALRequestBroker {
if (timeoutMillisec <= 0)
timeoutMillisec = DEFAULT_TIMEOUT_MS;
timeout = timeoutMillisec;
- requests = new ArrayList<RequestType>();
- responses = new ArrayList<ResponseType>();
+ requests = new ArrayList<JAXBElement<? extends RequestType>>();
+ responses = new ArrayList<JAXBElement<? extends ResponseType>>();
hashDataInputs = new ArrayList<HashDataInput>();
}
@@ -85,7 +85,7 @@ public class STALRequestBrokerImpl implements STALRequestBroker {
* @pre requests: either single SignRequest, QuitRequest or multiple ReadInfoboxRequests
*/
@Override
- public List<STALResponse> handleRequest(List<STALRequest> stalRequests) {
+ public List<STALResponse> handleRequest(List<? extends STALRequest> stalRequests) {
if (interrupted) {
return null;
}
@@ -95,36 +95,39 @@ public class STALRequestBrokerImpl implements STALRequestBroker {
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());
+ SignRequestType reqT = stalObjFactory.createSignRequestType();
+ reqT.setKeyIdentifier(((SignRequest) stalRequest).getKeyIdentifier());
+ reqT.setSignedInfo(((SignRequest) stalRequest).getSignedInfo());
+ JAXBElement<SignRequestType> req = stalObjFactory.createGetNextRequestResponseTypeSignRequest(reqT);
requests.add(req);
//DataObjectHashDataInput with reference caching enabled DataObject
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());
+ InfoboxReadRequestType reqT = new InfoboxReadRequestType();
+ reqT.setInfoboxIdentifier(((InfoboxReadRequest) stalRequest).getInfoboxIdentifier());
+ reqT.setDomainIdentifier(((InfoboxReadRequest) stalRequest).getDomainIdentifier());
+ JAXBElement<InfoboxReadRequestType> req = stalObjFactory.createGetNextRequestResponseTypeInfoboxReadRequest(reqT);
requests.add(req);
} else if (stalRequest instanceof QuitRequest) {
log.trace("Received QuitRequest, do not wait for responses.");
- requests.add(new QuitRequestType());
+ QuitRequestType reqT = stalObjFactory.createQuitRequestType();
+ JAXBElement<QuitRequestType> req = stalObjFactory.createGetNextRequestResponseTypeQuitRequest(reqT);
+ requests.add(req);
log.trace("notifying request consumers");
requests.notify();
-// reqMon.notify();
return new ArrayList<STALResponse>();
} else {
log.error("Received unsupported STAL request: " + stalRequest.getClass().getName() + ", send QUIT");
requests.clear();
- requests.add(new QuitRequestType());
+ QuitRequestType reqT = stalObjFactory.createQuitRequestType();
+ JAXBElement<QuitRequestType> req = stalObjFactory.createGetNextRequestResponseTypeQuitRequest(reqT);
+ requests.add(req);
log.trace("notifying request consumers");
requests.notify();
return new ArrayList<STALResponse>();
@@ -132,32 +135,25 @@ public class STALRequestBrokerImpl implements STALRequestBroker {
}
log.trace("notifying request consumers");
requests.notify();
-// reqMon.notify();
}
- synchronized (responses) { //respMon) {
+ synchronized (responses) {
long beforeWait = System.currentTimeMillis();
-// while (respMon.responses == null) {
while (responses.isEmpty()) {
log.trace("waiting to consume response");
-// 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);
- requests.clear(); //TODO sync on requests?
+ requests.clear();
hashDataInputs.clear();
return Collections.singletonList((STALResponse) new ErrorResponse(ERR_4500));
}
}
log.trace("consuming responses");
-// List<STALResponse> responses = respMon.consume();
List<STALResponse> resps = STALTranslator.toSTAL(responses);
responses.clear();
log.trace("notifying response producers");
responses.notify();
-// respMon.notify();
return resps;
}
@@ -169,7 +165,7 @@ public class STALRequestBrokerImpl implements STALRequestBroker {
}
@Override
- public List<RequestType> connect() {
+ public List<JAXBElement<? extends RequestType>> connect() {
if (interrupted) {
return null;
}
@@ -181,15 +177,9 @@ public class STALRequestBrokerImpl implements STALRequestBroker {
requests.wait(timeout);
if (System.currentTimeMillis() - beforeWait >= timeout) {
log.warn("timeout while waiting to consume request");
- return Collections.singletonList((RequestType) new QuitRequestType());
+ return createSingleQuitRequest();
}
}
-
-// log.trace("consume request");
-// List<RequestType> reqs = new ArrayList<RequestType>();
-// reqs.addAll(requests);
-// requests.clear();
-// return reqs;
log.trace("don't consume request now, leave for further connect calls");
return requests;
}
@@ -212,7 +202,7 @@ public class STALRequestBrokerImpl implements STALRequestBroker {
* @return QUIT if expected responses are not provided
*/
@Override
- public List<RequestType> nextRequest(List<ResponseType> resps) {
+ public List<JAXBElement<? extends RequestType>> nextRequest(List<JAXBElement<? extends ResponseType>> resps) {
if (interrupted) {
return null;
}
@@ -227,69 +217,43 @@ public class STALRequestBrokerImpl implements STALRequestBroker {
}
}
- synchronized (responses) { //respMon) {
+ synchronized (responses) {
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 (!responses.isEmpty()) {
log.trace("waiting to produce response");
-// respMon.wait(timeout);
responses.wait(timeout);
if (System.currentTimeMillis() - beforeWait >= timeout) {
log.warn("timeout while waiting to produce response");
- return Collections.singletonList((RequestType) new QuitRequestType());
+ return createSingleQuitRequest();
}
}
log.trace("produce response");
-// respMon.produce(resps);
responses.addAll(resps);
//reset HashDataInputCallback iff SignResponse
if (log.isTraceEnabled()) {
- for (ResponseType response : resps) {
- log.trace("Received STAL response: " + response.getClass().getName());
+ for (JAXBElement<? extends ResponseType> response : resps) {
+ log.trace("Received STAL response: " + response.getValue().getClass().getName());
}
}
log.trace("notifying response consumers");
-// respMon.notify();
responses.notify();
} else {
-// 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());
+ return createSingleQuitRequest();
}
}
- synchronized (requests) { //reqMon) {
+ synchronized (requests) {
long beforeWait = System.currentTimeMillis();
-// while (reqMon.requests == null) {
while (requests.isEmpty()) {
log.trace("waiting to consume request");
-// reqMon.wait(timeout);
requests.wait(timeout);
if (System.currentTimeMillis() - beforeWait >= timeout) {
log.warn("timeout while waiting to consume request");
- return Collections.singletonList((RequestType) new QuitRequestType());
+ return createSingleQuitRequest();
}
}
-// log.trace("consume request");
-// List<RequestType> reqs = new ArrayList<RequestType>(); // 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;
log.trace("don't consume request now, but on next response delivery");
return requests;
}
@@ -304,92 +268,19 @@ public class STALRequestBrokerImpl implements STALRequestBroker {
public List<HashDataInput> getHashDataInput() {
synchronized (requests) {
log.trace("return " + hashDataInputs.size() + " current HashDataInput(s) ");
- return hashDataInputs; //reqMon.getHashDataInput();
+ return hashDataInputs;
}
}
@Override
public void setLocale(Locale locale) {
}
-
-// class RequestsMonitor {
-// List<STALRequest> requests;
-// List<HashDataInput> hashDataInput;
-//
-// void produce(List<STALRequest> req) {
-// requests = req;
-// }
-//
-// synchronized List<at.gv.egiz.stal.service.types.STALRequest> consume() {
-// List<at.gv.egiz.stal.service.types.STALRequest> reqs = new ArrayList<at.gv.egiz.stal.service.types.STALRequest>();
-// 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<HashDataInput> hdi) {
-// hashDataInput = hdi;
-// }
-//
-// List<HashDataInput> getHashDataInput() {
-// return hashDataInput;
-// }
-// }
-//
-// /** TODO: now, that responses are not nulled, synchronize directly on responses? */
-// class ResponsesMonitor {
-// List<at.gv.egiz.stal.service.types.STALResponse> responses;
-//
-// void produce(List<at.gv.egiz.stal.service.types.STALResponse> resp) {
-// responses = resp;
-// }
-//
-// synchronized List<STALResponse> consume() {
-// List<STALResponse> resps = new ArrayList<STALResponse>();
-//
-// 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;
-// }
-// }
+
+ private List<JAXBElement<? extends RequestType>> createSingleQuitRequest() {
+ QuitRequestType quitT = stalObjFactory.createQuitRequestType();
+ JAXBElement<QuitRequestType> quit = stalObjFactory.createGetNextRequestResponseTypeQuitRequest(quitT);
+ ArrayList<JAXBElement<? extends RequestType>> l = new ArrayList<JAXBElement<? extends RequestType>>();
+ l.add(quit);
+ return l;
+ }
}
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 05a3f5e5..45629869 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
@@ -14,9 +14,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package at.gv.egiz.stal.service.impl;
+//import at.buergerkarte.namespaces.cardchannel.service.CommandAPDUType;
+//import at.buergerkarte.namespaces.cardchannel.service.ScriptType;
import at.gv.egiz.bku.binding.BindingProcessor;
import at.gv.egiz.bku.binding.BindingProcessorManager;
import at.gv.egiz.bku.binding.Id;
@@ -36,6 +37,7 @@ 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 com.sun.xml.ws.developer.UsesJAXBContext;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
@@ -46,6 +48,7 @@ import java.util.Map;
import javax.annotation.Resource;
import javax.jws.WebService;
import javax.servlet.ServletContext;
+import javax.xml.bind.JAXBElement;
import javax.xml.ws.WebServiceContext;
import javax.xml.ws.handler.MessageContext;
import org.apache.commons.logging.Log;
@@ -56,46 +59,45 @@ import org.apache.commons.logging.LogFactory;
* @author clemens
*/
@WebService(endpointInterface = "at.gv.egiz.stal.service.STALPortType")
+@UsesJAXBContext(STALXJAXBContextFactory.class)
public class STALServiceImpl implements STALPortType {
public static final String BINDING_PROCESSOR_MANAGER = "bindingProcessorManager";
public static final Id TEST_SESSION_ID = IdFactory.getInstance().createId("TestSession");
-
protected static final Log log = LogFactory.getLog(STALServiceImpl.class);
-
+
+
static {
-
if (log.isTraceEnabled()) {
log.trace("enabling webservice communication dump");
System.setProperty("com.sun.xml.ws.transport.http.HttpAdapter.dump", "true");
} else {
System.setProperty("com.sun.xml.ws.fault.SOAPFaultBuilder.disableCaptureStackTrace", "false");
}
-
}
-
@Resource
- WebServiceContext wsContext;
+ protected WebServiceContext wsContext;
protected IdFactory idF = IdFactory.getInstance();
+ private at.gv.egiz.stal.service.types.ObjectFactory stalObjFactory = new at.gv.egiz.stal.service.types.ObjectFactory();
+// private at.buergerkarte.namespaces.cardchannel.service.ObjectFactory ccObjFactory = new at.buergerkarte.namespaces.cardchannel.service.ObjectFactory();
-
@Override
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)) {
return getTestSessionNextRequestResponse(null);
}
-
+
GetNextRequestResponseType response = new GetNextRequestResponseType();
response.setSessionId(sessionId.toString());
@@ -103,7 +105,7 @@ public class STALServiceImpl implements STALPortType {
if (stal != null) {
- List<RequestType> requestsOut = ((STALRequestBroker) stal).connect();
+ List<JAXBElement<? extends RequestType>> requestsOut = ((STALRequestBroker) stal).connect();
response.getInfoboxReadRequestOrSignRequestOrQuitRequest().addAll(requestsOut);
if (log.isDebugEnabled()) {
@@ -112,29 +114,32 @@ public class STALServiceImpl implements STALPortType {
sb.append("] containing ");
sb.append(requestsOut.size());
sb.append(" requests: ");
- for (RequestType reqOut : requestsOut) {
- sb.append(reqOut.getClass());
+ for (JAXBElement<? extends RequestType> reqOut : requestsOut) {
+ sb.append(reqOut.getValue().getClass());
sb.append(' ');
}
log.debug(sb.toString());
}
} else {
log.error("Failed to get STAL for session " + sessionId + ", returning QuitRequest");
- response.getInfoboxReadRequestOrSignRequestOrQuitRequest().add(new QuitRequestType());
+ QuitRequestType quitT = stalObjFactory.createQuitRequestType();
+ JAXBElement<QuitRequestType> quit = stalObjFactory.createGetNextRequestResponseTypeQuitRequest(quitT);
+ response.getInfoboxReadRequestOrSignRequestOrQuitRequest().add(quit);
}
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<ResponseType> responsesIn = request.getInfoboxReadResponseOrSignResponseOrErrorResponse();//getResponse();
+ List<JAXBElement<? extends ResponseType>> responsesIn = request.getInfoboxReadResponseOrSignResponseOrErrorResponse();
+// List<ResponseType> responsesIn = request.getInfoboxReadResponseOrSignResponseOrErrorResponse();//getResponse();
if (log.isDebugEnabled()) {
StringBuilder sb = new StringBuilder("Received GetNextRequest [");
@@ -142,25 +147,25 @@ public class STALServiceImpl implements STALPortType {
sb.append("] containing ");
sb.append(responsesIn.size());
sb.append(" responses: ");
- for (ResponseType respIn : responsesIn) {
+ for (Object respIn : responsesIn) {
sb.append(respIn.getClass());
sb.append(' ');
}
log.debug(sb.toString());
}
-
+
if (TEST_SESSION_ID.equals(sessionId)) {
return getTestSessionNextRequestResponse(responsesIn);
}
GetNextRequestResponseType response = new GetNextRequestResponseType();
response.setSessionId(sessionId.toString());
-
+
STALRequestBroker stal = getStal(sessionId);
if (stal != null) {
- List<RequestType> requestsOut = ((STALRequestBroker) stal).nextRequest(responsesIn);
+ List<JAXBElement<? extends RequestType>> requestsOut = ((STALRequestBroker) stal).nextRequest(responsesIn);
response.getInfoboxReadRequestOrSignRequestOrQuitRequest().addAll(requestsOut);
if (log.isDebugEnabled()) {
@@ -169,15 +174,17 @@ public class STALServiceImpl implements STALPortType {
sb.append("] containing ");
sb.append(requestsOut.size());
sb.append(" requests: ");
- for (RequestType reqOut : requestsOut) {
- sb.append(reqOut.getClass());
+ for (JAXBElement<? extends RequestType> reqOut : requestsOut) {
+ sb.append(reqOut.getValue().getClass());
sb.append(' ');
}
log.debug(sb.toString());
}
} else {
log.error("Failed to get STAL for session " + sessionId + ", returning QuitRequest");
- response.getInfoboxReadRequestOrSignRequestOrQuitRequest().add(new QuitRequestType());
+ QuitRequestType quitT = stalObjFactory.createQuitRequestType();
+ JAXBElement<QuitRequestType> quit = stalObjFactory.createGetNextRequestResponseTypeQuitRequest(quitT);
+ response.getInfoboxReadRequestOrSignRequestOrQuitRequest().add(quit);
}
return response;
}
@@ -188,7 +195,7 @@ public class STALServiceImpl implements STALPortType {
if (request.getSessionId() == null) {
throw new NullPointerException("No session id provided");
}
-
+
Id sessionId = idF.createId(request.getSessionId());
if (log.isDebugEnabled()) {
@@ -197,13 +204,13 @@ public class STALServiceImpl implements STALPortType {
GetHashDataInputResponseType response = new GetHashDataInputResponseType();
response.setSessionId(sessionId.toString());
-
+
if (TEST_SESSION_ID.equals(sessionId)) {
log.debug("Received GetHashDataInput for session " + TEST_SESSION_ID + ", return DummyHashDataInput");
GetHashDataInputResponseType.Reference ref = new GetHashDataInputResponseType.Reference();
ref.setID("signed-data-reference-0-1214921968-27971781-24309"); //Reference-" + TEST_SESSION_ID + "-001");
ref.setMimeType("text/plain");
-
+
Charset charset;
try {
charset = Charset.forName("iso-8859-15");
@@ -316,30 +323,52 @@ public class STALServiceImpl implements STALPortType {
return (bp == null) ? null : (bp.isFinished() ? null : (STALRequestBroker) bp.getSTAL());
}
- private GetNextRequestResponseType getTestSessionNextRequestResponse(List<ResponseType> responsesIn) {
+ private GetNextRequestResponseType getTestSessionNextRequestResponse(List<JAXBElement<? extends ResponseType>> 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());
+
+ List<JAXBElement<? extends RequestType>> reqs = response.getInfoboxReadRequestOrSignRequestOrQuitRequest();
+
+ if (responsesIn == null) {
+ log.info("[TestSession] received CONNECT, return dummy requests ");
+// ScriptType scriptT = ccObjFactory.createScriptType();
+// CommandAPDUType cmd = ccObjFactory.createCommandAPDUType();
+// cmd.setValue("TestSession CardChannelCMD 1234".getBytes());
+// scriptT.getResetOrCommandAPDUOrVerifyAPDU().add(cmd);
+// reqs.add(ccObjFactory.createScript(scriptT));
+ addDummyRequests(reqs);
+ } else if (responsesIn != null && responsesIn.size() > 0 && responsesIn.get(0).getValue() instanceof ErrorResponseType) {
+ log.info("[TestSession] received ErrorResponse, return QUIT request");
+ QuitRequestType quitT = stalObjFactory.createQuitRequestType();
+ reqs.add(stalObjFactory.createGetNextRequestResponseTypeQuitRequest(quitT));
} else {
- log.info("Received TestSession GetNextRequest, returning SignRequest and 3 InfoboxReadRequests ");
- InfoboxReadRequestType req = new InfoboxReadRequestType();
- req.setInfoboxIdentifier("IdentityLink");
- req.setDomainIdentifier("hansiwurzel");
- response.getInfoboxReadRequestOrSignRequestOrQuitRequest().add(req);
- SignRequestType sig = new SignRequestType();
- sig.setKeyIdentifier("SecureSignatureKeypair");
- sig.setSignedInfo("<dsig:SignedInfo xmlns:dsig=\"http://www.w3.org/2000/09/xmldsig#\" xmlns:xpf=\"http://www.w3.org/2002/06/xmldsig-filter2\"><dsig:CanonicalizationMethod Algorithm=\"http://www.w3.org/TR/2001/REC-xml-c14n-20010315\" /> <dsig:SignatureMethod Algorithm=\"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha1\" /> <dsig:Reference Id=\"signed-data-reference-0-1214921968-27971781-24309\" URI=\"#signed-data-object-0-1214921968-27971781-13578\"><dsig:Transforms> <dsig:Transform Algorithm=\"http://www.w3.org/2002/06/xmldsig-filter2\"> <xpf:XPath xmlns:xpf=\"http://www.w3.org/2002/06/xmldsig-filter2\" Filter=\"intersect\">id('signed-data-object-0-1214921968-27971781-13578')/node()</xpf:XPath></dsig:Transform></dsig:Transforms><dsig:DigestMethod Algorithm=\"http://www.w3.org/2000/09/xmldsig#sha1\" /> <dsig:DigestValue>H1IePEEfGQ2SG03H6LTzw1TpCuM=</dsig:DigestValue></dsig:Reference><dsig:Reference Id=\"etsi-data-reference-0-1214921968-27971781-25439\" Type=\"http://uri.etsi.org/01903/v1.1.1#SignedProperties\" URI=\"#xmlns(etsi=http://uri.etsi.org/01903/v1.1.1%23)%20xpointer(id('etsi-data-object-0-1214921968-27971781-3095')/child::etsi:QualifyingProperties/child::etsi:SignedProperties)\"><dsig:DigestMethod Algorithm=\"http://www.w3.org/2000/09/xmldsig#sha1\" /><dsig:DigestValue>yV6Q+I60buqR4mMaxA7fi+CV35A=</dsig:DigestValue></dsig:Reference></dsig:SignedInfo>".getBytes());
- response.getInfoboxReadRequestOrSignRequestOrQuitRequest().add(sig);
- req = new InfoboxReadRequestType();
- req.setInfoboxIdentifier("CertifiedKeypair");
- response.getInfoboxReadRequestOrSignRequestOrQuitRequest().add(req);
- req = new InfoboxReadRequestType();
- req.setInfoboxIdentifier("SecureSignatureKeypair");
- response.getInfoboxReadRequestOrSignRequestOrQuitRequest().add(req);
+ log.info("[TestSession] received " + responsesIn.size() + " response(s), return dummy requests" );
+ addDummyRequests(reqs);
}
return response;
}
+
+ private void addDummyRequests(List<JAXBElement<? extends RequestType>> reqs) {
+// log.info("[TestSession] add READ request for Infobox IdentityLink");
+// InfoboxReadRequestType ibrT1 = stalObjFactory.createInfoboxReadRequestType();
+// ibrT1.setInfoboxIdentifier("IdentityLink");
+// reqs.add(stalObjFactory.createGetNextRequestResponseTypeInfoboxReadRequest(ibrT1));
+
+ log.info("[TestSession] add READ request for Infobox CertifiedKeypair");
+ InfoboxReadRequestType ibrT2 = stalObjFactory.createInfoboxReadRequestType();
+ ibrT2.setInfoboxIdentifier("CertifiedKeypair");
+ reqs.add(stalObjFactory.createGetNextRequestResponseTypeInfoboxReadRequest(ibrT2));
+
+ log.info("[TestSession] add READ request for Infobox SecureSignatureKeypair");
+ InfoboxReadRequestType ibrT3 = stalObjFactory.createInfoboxReadRequestType();
+ ibrT3.setInfoboxIdentifier("SecureSignatureKeypair");
+ reqs.add(stalObjFactory.createGetNextRequestResponseTypeInfoboxReadRequest(ibrT3));
+
+ log.info("[TestSession] add SIGN request");
+ SignRequestType sigT1 = stalObjFactory.createSignRequestType();
+ sigT1.setKeyIdentifier("SecureSignatureKeypair");
+ sigT1.setSignedInfo("<dsig:SignedInfo xmlns:dsig=\"http://www.w3.org/2000/09/xmldsig#\" xmlns:xpf=\"http://www.w3.org/2002/06/xmldsig-filter2\"><dsig:CanonicalizationMethod Algorithm=\"http://www.w3.org/TR/2001/REC-xml-c14n-20010315\" /> <dsig:SignatureMethod Algorithm=\"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha1\" /> <dsig:Reference Id=\"signed-data-reference-0-1214921968-27971781-24309\" URI=\"#signed-data-object-0-1214921968-27971781-13578\"><dsig:Transforms> <dsig:Transform Algorithm=\"http://www.w3.org/2002/06/xmldsig-filter2\"> <xpf:XPath xmlns:xpf=\"http://www.w3.org/2002/06/xmldsig-filter2\" Filter=\"intersect\">id('signed-data-object-0-1214921968-27971781-13578')/node()</xpf:XPath></dsig:Transform></dsig:Transforms><dsig:DigestMethod Algorithm=\"http://www.w3.org/2000/09/xmldsig#sha1\" /> <dsig:DigestValue>H1IePEEfGQ2SG03H6LTzw1TpCuM=</dsig:DigestValue></dsig:Reference><dsig:Reference Id=\"etsi-data-reference-0-1214921968-27971781-25439\" Type=\"http://uri.etsi.org/01903/v1.1.1#SignedProperties\" URI=\"#xmlns(etsi=http://uri.etsi.org/01903/v1.1.1%23)%20xpointer(id('etsi-data-object-0-1214921968-27971781-3095')/child::etsi:QualifyingProperties/child::etsi:SignedProperties)\"><dsig:DigestMethod Algorithm=\"http://www.w3.org/2000/09/xmldsig#sha1\" /><dsig:DigestValue>yV6Q+I60buqR4mMaxA7fi+CV35A=</dsig:DigestValue></dsig:Reference></dsig:SignedInfo>".getBytes());
+ reqs.add(stalObjFactory.createGetNextRequestResponseTypeSignRequest(sigT1));
+ }
+
}
diff --git a/BKUOnline/src/main/java/at/gv/egiz/stal/service/impl/STALXJAXBContextFactory.java b/BKUOnline/src/main/java/at/gv/egiz/stal/service/impl/STALXJAXBContextFactory.java
new file mode 100644
index 00000000..92559254
--- /dev/null
+++ b/BKUOnline/src/main/java/at/gv/egiz/stal/service/impl/STALXJAXBContextFactory.java
@@ -0,0 +1,61 @@
+/*
+ * 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.impl;
+
+import com.sun.xml.bind.api.JAXBRIContext;
+import com.sun.xml.bind.api.TypeReference;
+import com.sun.xml.ws.api.model.SEIModel;
+import com.sun.xml.ws.developer.JAXBContextFactory;
+import java.util.ArrayList;
+import java.util.List;
+import javax.xml.bind.JAXBException;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ *
+ * @author Clemens Orthacker <clemens.orthacker@iaik.tugraz.at>
+ */
+public class STALXJAXBContextFactory implements JAXBContextFactory {
+
+ private static final Log log = LogFactory.getLog(STALXJAXBContextFactory.class);
+
+ @Override
+ public JAXBRIContext createJAXBContext(SEIModel sei, List<Class> classesToBind, List<TypeReference> typeReferences) throws JAXBException {
+ if (log.isTraceEnabled()) {
+ log.trace("JAXBContext seed for SEI " + sei.getTargetNamespace() + ":");
+ for (Class class1 : classesToBind) {
+ log.trace(" " + class1);
+ }
+ for (TypeReference typeReference : typeReferences) {
+ log.trace(" typeRef " + typeReference.tagName + " -> " + typeReference.type);
+ }
+ }
+ List<Class> classes = new ArrayList<Class>();
+ classes.addAll(classesToBind);
+// Class ccOF = at.buergerkarte.namespaces.cardchannel.service.ObjectFactory.class;
+// if (!classes.contains(ccOF)) {
+// log.debug("adding " + ccOF + " to JAXBContext seed");
+// classes.add(ccOF);
+// }
+
+ //TODO add typeReference?
+
+ return JAXBRIContext.newInstance(classes.toArray(new Class[classes.size()]),
+ typeReferences, null, sei.getTargetNamespace(), false, null);
+ }
+}
diff --git a/BKUOnline/src/main/webapp/WEB-INF/applicationContext.xml b/BKUOnline/src/main/webapp/WEB-INF/applicationContext.xml
index 4069cdc9..321e1e98 100644
--- a/BKUOnline/src/main/webapp/WEB-INF/applicationContext.xml
+++ b/BKUOnline/src/main/webapp/WEB-INF/applicationContext.xml
@@ -18,15 +18,50 @@
<bean id="STALFactory" class="at.gv.egiz.stal.service.impl.RequestBrokerSTALFactory"
scope="singleton" />
- <bean id="accessController" class="at.gv.egiz.bku.online.accesscontroller.SpringSecurityManager"
+ <bean id="accessController"
+ class="at.gv.egiz.bku.online.accesscontroller.SpringSecurityManager"
scope="singleton" init-method="init">
- <property name="config" ref="configurator"/>
- </bean>
+ <property name="config" ref="configurator" />
+ </bean>
<bean id="commandInvoker" class="at.gv.egiz.bku.binding.SLCommandInvokerImpl">
<property name="securityManager" ref="accessController" />
</bean>
+ <bean id="slCommandFactory" class="at.gv.egiz.bku.slcommands.SLCommandFactory"
+ factory-method="getInstance">
+ <property name="commandImpl">
+ <map>
+ <entry
+ key="http://www.buergerkarte.at/namespaces/securitylayer/1.2#:NullOperationRequest"
+ value="at.gv.egiz.bku.slcommands.impl.NullOperationCommandImpl" />
+ <entry
+ key="http://www.buergerkarte.at/namespaces/securitylayer/1.2#:InfoboxReadRequest"
+ value="at.gv.egiz.bku.slcommands.impl.InfoboxReadCommandImpl" />
+ <entry
+ key="http://www.buergerkarte.at/namespaces/securitylayer/1.2#:CreateXMLSignatureRequest"
+ value="at.gv.egiz.bku.slcommands.impl.CreateXMLSignatureCommandImpl" />
+ </map>
+ </property>
+ </bean>
+
+ <bean id="infoboxFactory" class="at.gv.egiz.bku.slcommands.impl.InfoboxFactory"
+ factory-method="getInstance">
+ <property name="infoboxImpl">
+ <map>
+ <entry
+ key="Certificates"
+ value="at.gv.egiz.bku.slcommands.impl.CertificatesInfoboxImpl" />
+ <entry
+ key="IdentityLink"
+ value="at.gv.egiz.bku.slcommands.impl.IdentityLinkInfoboxImpl" />
+<!-- <entry-->
+<!-- key="CardChannel"-->
+<!-- value="at.gv.egiz.bku.slcommands.impl.CardChannelInfoboxImpl" />-->
+ </map>
+ </property>
+ </bean>
+
<bean id="bindingProcessorManager" class="at.gv.egiz.bku.binding.BindingProcessorManagerImpl"
scope="singleton">
<constructor-arg ref="STALFactory"></constructor-arg>
@@ -46,16 +81,17 @@
<!-- Configure Configuration -->
<bean id="certValidator" class="at.gv.egiz.bku.conf.CertValidatorImpl"></bean>
-
-
+
+
<bean id="configurator" class="at.gv.egiz.bku.online.conf.SpringConfigurator"
- init-method="configure" scope="singleton">
- <property name="resource" value="classpath:at/gv/egiz/bku/online/conf/defaultConf.properties"/>
+ init-method="configure" scope="singleton">
+ <property name="resource"
+ value="classpath:at/gv/egiz/bku/online/conf/defaultConf.properties" />
<property name="certValidator" ref="certValidator"></property>
</bean>
-
+
<!-- Shutdown Event handler -->
- <bean id="shutdown" class="at.gv.egiz.bku.online.webapp.ShutdownHandler">
- <property name="bindingProcessorManager" ref="bindingProcessorManager"></property>
- </bean>
+ <bean id="shutdown" class="at.gv.egiz.bku.online.webapp.ShutdownHandler">
+ <property name="bindingProcessorManager" ref="bindingProcessorManager"></property>
+ </bean>
</beans> \ No newline at end of file
diff --git a/BKUOnline/src/main/webapp/WEB-INF/web.xml b/BKUOnline/src/main/webapp/WEB-INF/web.xml
index f6fdbefc..cc37b782 100644
--- a/BKUOnline/src/main/webapp/WEB-INF/web.xml
+++ b/BKUOnline/src/main/webapp/WEB-INF/web.xml
@@ -48,10 +48,10 @@
<param-value>expired.html</param-value>
</init-param>
</servlet>
- <servlet>
- <servlet-name>HashDataInputServlet</servlet-name>
- <servlet-class>at.gv.egiz.bku.online.webapp.HashDataInputServlet</servlet-class>
- </servlet>
+ <servlet>
+ <servlet-name>BKUApplet</servlet-name>
+ <jsp-file>/applet.jsp</jsp-file>
+ </servlet>
<servlet>
<servlet-name>help</servlet-name>
<jsp-file>/help.jsp</jsp-file>
@@ -68,10 +68,6 @@
<servlet-name>ResultServlet</servlet-name>
<url-pattern>/bkuResult</url-pattern>
</servlet-mapping>
- <servlet-mapping>
- <servlet-name>HashDataInputServlet</servlet-name>
- <url-pattern>/hashDataInput</url-pattern>
- </servlet-mapping>
<servlet-mapping>
<servlet-name>help</servlet-name>
<url-pattern>/help/*</url-pattern>
diff --git a/BKUOnline/src/main/webapp/WEB-INF/wsdl/stal.wsdl b/BKUOnline/src/main/webapp/WEB-INF/wsdl/stal.wsdl
index 344e5ce2..9ef43f39 100644
--- a/BKUOnline/src/main/webapp/WEB-INF/wsdl/stal.wsdl
+++ b/BKUOnline/src/main/webapp/WEB-INF/wsdl/stal.wsdl
@@ -18,29 +18,37 @@
<definitions name="stal" targetNamespace="http://www.egiz.gv.at/wsdl/stal"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://www.egiz.gv.at/wsdl/stal" xmlns:ns="http://www.egiz.gv.at/stal" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:tns="http://www.egiz.gv.at/wsdl/stal"
+ xmlns:stal="http://www.egiz.gv.at/stal"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
<types>
<xsd:schema targetNamespace="http://www.egiz.gv.at/wsdl/stal">
- <xsd:import namespace="http://www.egiz.gv.at/stal" schemaLocation="stal.xsd"/>
+ <xsd:import namespace="http://www.egiz.gv.at/stal" schemaLocation="stal-service.xsd"/>
+ <!--xsd:import namespace="http://www.egiz.gv.at/stal" schemaLocation="stal-extended.xsd"/-->
</xsd:schema>
+ <!-- test
+ <xsd:schema targetNamespace="http://www.egiz.gv.at/wsdl/stal-extended">
+ <xsd:import namespace="http://www.buergerkarte.at/cardchannel" schemaLocation="CardChannel.xsd"/>
+ </xsd:schema-->
</types>
<message name="ConnectRequest">
- <part name="part1" element="ns:SessionId"/>
+ <part name="part1" element="stal:SessionId"/>
</message>
<message name="NextRequestRequest">
- <part name="part1" element="ns:GetNextRequest"/>
+ <part name="part1" element="stal:GetNextRequest"/>
</message>
<message name="NextRequestResponse">
- <part name="part1" element="ns:GetNextRequestResponse"/>
+ <part name="part1" element="stal:GetNextRequestResponse"/>
</message>
<message name="GetHashDataInputRequest">
- <part name="part1" element="ns:GetHashDataInput"/>
+ <part name="part1" element="stal:GetHashDataInput"/>
</message>
<message name="GetHashDataInputResponse">
- <part name="part1" element="ns:GetHashDataInputResponse"/>
+ <part name="part1" element="stal:GetHashDataInputResponse"/>
</message>
<message name="GetHashDataInputFault">
- <part name="part1" element="ns:GetHashDataInputFault"/>
+ <part name="part1" element="stal:GetHashDataInputFault"/>
</message>
<portType name="STALPortType">
<operation name="connect">
diff --git a/BKUOnline/src/main/webapp/applet.jsp b/BKUOnline/src/main/webapp/applet.jsp
new file mode 100644
index 00000000..44d9347c
--- /dev/null
+++ b/BKUOnline/src/main/webapp/applet.jsp
@@ -0,0 +1,70 @@
+<!--
+ 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.
+-->
+<%@ page language="java" contentType="text/html; charset=UTF-8"
+ pageEncoding="UTF-8"%>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <title>MOCCA Applet</title>
+ <link rel="shortcut icon" href="img/favicon.ico" type="image/x-icon">
+ <script type="text/javascript" src="js/deployJava.js"></script>
+ <style type="text/css" media="all">@import "css/login.css";</style>
+
+ <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
+ <META HTTP-EQUIV="EXPIRES" CONTENT="Mon, 22 Jul 2002 11:12:01 GMT">
+ <META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
+ </head>
+ <%
+ int width = session.getAttribute("appletWidth") == null ? 190
+ : (Integer) session.getAttribute("appletWidth"); //230 for workshop demo integration
+ int height = session.getAttribute("appletHeight") == null ? 130
+ : (Integer) session.getAttribute("appletHeight");
+ String backgroundImg = (String) session.getAttribute("appletBackground");
+ String guiStyle = (String) session.getAttribute("appletGuiStyle");
+ String locale = (String) session.getAttribute("locale");
+ %>
+ <body id="appletpage" style="width:<%=width%>">
+ <script>
+ if (!deployJava.versionCheck('1.6.0_04+')) {
+ document
+ .write('<b>Diese Anwendung benötigt die Java Platform Version 1.6.0_04 oder höher.</b>' + '<input type="submit" value="Java Platform 1.6.0_02 installieren" onclick="deployJava.installLatestJRE();">');
+ } else {
+ var attributes = {
+ codebase :'applet',
+ code :'at.gv.egiz.bku.online.applet.BKUApplet.class',
+ archive :'BKUApplet.jar, commons-logging-1.1.1.jar, iaik_jce_me4se-3.04.jar',
+ width : <%=width%>,
+ height :<%=height%>
+ };
+ var parameters = {
+ GuiStyle : '<%=guiStyle%>',
+ Locale : '<%=locale%>',
+ Background : '<%=backgroundImg%>',
+ WSDL_URL :'../stal;jsessionid=<%=session.getId()%>?wsdl',
+ HelpURL : '../help/',
+ SessionID : '<%=session.getId()%>',
+ RedirectURL : '../bkuResult',
+ RedirectTarget: '_parent'
+ };
+ var version = '1.6.0_04';
+ deployJava.runApplet(attributes, parameters, version);
+ }
+ </script>
+ </body>
+</html>
diff --git a/BKUOnline/src/main/webapp/appletPage.jsp b/BKUOnline/src/main/webapp/appletPage.jsp
deleted file mode 100644
index b2fcf4a4..00000000
--- a/BKUOnline/src/main/webapp/appletPage.jsp
+++ /dev/null
@@ -1,71 +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.
--->
-<%@ page language="java" contentType="text/html; charset=UTF-8"
- pageEncoding="UTF-8"%>
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<title>MOCCA Applet</title>
-<link rel="shortcut icon" href="img/favicon.ico" type="image/x-icon">
-<script type="text/javascript" src="js/deployJava.js"></script>
-<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
-<META HTTP-EQUIV="EXPIRES" CONTENT="Mon, 22 Jul 2002 11:12:01 GMT">
-<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
-</head>
-<body>
-<%
- int width = session.getAttribute("appletWidth") == null ? 190
- : (Integer) session.getAttribute("appletWidth");
- int height = session.getAttribute("appletHeight") == null ? 130
- : (Integer) session.getAttribute("appletHeight");
- String backgroundImg = (String) session.getAttribute("appletBackground");
- String guiStyle = (String) session.getAttribute("appletGuiStyle");
- String hashDataDisplay = (String) session.getAttribute("appletHashDataDisplay");
-%>
-<script>
- if (!deployJava.versionCheck('1.6.0_04+')) {
- document
- .write('<b>Diese Anwendung benötigt die Java Platform Version 1.6.0_04 oder höher.</b>' + '<input type="submit" value="Java Platform 1.6.0_02 installieren" onclick="deployJava.installLatestJRE();">');
- } else {
- var attributes = {
- codebase :'applet',
- code :'at.gv.egiz.bku.online.applet.BKUApplet.class',
- archive :'BKUApplet-1.0.2, commons-logging-1.1.1.jar, iaik_jce_me4se-3.04.jar',
- width : <%=width%>,
- height :<%=height%>
- };
- var parameters = {
- GuiStyle : '<%=guiStyle%>',
- Background : '<%=backgroundImg%>',
- WSDL_URL :'../stal?wsdl',
- HelpURL : '../help/',
- HashDataDisplay : '<%=hashDataDisplay%>',
- HashDataURL : '../hashDataInput',
- SessionID : '<%=session.getId()%>',
- RedirectURL : '../bkuResult',
- RedirectTarget: '_parent'
- };
- var version = '1.6.0_04';
- deployJava.runApplet(attributes, parameters, version);
- }
-</script>
-<!--br />
-<hr/>
-Powered by <img src="img/mocca-t_s.png" alt="mocca-logo" width="100"-->
-</body>
-</html>
diff --git a/BKUOnline/src/main/webapp/css/login.css b/BKUOnline/src/main/webapp/css/login.css
new file mode 100644
index 00000000..4bfbd77d
--- /dev/null
+++ b/BKUOnline/src/main/webapp/css/login.css
@@ -0,0 +1,16 @@
+
+root {
+ display: block;
+}
+
+body {
+ background: #ffffff;
+ /*background-image: url(../img/mocca-t_s.png);*/
+ padding: 0;
+ margin: 0;
+ border-style: none;
+ /*
+ width:<%=width%>
+ */
+}
+
diff --git a/BKUOnline/src/main/webapp/help.jsp b/BKUOnline/src/main/webapp/help.jsp
index 72781e38..d7dbf0ef 100644
--- a/BKUOnline/src/main/webapp/help.jsp
+++ b/BKUOnline/src/main/webapp/help.jsp
@@ -16,14 +16,20 @@
-->
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
-<%@ page import="java.util.Locale"%>
+<%@ page import="java.io.File"%>
<%
- String pathInfo[] = (request.getPathInfo() != null) ? request
+ String pathInfo[] = (request.getPathInfo() != null) ? request
.getPathInfo().split("/") : new String[] {};
- String language = pathInfo[1].split("_")[0];
- String filename = pathInfo[2];
- String path = "/helpfiles/" + language.toLowerCase() + "/" + filename;
- System.out.println(path);
+ String language = pathInfo[1].split("_")[0];
+ String filename = pathInfo[2];
+ String helpDir = "/helpfiles";
+ String path;
+ if ((new File(helpDir + "/" + language.toLowerCase())).isDirectory()) {
+ path = helpDir + "/" + language.toLowerCase() + "/" + filename;
+ } else {
+ path = helpDir + "/de/" + filename;
+ }
+ System.out.println(path);
%>
<jsp:include page="<%=path%>" flush="true"/>
diff --git a/BKUOnline/src/main/webapp/helpfiles/de/error.pcsc.html b/BKUOnline/src/main/webapp/helpfiles/de/error.pcsc.html
index 209ae6fa..d38e77ca 100644
--- a/BKUOnline/src/main/webapp/helpfiles/de/error.pcsc.html
+++ b/BKUOnline/src/main/webapp/helpfiles/de/error.pcsc.html
@@ -26,8 +26,18 @@
<!-- end #sidebar1 --></div>
<div id="mainContent">
<h1> Fehler: Es konnte keine PC/SC-Schnittstelle gefunden werden</h1>
- <p>Die Software für den Zugriff auf die Bürgerkarte konnte keine PC/SC-Schnittstelle für den Zugriff auf Kartenleser erkennen. Das Betriebssystem scheint keine PC/SC-Schnittstelle zur Verfügung zu stellen.</p>
- <p>Unter Betriebssystemen die PCSC-Lite verwenden (Linux u.a.) tritt dieses Problem auch auf, wenn kein Kartenleser angeschlossen ist und daher der entsprechende Dienst nicht gestartet wurde oder wenn die entsprechende Bibliothek nicht zur Verfügung steht (<a href="http://java.sun.com/javase/6/docs/technotes/guides/security/SunProviders.html#SunPCSCProvider">weitere Informationen</a>).<br class="clearfloat" />
+ <p>Die Software für den Zugriff auf die Bürgerkarte konnte keine PC/SC-Schnittstelle für den Zugriff auf Kartenleser erkennen.
+ Das Betriebssystem scheint keine PC/SC-Schnittstelle zur Verfügung zu stellen.</p>
+ <p>Häufige Ursachen für dieses Problem sind
+ <ul>
+ <li>Der PC/SC Dienst läuft nicht</li>
+ <li>Die entsprechende PC/SC Bibliothek kann von Java nicht gefunden werden
+ (<a href="http://java.sun.com/javase/6/docs/technotes/guides/security/SunProviders.html#SunPCSCProvider">weitere Informationen</a>).</li>
+ </ul>
+ </p>
+ <p>Unter Betriebssystemen die PCSC-Lite verwenden (Linux u.a.) tritt dieses Problem auch auf,
+ wenn kein Kartenleser angeschlossen ist und daher der entsprechende Dienst nicht gestartet wurde.
+ <br class="clearfloat" />
</p>
<p><br class="clearfloat" /></p>
</div>
diff --git a/BKUOnline/src/main/webapp/helpfiles/de/help.hashdataviewer.html b/BKUOnline/src/main/webapp/helpfiles/de/help.hashdataviewer.html
index f7cf15df..eb1a35d6 100644
--- a/BKUOnline/src/main/webapp/helpfiles/de/help.hashdataviewer.html
+++ b/BKUOnline/src/main/webapp/helpfiles/de/help.hashdataviewer.html
@@ -28,6 +28,7 @@
<h1> Anzeige der Signaturdaten </h1>
<p>Dieses Fenster zeigt die zu signierenden Daten an. Dies k&ouml;nnen entweder reine Textdaten oder XHTML sein. Im Falle von XHML erhalten Sie den Hinweis, dass es sich bei den dargestellten Daten nur um eine Voransicht handelt. Um die Daten standardkonform darzustellen, m&uuml;ssen diese abgespeichert und mit einem geeigneten XHTML Betrachter ge&ouml;ffnen werden.</p>
<p>In jedem Fall k&ouml;nnen die zu signierenden abgespeichert werden.</p>
+ <p><br class="clearfloat" /></p>
</div>
<div id="footer">
<p>
diff --git a/BKUOnline/src/main/webapp/ieView.html b/BKUOnline/src/main/webapp/ieView.html
deleted file mode 100644
index 71f76eec..00000000
--- a/BKUOnline/src/main/webapp/ieView.html
+++ /dev/null
@@ -1,31 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<title>Anzeige</title>
-<style type="text/css">
-body {
- font-size: 15px;
- font-weight: 500;
- font-family: Helvetica, Arial, sans-serif;
- background-color: DarkOrange;
- padding:1em 2em 0em 2em;
-}
-
-h1 {
- font-size: 20px;
-}
-</style>
-</head>
-<body>
-<h1>Achtung: Ihr Browser unterstützt dieses Anzeigeformat (XHTML) nicht.</h1> Die unten
-dargestellten Daten können von den tatsächlichen Signaturdaten abweichen.
-<a href="hashDataInput?ieCType=application%2Fxhtml%2Bxml">Hier</a>
-können Sie die Signaturdaten herunterladen.
-<br>
-<div style="height:700px; margin: 2em 0em 1em 0em">
-<iframe src="hashDataInput?ieCType=text/html" width="100%" height="100%" marginwidth="0"
-marginheight="0" frameborder="1" scrolling="auto">Ihr Browser unterstütz leider keine Iframes</iframe>
-</div>
-</body>
-</html> \ No newline at end of file
diff --git a/BKUOnline/src/main/webapp/img/BackgroundEcard.png b/BKUOnline/src/main/webapp/img/BackgroundEcard.png
new file mode 100644
index 00000000..11ba891e
--- /dev/null
+++ b/BKUOnline/src/main/webapp/img/BackgroundEcard.png
Binary files differ
diff --git a/BKUOnline/src/main/webapp/index.html b/BKUOnline/src/main/webapp/index.html
index 8f1a338e..94e2890f 100644
--- a/BKUOnline/src/main/webapp/index.html
+++ b/BKUOnline/src/main/webapp/index.html
@@ -48,7 +48,7 @@
<div id="animDiv" class="box">
<p>
<h1>TestRequest</h1>
-<a href="HTTP-ohne.html">Security Layer Request</a>
+<a href="slRequestForm.html">Security Layer Request</a>
<h1>STAL Service</h1>
<a href="stal">STAL Service Endpoint Information</a>
</p>
diff --git a/BKUOnline/src/main/webapp/js/deployJava.js b/BKUOnline/src/main/webapp/js/deployJava.js
index 4d8a0ca3..5466cbdd 100644
--- a/BKUOnline/src/main/webapp/js/deployJava.js
+++ b/BKUOnline/src/main/webapp/js/deployJava.js
@@ -40,7 +40,7 @@
* http://java.com/js/deployJava.js.
* You are encouraged to link directly to the live copy of the file.
*
- * @version @(#)deployJava.js 1.11 08/07/11
+ * @version @(#)deployJava.js 1.13 08/10/28
*/
var deployJava = {
@@ -88,7 +88,7 @@ var deployJava = {
}
} else {
var browser = deployJava.getBrowser();
-
+
if (browser == 'MSIE') {
if (deployJava.testUsingActiveX('1.8.0')) {
list[0] = '1.8.0';
@@ -319,11 +319,18 @@ var deployJava = {
document.write(s);
if (parameters != 'undefined' && parameters != null) {
+ var codebaseParam = false;
for (var parameter in parameters) {
+ if (parameter == 'codebase_lookup') {
+ codebaseParam = true;
+ }
s = '<param name="' + parameter + '" value="' +
parameters[parameter] + '">';
document.write(s);
}
+ if (!codebaseParam) {
+ document.write('<param name="codebase_lookup" value="false">');
+ }
}
document.write('<' + '/' + 'applet' + '>');
},
@@ -630,6 +637,10 @@ var deployJava = {
alert('We claim to have detected "IE".');
}
return 'MSIE';
+// } else if ((browser.indexOf('konqueror') != -1)) {
+// if (deployJava.debug) {
+// alert('We claim to have detected "Konqueror".');
+// }
} else if ((browser.indexOf('mozilla') != -1) ||
(browser.indexOf('firefox') != -1)) {
if (deployJava.debug) {
diff --git a/BKUOnline/src/main/webapp/multiHashDataInput.html b/BKUOnline/src/main/webapp/multiHashDataInput.html
deleted file mode 100644
index bb03f8ce..00000000
--- a/BKUOnline/src/main/webapp/multiHashDataInput.html
+++ /dev/null
@@ -1,37 +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.
--->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
-<title>Mehrere Signaturedaten</title>
-<style type="text/css">
-h1 {
- color: red;
- font-size: 15px;
- font-weight: 500;
- font-family: Helvetica, Arial, sans-serif;
-}
-</style>
-</head>
-<body>
-<div style="width:300px; padding:20px; border:5px solid #ff0000;text-align: center">
-<h1>Diese Signatur enthält mehrere Datenobjekte. <br>
-Die Anzeige dieser wird derzeit nicht unterstützt !</h1>
-</div>
-</body>
-</html> \ No newline at end of file
diff --git a/BKUOnline/src/main/webapp/HTTP-ohne.html b/BKUOnline/src/main/webapp/slRequestForm.html
index 607fa5d4..9a96e9be 100644
--- a/BKUOnline/src/main/webapp/HTTP-ohne.html
+++ b/BKUOnline/src/main/webapp/slRequestForm.html
@@ -17,11 +17,11 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
-<title>Infobox Requests</title>
+<title>Security-Layer v1.2 Request Formular</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
-<h1>Securitykapsel - HTTP-Bindung</h1>
+<h1>Security-Layer v1.2 Request Formular</h1>
<style type="text/css">
fieldset {
padding: 1em;
@@ -59,6 +59,7 @@ legend {
<p>
<form action="./http-security-layer-request" method="Post"
enctype="application/x-www-form-urlencoded">
+ <!--input name="locale" value="es_MX" type="hidden" /-->
<fieldset><legend>Enter XML Request</legend>
<p><label for="XMLRequest">XML Request</label> <textarea
name="XMLRequest" rows=15 cols="60" id="XMLRequest">
@@ -97,12 +98,6 @@ legend {
<input type="radio" name="appletGuiStyle" value="simple" checked="checked">simple
<input type="radio" name="appletGuiStyle" value="advanced">advanced
</p>
-<p>
- <label for="appletHashDataDisplay">HashData Display</label>
- <input type="radio" name="appletHashDataDisplay" value="frame" checked="checked">Frame
- <input type="radio" name="appletHashDataDisplay" value="browser">Browser
- <!--input type="radio" name="appletHashDataDisplay" value="internal">Applet-->
-</p>
<!--
<p><label for="RedirectURL">RedirectURL</label> <input
diff --git a/BKUOnline/src/main/wsdl/CardChannel.xsd b/BKUOnline/src/main/wsdl/CardChannel.xsd
new file mode 100644
index 00000000..81fd85db
--- /dev/null
+++ b/BKUOnline/src/main/wsdl/CardChannel.xsd
@@ -0,0 +1,148 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://www.buergerkarte.at/cardchannel"
+ xmlns:tns="http://www.buergerkarte.at/cardchannel"
+ elementFormDefault="qualified"
+ xmlns:stal="http://www.egiz.gv.at/stal">
+
+ <xs:import namespace="http://www.egiz.gv.at/stal" schemaLocation="stal-service.xsd"/>
+
+ <xs:annotation>
+ <xs:documentation>Schema for transparent access to cards using a BKU and the CardChannel
+ infobox</xs:documentation>
+ </xs:annotation>
+
+ <xs:element name="Script" type="tns:ScriptType" substitutionGroup="stal:OtherRequest"/>
+ <xs:element name="Response" type="tns:ResponseType" substitutionGroup="stal:OtherResponse"/>
+ <xs:element name="Grunddaten" type="tns:AttributeList"/>
+ <xs:element name="EHIC" type="tns:AttributeList"/>
+ <xs:element name="Status" type="tns:AttributeList"/>
+ <xs:element name="SV-Personenbindung" type="xs:hexBinary"/>
+
+ <xs:complexType name="ScriptType">
+ <xs:annotation>
+ <xs:documentation>extends abstract stal:RequestType</xs:documentation>
+ </xs:annotation>
+ <xs:complexContent>
+ <xs:extension base="stal:RequestType">
+ <xs:annotation>
+ <xs:documentation>Contains the script to be executed by the BKU</xs:documentation>
+ </xs:annotation>
+ <xs:choice maxOccurs="unbounded" minOccurs="1">
+ <xs:element name="Reset" type="tns:ResetType"/>
+ <xs:element name="CommandAPDU" type="tns:CommandAPDUType"/>
+ <xs:element name="VerifyAPDU" type="tns:VerifyAPDUType"/>
+ </xs:choice>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+
+ <xs:complexType name="ResponseType">
+ <xs:annotation>
+ <xs:documentation>extends abstract stal:ResponseType</xs:documentation>
+ </xs:annotation>
+ <xs:complexContent>
+ <xs:extension base="stal:ResponseType">
+ <xs:annotation>
+ <xs:documentation>Contains the result of the script executed by the
+ BKU</xs:documentation>
+ </xs:annotation>
+ <xs:choice maxOccurs="unbounded" minOccurs="1">
+ <xs:element name="ATR" type="tns:ATRType"/>
+ <xs:element name="ResponseAPDU" type="tns:ResponseAPDUType"/>
+ </xs:choice>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+
+ <xs:complexType name="ResetType">
+ <xs:annotation>
+ <xs:documentation>Reset the icc and sequence counter</xs:documentation>
+ </xs:annotation>
+ <xs:attribute name="cold" type="xs:boolean" default="true"/>
+ </xs:complexType>
+
+ <xs:complexType name="CommandAPDUType">
+ <xs:annotation>
+ <xs:documentation>Contains a sequence of bytes send as command APDU to the
+ icc</xs:documentation>
+ </xs:annotation>
+ <xs:simpleContent>
+ <xs:extension base="xs:hexBinary">
+ <xs:attribute name="sequence" type="xs:positiveInteger" use="required"/>
+ <xs:attribute name="of" type="xs:positiveInteger" use="required"/>
+ <xs:attribute name="expectedSW" type="xs:hexBinary"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+
+ <xs:complexType name="VerifyAPDUType">
+ <xs:annotation>
+ <xs:documentation>Contains a sequence of bytes send as command APDU to the icc after a
+ PIN entered by the user has been incorporated into the APDU</xs:documentation>
+ </xs:annotation>
+ <xs:simpleContent>
+ <xs:extension base="xs:hexBinary">
+ <xs:attribute name="sequence" type="xs:positiveInteger" use="required"/>
+ <xs:attribute name="of" type="xs:positiveInteger" use="required"/>
+ <xs:attribute name="expectedSW" type="xs:hexBinary"/>
+ <xs:attribute name="message" type="xs:string" use="required"/>
+ <xs:attribute name="format" type="xs:hexBinary" use="required"/>
+ <xs:attribute name="offset" type="xs:nonNegativeInteger" use="required"/>
+ <xs:attribute name="timeout" type="xs:nonNegativeInteger" use="required"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+
+ <xs:complexType name="ATRType">
+ <xs:annotation>
+ <xs:documentation>Contains the ATR received as reponse to a Reset
+ command</xs:documentation>
+ </xs:annotation>
+ <xs:simpleContent>
+ <xs:extension base="xs:hexBinary">
+ <xs:attribute name="rc" type="xs:integer" default="0"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+
+ <xs:complexType name="ResponseAPDUType">
+ <xs:annotation>
+ <xs:documentation>Contains a sequence of bytes received from the card as response
+ APDU</xs:documentation>
+ </xs:annotation>
+ <xs:simpleContent>
+ <xs:extension base="xs:hexBinary">
+ <xs:attribute name="sequence" type="xs:positiveInteger" use="required"/>
+ <xs:attribute name="rc" type="xs:integer" default="0"/>
+ <xs:attribute name="SW" type="xs:hexBinary" default="9000"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+
+ <xs:complexType name="AttributeList">
+ <xs:annotation>
+ <xs:documentation>Contains a list of attributes</xs:documentation>
+ </xs:annotation>
+ <xs:sequence>
+ <xs:element name="Attribute" type="tns:AttributeType" minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="AttributeType">
+ <xs:annotation>
+ <xs:documentation>Contains an attribute converted from ASN.1</xs:documentation>
+ </xs:annotation>
+ <xs:sequence>
+ <xs:element name="Integer" type="xs:integer" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="Latin1String" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="UTF8String" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="NumericString" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="PrintableString" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="GeneralizedTime" type="xs:dateTime" minOccurs="0" maxOccurs="1"/>
+ <xs:element name="Date" type="xs:string" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ <xs:attribute name="oid" type="xs:string" use="required"/>
+ </xs:complexType>
+
+</xs:schema>
diff --git a/BKUOnline/src/main/wsdl/stal-service.wsdl b/BKUOnline/src/main/wsdl/stal-service.wsdl
new file mode 100644
index 00000000..3e6f5730
--- /dev/null
+++ b/BKUOnline/src/main/wsdl/stal-service.wsdl
@@ -0,0 +1,114 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+
+<!--
+ | This WSDL contains the original WSDL that was used to generate all classes in the STALService module
+ |-->
+<definitions name="stal" targetNamespace="http://www.egiz.gv.at/wsdl/stal"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:tns="http://www.egiz.gv.at/wsdl/stal"
+ xmlns:stal="http://www.egiz.gv.at/stal"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:cc="http://www.buergerkarte.at/cardchannel">
+ <types>
+ <xsd:schema targetNamespace="http://www.egiz.gv.at/wsdl/stal">
+ <xsd:import namespace="http://www.egiz.gv.at/stal" schemaLocation="stal-service.xsd"/>
+ </xsd:schema>
+ <xsd:schema targetNamespace="http://www.egiz.gv.at/wsdl/stal-extended">
+ <xsd:import namespace="http://www.buergerkarte.at/cardchannel" schemaLocation="CardChannel.xsd"/>
+ </xsd:schema>
+ </types>
+ <message name="ConnectRequest">
+ <part name="part1" element="stal:SessionId"/>
+ </message>
+ <message name="NextRequestRequest">
+ <part name="part1" element="stal:GetNextRequest"/>
+ </message>
+ <message name="NextRequestResponse">
+ <part name="part1" element="stal:GetNextRequestResponse"/>
+ </message>
+ <message name="GetHashDataInputRequest">
+ <part name="part1" element="stal:GetHashDataInput"/>
+ </message>
+ <message name="GetHashDataInputResponse">
+ <part name="part1" element="stal:GetHashDataInputResponse"/>
+ </message>
+ <message name="GetHashDataInputFault">
+ <part name="part1" element="stal:GetHashDataInputFault"/>
+ </message>
+
+ <!--
+ | Comment out the remainder of this WSDL
+ | if placing it into webapp/WEB-INF/wsdl/
+ | in order not to interfere with the actual WSDL stal.wsdl
+ |-->
+ <portType name="STALPortType">
+ <operation name="connect">
+ <input name="input3" message="tns:ConnectRequest"/>
+ <output name="output3" message="tns:NextRequestResponse"/>
+ </operation>
+ <operation name="nextRequest">
+ <input name="input1" message="tns:NextRequestRequest"/>
+ <output name="output1" message="tns:NextRequestResponse"/>
+ </operation>
+ <operation name="getHashDataInput">
+ <input name="input2" message="tns:GetHashDataInputRequest"/>
+ <output name="output2" message="tns:GetHashDataInputResponse"/>
+ <fault name="fault1" message="tns:GetHashDataInputFault"/>
+ </operation>
+ </portType>
+ <binding name="STALBinding" type="tns:STALPortType">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="connect">
+ <input name="input3">
+ <soap:body use="literal"/>
+ </input>
+ <output name="output3">
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ <operation name="nextRequest">
+ <soap:operation/>
+ <input name="input1">
+ <soap:body use="literal"/>
+ </input>
+ <output name="output1">
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ <operation name="getHashDataInput">
+ <soap:operation/>
+ <input name="input2">
+ <soap:body use="literal"/>
+ </input>
+ <output name="output2">
+ <soap:body use="literal"/>
+ </output>
+ <fault name="fault1">
+ <soap:fault name="fault1"/>
+ </fault>
+ </operation>
+ </binding>
+ <service name="STALService">
+ <port name="STALPort" binding="tns:STALBinding">
+ <soap:address location="http://localhost:${HttpDefaultPort}/stal"/>
+ </port>
+ </service>
+</definitions>
diff --git a/BKUOnline/src/main/wsdl/stal-service.xsd b/BKUOnline/src/main/wsdl/stal-service.xsd
new file mode 100644
index 00000000..450c8146
--- /dev/null
+++ b/BKUOnline/src/main/wsdl/stal-service.xsd
@@ -0,0 +1,168 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.egiz.gv.at/stal"
+ xmlns:tns="http://www.egiz.gv.at/stal"
+ xmlns:cc="http://www.buergerkarte.at/cardchannel"
+ elementFormDefault="qualified">
+
+ <import namespace="http://www.buergerkarte.at/cardchannel" schemaLocation="CardChannel.xsd"/>
+
+ <element name="SessionId" type="string"/>
+ <element name="GetNextRequest" type="tns:GetNextRequestType"/>
+ <element name="GetNextRequestResponse" type="tns:GetNextRequestResponseType"/>
+ <element name="GetHashDataInput" type="tns:GetHashDataInputType"/>
+ <element name="GetHashDataInputResponse" type="tns:GetHashDataInputResponseType"/>
+ <element name="GetHashDataInputFault" type="tns:GetHashDataInputFaultType"/>
+
+ <!-- Abstract Request/Response to be substituted by extending schemata -->
+ <element name="OtherRequest" type="tns:RequestType" abstract="true"/>
+ <element name="OtherResponse" type="tns:ResponseType" abstract="true"/>
+
+ <complexType name="GetNextRequestType">
+ <!-- abstract Request/Response type not supported by JAX-WS 2.0 (jdk < 1.6.0_04)
+ <sequence>
+ <element name="Response" type="tns:ResponseType" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence-->
+ <choice maxOccurs="unbounded">
+ <element name="InfoboxReadResponse" type="tns:InfoboxReadResponseType"/>
+ <element name="SignResponse" type="tns:SignResponseType"/>
+ <element name="ErrorResponse" type="tns:ErrorResponseType"/>
+ <element ref="tns:OtherResponse"/>
+ <!-- do not list cc:Script here, JAXB knows about substitution groups
+ <element ref="cc:Script"/-->
+ </choice>
+ <attribute name="SessionId" type="string"/>
+ </complexType>
+ <complexType name="ResponseType" abstract="true" />
+ <complexType name="InfoboxReadResponseType">
+ <complexContent>
+ <extension base="tns:ResponseType">
+ <sequence>
+ <element name="InfoboxValue" type="base64Binary"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <complexType name="SignResponseType">
+ <complexContent>
+ <extension base="tns:ResponseType">
+ <sequence>
+ <element name="SignatureValue" type="base64Binary"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <complexType name="ErrorResponseType">
+ <complexContent>
+ <extension base="tns:ResponseType">
+ <sequence>
+ <element name="ErrorCode" type="int"/>
+ <element name="ErrorMessage" type="string"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <complexType name="GetNextRequestResponseType">
+ <!-- abstract Request/Response type not supported by JAX-WS 2.0 (jdk < 1.6.0_04)
+ <sequence>
+ <element name="Request" type="tns:RequestType" minOccurs="0" maxOccurs="unbounded"/>
+ </sequence-->
+ <choice maxOccurs="unbounded">
+ <element name="InfoboxReadRequest" type="tns:InfoboxReadRequestType"/>
+ <element name="SignRequest" type="tns:SignRequestType"/>
+ <element name="QuitRequest" type="tns:QuitRequestType"/>
+ <element ref="tns:OtherRequest"/>
+ <!-- do not list cc:Response here, JAXB knows about substitution groups
+ <element ref="cc:Response"/-->
+ </choice>
+ <attribute name="SessionId" type="string"/>
+ </complexType>
+ <complexType name="RequestType" abstract="true"/>
+ <complexType name="InfoboxReadRequestType">
+ <complexContent>
+ <extension base="tns:RequestType">
+ <sequence>
+ <element name="InfoboxIdentifier">
+ <simpleType>
+ <restriction base="string">
+ <enumeration value="Certificates"/>
+ <enumeration value="IdentityLink"/>
+ <enumeration value="Mandates"/>
+ </restriction>
+ </simpleType>
+ </element>
+ <element name="DomainIdentifier" type="anyURI" minOccurs="0"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <complexType name="SignRequestType">
+ <complexContent>
+ <extension base="tns:RequestType">
+ <sequence>
+ <element name="KeyIdentifier">
+ <simpleType>
+ <restriction base="string">
+ <enumeration value="SecureSignatureKeypair"/>
+ <enumeration value="CertifiedKeypair"/>
+ </restriction>
+ </simpleType>
+ </element>
+ <element name="SignedInfo" type="base64Binary"/>
+ </sequence>
+ </extension>
+ </complexContent>
+ </complexType>
+ <complexType name="QuitRequestType">
+ <complexContent>
+ <extension base="tns:RequestType"/>
+ </complexContent>
+ </complexType>
+ <complexType name="GetHashDataInputType">
+ <sequence>
+ <element name="Reference" maxOccurs="unbounded">
+ <complexType>
+ <attribute name="ID" type="string"/>
+ </complexType>
+ </element>
+ </sequence>
+ <attribute name="SessionId" type="string"/>
+ </complexType>
+ <complexType name="GetHashDataInputResponseType">
+ <sequence>
+ <element name="Reference" maxOccurs="unbounded">
+ <complexType>
+ <simpleContent>
+ <extension base="base64Binary">
+ <attribute name="ID" type="string"/>
+ <attribute name="MimeType" type="string" use="optional"/>
+ <attribute name="Encoding" type="string" use="optional"/>
+ </extension>
+ </simpleContent>
+ </complexType>
+ </element>
+ </sequence>
+ <attribute name="SessionId" type="string"/>
+ </complexType>
+ <complexType name="GetHashDataInputFaultType">
+ <sequence>
+ <element name="ErrorCode" type="int"/>
+ <element name="ErrorMessage" type="string"/>
+ </sequence>
+ </complexType>
+</schema>
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 8830a81c..9d77e53e 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
@@ -34,6 +34,7 @@ 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.ObjectFactory;
import at.gv.egiz.stal.service.types.QuitRequestType;
import at.gv.egiz.stal.service.types.RequestType;
import at.gv.egiz.stal.service.types.ResponseType;
@@ -45,6 +46,7 @@ import java.io.InputStream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
+import javax.xml.bind.JAXBElement;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.junit.BeforeClass;
@@ -283,19 +285,25 @@ public class STALRequestBrokerTest {
@Override
public void run() {
try {
+ ObjectFactory of= new ObjectFactory();
+
log.debug("calling stal.nextRequest(oldResponse)");
- ResponseType oldResp = new InfoboxReadResponseType();
- List<RequestType> requests = stal.nextRequest(Collections.singletonList(oldResp));
+ InfoboxReadResponseType oldResp = of.createInfoboxReadResponseType();
+ ArrayList<JAXBElement<? extends ResponseType>> oldResponses = new ArrayList<JAXBElement<? extends ResponseType>>();
+ oldResponses.add(of.createGetNextRequestTypeInfoboxReadResponse(oldResp));
+
+ List<JAXBElement<? extends RequestType>> requests = stal.nextRequest(oldResponses);
log.debug("got " + requests.size() + " requests. processing...");
Thread.sleep(1);
- List<ResponseType> responses = new ArrayList<ResponseType>();
- for (RequestType request : requests) {
+ List<JAXBElement<? extends ResponseType>> responses = new ArrayList<JAXBElement<? extends ResponseType>>();
+ for (JAXBElement<? extends RequestType> requestElt : requests) {
+ RequestType request = requestElt.getValue();
if (request instanceof InfoboxReadRequestType) {
log.debug("received UNEXPECTED READINFOBOX request");
- InfoboxReadResponseType r = new InfoboxReadResponseType();
+ InfoboxReadResponseType r = of.createInfoboxReadResponseType();
r.setInfoboxValue("dummyInfobox".getBytes());
- responses.add(r);
+ responses.add(of.createGetNextRequestTypeInfoboxReadResponse(r));
} else if (request instanceof SignRequestType) {
log.debug("received UNEXPECTED SIGN request");
@@ -311,9 +319,9 @@ public class STALRequestBrokerTest {
log.debug("got HashDataInput " + new String(data));
- SignResponseType r = new SignResponseType();
+ SignResponseType r = of.createSignResponseType();
r.setSignatureValue("dummySignature".getBytes());
- responses.add(r);
+ responses.add(of.createGetNextRequestTypeSignResponse(r));
} else if (request instanceof QuitRequestType) {
log.debug("received EXPECTED QUIT request");
return;
@@ -326,7 +334,8 @@ public class STALRequestBrokerTest {
// }
log.debug("calling stal.nextRequest with " + responses.size() + " responses");
requests = stal.nextRequest(responses);
- for (RequestType request : requests) {
+ for (JAXBElement<? extends RequestType> requestElt : requests) {
+ RequestType request = requestElt.getValue();
if (request instanceof QuitRequestType) {
log.debug("got QUIT request");
} else {
@@ -347,17 +356,19 @@ public class STALRequestBrokerTest {
@Override
public void run() {
try {
+ ObjectFactory of = new ObjectFactory();
// first call w/ empty response list
log.debug("calling stal.nextRequest");
- List<RequestType> requests = stal.nextRequest(null); //new ArrayList<ResponseType>());
+ List<JAXBElement<? extends RequestType>> requests = stal.nextRequest(null); //new ArrayList<ResponseType>());
log.debug("got " + requests.size() + " requests. processing...");
Thread.sleep(1);
- List<ResponseType> responses = new ArrayList<ResponseType>();
- for (RequestType request : requests) {
+ List<JAXBElement<? extends ResponseType>> responses = new ArrayList<JAXBElement<? extends ResponseType>>();
+ for (JAXBElement<? extends RequestType> requestElt : requests) {
+ RequestType request = requestElt.getValue();
if (request instanceof InfoboxReadRequestType) {
- InfoboxReadResponseType r = new InfoboxReadResponseType();
+ InfoboxReadResponseType r = of.createInfoboxReadResponseType();
r.setInfoboxValue("dummyInfobox".getBytes());
- responses.add(r);
+ responses.add(of.createGetNextRequestTypeInfoboxReadResponse(r));
} else if (request instanceof SignRequestType) {
log.debug("calling stal.getCurrentHashDataInputCallback");
@@ -371,9 +382,9 @@ public class STALRequestBrokerTest {
log.debug("got HashDataInput " + new String(data));
- SignResponseType r = new SignResponseType();
+ SignResponseType r = of.createSignResponseType();
r.setSignatureValue("dummySignature".getBytes());
- responses.add(r);
+ responses.add(of.createGetNextRequestTypeSignResponse(r));
} else if (request instanceof QuitRequestType) {
log.debug("received UNEXPECTED QUIT request");
return;
@@ -386,7 +397,8 @@ public class STALRequestBrokerTest {
// }
log.debug("calling stal.nextRequest with " + responses.size() + " responses");
requests = stal.nextRequest(responses);
- for (RequestType request : requests) {
+ for (JAXBElement<? extends RequestType> requestElt : requests) {
+ RequestType request = requestElt.getValue();
if (request instanceof QuitRequestType) {
log.debug("got QUIT request");
} else {
@@ -408,10 +420,11 @@ public class STALRequestBrokerTest {
try {
// first call w/ empty response list
log.debug("calling stal.nextRequest");
- List<RequestType> requests = stal.nextRequest(null); //new ArrayList<ResponseType>());
+ List<JAXBElement<? extends RequestType>> requests = stal.nextRequest(null); //new ArrayList<ResponseType>());
log.debug("got " + requests.size() + " requests. processing...");
Thread.sleep(1);
- for (RequestType request : requests) {
+ for (JAXBElement<? extends RequestType> requestElt : requests) {
+ RequestType request = requestElt.getValue();
// if (request instanceof InfoboxReadRequest) {
if (request instanceof SignRequestType) {
log.debug("calling stal.getCurrentHashDataInputCallback");