diff options
author | (no author) <(no author)@d688527b-c9ab-4aba-bd8d-4036d912da1d> | 2004-06-28 20:46:16 +0000 |
---|---|---|
committer | (no author) <(no author)@d688527b-c9ab-4aba-bd8d-4036d912da1d> | 2004-06-28 20:46:16 +0000 |
commit | da5f70c20ef4bfea21c9d228e1d6891616887958 (patch) | |
tree | d05130206e29d13c6fd42003896afb2b31320999 /spss.slinterface/WEB-INF/src/at/gv/egovernment/moa/spss/slinterface/servlets/MOAServlet.java | |
parent | 4dd1877ef3771633e096509dae7b8c99fee9ce4b (diff) | |
download | moa-id-spss-tags/MOA-ID1_2d05.tar.gz moa-id-spss-tags/MOA-ID1_2d05.tar.bz2 moa-id-spss-tags/MOA-ID1_2d05.zip |
This commit was manufactured by cvs2svn to create tag 'MOA-ID1_2d05'.tags/MOA-ID1_2d05
git-svn-id: https://joinup.ec.europa.eu/svn/moa-idspss/tags/MOA-ID1_2d05@145 d688527b-c9ab-4aba-bd8d-4036d912da1d
Diffstat (limited to 'spss.slinterface/WEB-INF/src/at/gv/egovernment/moa/spss/slinterface/servlets/MOAServlet.java')
-rw-r--r-- | spss.slinterface/WEB-INF/src/at/gv/egovernment/moa/spss/slinterface/servlets/MOAServlet.java | 111 |
1 files changed, 0 insertions, 111 deletions
diff --git a/spss.slinterface/WEB-INF/src/at/gv/egovernment/moa/spss/slinterface/servlets/MOAServlet.java b/spss.slinterface/WEB-INF/src/at/gv/egovernment/moa/spss/slinterface/servlets/MOAServlet.java deleted file mode 100644 index 1ec18e5cb..000000000 --- a/spss.slinterface/WEB-INF/src/at/gv/egovernment/moa/spss/slinterface/servlets/MOAServlet.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Created on 19.11.2003 - * - * (c) Stabsstelle IKT-Strategie des Bundes - */ -package at.gv.egovernment.moa.spss.slinterface.servlets; - -import java.io.IOException; -import java.rmi.RemoteException; -import java.util.Properties; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.xml.rpc.ServiceException; - -import org.apache.log4j.Logger; -import org.apache.xerces.parsers.DOMParser; -import org.w3c.dom.Document; -import org.xml.sax.InputSource; -import org.xml.sax.SAXException; - -import at.gv.egovernment.moa.spss.slinterface.Constants; -import at.gv.egovernment.moa.spss.slinterface.moainvoker.MOAInvoker; - -/** - * @author Gregor Karlinger (mailto:gregor.karlinger@cio.gv.at) - */ -public class MOAServlet extends HttpServlet -{ - private static Logger logger_ = Logger.getLogger(Constants.LH_SERVLETS_); - - /** - * Default constructor. - */ - public MOAServlet() - { - super(); - } - - public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException - { - // Get moa request form http request - Document moaXmlRequest = null; - DOMParser xmlParser = (DOMParser) this.getServletContext().getAttribute(Constants.WSCP_XMLPARSER_); - try - { - InputSource requestIS = new InputSource(request.getInputStream()); - xmlParser.parse(requestIS); - moaXmlRequest = xmlParser.getDocument(); - } - catch (IOException ioe) - { - String message = "Getting MOA XML request from http request input failed."; - logger_.error(message, ioe); - throw new ServletException(message, ioe); - } - catch (SAXException se) - { - String message = "Parsing MOA XML request got from http request failed."; - logger_.error(message, se); - throw new ServletException(message, se); - } - - // Send request to MOA SP - Properties initProps = (Properties) this.getServletContext().getAttribute(Constants.WSCP_INIT_PROPS_); - String endPoint = initProps.getProperty(Constants.IP_SP_ENDPOINT_); - if (endPoint == null) - { - String message = "No endpoint configured for MOA SP service."; - logger_.error(message); - throw new ServletException(message); - } - Document moaXMLResponseDoc = null; - try - { - moaXMLResponseDoc = MOAInvoker.invokeSP(moaXmlRequest, endPoint); - } - catch (Exception e) - { - String message; - if (e instanceof RemoteException) - { - message = "MOA SP service indicated an error at request execution."; - } - else if (e instanceof ServiceException) - { - message = "MOA SP client indicated an error at request execution."; - } - else - { - message = "Could not create DOM Document from MOA SP service response."; - } - logger_.error(message, e); - throw new ServletException(message, e); - } - - // Write moa response to http response - try - { - MOAInvoker.serializeDocument(moaXMLResponseDoc, response.getOutputStream()); - } - catch (IOException e) - { - String message = "Writing MOA SP XML response to http response failed."; - logger_.error(message, e); - throw new ServletException(message, e); - } - } -} |