diff options
author | (no author) <(no author)@d688527b-c9ab-4aba-bd8d-4036d912da1d> | 2005-07-18 07:19:15 +0000 |
---|---|---|
committer | (no author) <(no author)@d688527b-c9ab-4aba-bd8d-4036d912da1d> | 2005-07-18 07:19:15 +0000 |
commit | a14de9592f27182b8b3ef7dfe3950ce4a9c843e0 (patch) | |
tree | 4cb2968dc180fbef2e2ca43df81e9b9ca5469e3e /spss.slinterface/WEB-INF/src/at/gv/egovernment/moa/spss/slinterface/servlets/MOAServlet.java | |
parent | ac3296bb205048da5a1e4494dd4956f4312cf948 (diff) | |
download | moa-id-spss-tags/Build-ID-1_2_0_D10.tar.gz moa-id-spss-tags/Build-ID-1_2_0_D10.tar.bz2 moa-id-spss-tags/Build-ID-1_2_0_D10.zip |
This commit was manufactured by cvs2svn to create tagtags/Build-ID-1_2_0_D10
'Build-ID-1_2_0_D10'.
git-svn-id: https://joinup.ec.europa.eu/svn/moa-idspss/tags/Build-ID-1_2_0_D10@383 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 | 113 |
1 files changed, 0 insertions, 113 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 362793064..000000000 --- a/spss.slinterface/WEB-INF/src/at/gv/egovernment/moa/spss/slinterface/servlets/MOAServlet.java +++ /dev/null @@ -1,113 +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); - } - logger_.debug("Got response from MOA SP service."); - - // 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); - } - logger_.debug("Wrote response from MOA SP service to http response outputstream."); - } -} |