From 20689558ce4a30b369644e9cf31619237490517f Mon Sep 17 00:00:00 2001 From: pdanner Date: Thu, 13 Sep 2007 09:36:37 +0000 Subject: went back to axis 1.0 in SP/SS (dsig-Namespaceproblem on provided Stylesheets), fixed bug in transactions entity-cache git-svn-id: https://joinup.ec.europa.eu/svn/moa-idspss/trunk@1008 d688527b-c9ab-4aba-bd8d-4036d912da1d --- spss/server/serverlib/pom.xml | 452 +++++++++++---------- .../moa/spss/server/invoke/DataObjectFactory.java | 14 +- .../moa/spss/server/service/AxisHandler.java | 26 +- .../server/service/SignatureCreationService.java | 2 +- .../service/SignatureVerificationService.java | 2 +- .../server/transaction/TransactionContext.java | 5 +- 6 files changed, 268 insertions(+), 233 deletions(-) (limited to 'spss/server/serverlib') diff --git a/spss/server/serverlib/pom.xml b/spss/server/serverlib/pom.xml index 2f4999825..514b43b82 100644 --- a/spss/server/serverlib/pom.xml +++ b/spss/server/serverlib/pom.xml @@ -1,220 +1,240 @@ - - - MOA.spss - moa-spss - 1.4.x - + + + MOA.spss + moa-spss + 1.4.x + - 4.0.0 - MOA.spss.server - moa-spss-lib - jar - 1.4.2 - MOA SP/SS API + 4.0.0 + MOA.spss.server + moa-spss-lib + jar + 1.4.2beta1 + MOA SP/SS API - - ${basedir}/../../../repository - - - - - axis - axis - - - commons-discovery - commons-discovery - - - commons-logging - commons-logging - - - javax.activation - activation - - - javax.mail - mail - - - junit - junit - - - log4j - log4j - - - postgresql - postgresql - - - javax.servlet - servlet-api - provided - - - xalan-bin-dist - xalan - compile - - - xerces - xercesImpl - - - xalan-bin-dist - xml-apis - - - xalan-bin-dist - serializer - - - iaik.prod - iaik_moa - - - iaik.prod - iaik_ixsil - - - iaik.prod - iaik_jce_full - compile - - - iaik.prod - iaik_ecc - compile - - - iaik.prod - iaik_cms - runtime - - - iaik.prod - iaik_Pkcs11Provider - runtime - - - iaik.prod - iaik_Pkcs11Wrapper - runtime - - - iaik.prod - iaik_Pkcs11Wrapper - win32 - dll - runtime - true - - - MOA - moa-common - jar - - - MOA - moa-common - test-jar - test - - - MOA.spss.server - moa-spss-tools - test - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - false - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.2 - - true - false - false - true - at.gv.egovernment.moa.spss.server.*;at.gv.egovernment.moa.spss.api.impl.*;at.gv.egovernment.moa.spss.impl.* - - - pre - a - Preconditions: - - - post - a - Postconditions: - - - - - API Factory and Services - at.gv.egovernment.moa.spss.api - - - Exceptions - at.gv.egovernment.moa.spss - - - API Objects for Signature Creation - at.gv.egovernment.moa.spss.api.xmlsign - - - API Objects for CMS Signature Verification - at.gv.egovernment.moa.spss.api.cmsverify - - - API Objects for XML Signature Verification - at.gv.egovernment.moa.spss.api.xmlverify - - - Common API Objects - at.gv.egovernment.moa.spss.api.common - - - Builders and Parsers to convert API Objects to and from XML - at.gv.egovernment.moa.spss.api.xmlbind - - - Utilities - at.gv.egovernment.moa.util - at.gv.egovernment.moa.spss.util - - - Logging - at.gv.egovernment.moa.logging - - - http://java.sun.com/j2se/1.4/docs/api/ - - - - generate-javadoc - package - - jar - - - - - - + + ${basedir}/../../../repository + + + + + axis + axis + + + axis + axis-jaxrpc + + + axis + axis-saaj + + + axis + axis-wsdl4j + + + commons-discovery + commons-discovery + + + commons-logging + commons-logging + + + javax.activation + activation + + + javax.mail + mail + + + junit + junit + + + log4j + log4j + + + postgresql + postgresql + + + javax.servlet + servlet-api + provided + + + xalan-bin-dist + xalan + compile + + + xerces + xercesImpl + + + xalan-bin-dist + xml-apis + + + xalan-bin-dist + serializer + + + iaik.prod + iaik_moa + + + iaik.prod + iaik_ixsil + + + iaik.prod + iaik_jce_full + compile + + + iaik.prod + iaik_ecc + compile + + + iaik.prod + iaik_cms + runtime + + + iaik.prod + iaik_Pkcs11Provider + runtime + + + iaik.prod + iaik_Pkcs11Wrapper + runtime + + + iaik.prod + iaik_Pkcs11Wrapper + win32 + dll + runtime + true + + + MOA + moa-common + jar + + + + MOA + moa-common + test-jar + test + + + MOA.spss.server + moa-spss-tools + test + + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + false + + + + + test-jar + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.2 + + true + false + false + true + at.gv.egovernment.moa.spss.server.*;at.gv.egovernment.moa.spss.api.impl.*;at.gv.egovernment.moa.spss.impl.* + + + pre + a + Preconditions: + + + post + a + Postconditions: + + + + + API Factory and Services + at.gv.egovernment.moa.spss.api + + + Exceptions + at.gv.egovernment.moa.spss + + + API Objects for Signature Creation + at.gv.egovernment.moa.spss.api.xmlsign + + + API Objects for CMS Signature Verification + at.gv.egovernment.moa.spss.api.cmsverify + + + API Objects for XML Signature Verification + at.gv.egovernment.moa.spss.api.xmlverify + + + Common API Objects + at.gv.egovernment.moa.spss.api.common + + + Builders and Parsers to convert API Objects to and from XML + at.gv.egovernment.moa.spss.api.xmlbind + + + Utilities + at.gv.egovernment.moa.util + at.gv.egovernment.moa.spss.util + + + Logging + at.gv.egovernment.moa.logging + + + http://java.sun.com/j2se/1.4/docs/api/ + + + + generate-javadoc + package + + jar + + + + + + diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/DataObjectFactory.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/DataObjectFactory.java index ad0da28f4..0abd80944 100644 --- a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/DataObjectFactory.java +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/invoke/DataObjectFactory.java @@ -191,6 +191,7 @@ public class DataObjectFactory { } // try to parse validating + Logger.trace(">>> parsing the following content: \n" + new String(contentBytes)); try { ByteArrayInputStream is = new ByteArrayInputStream(contentBytes); Document doc = @@ -201,6 +202,7 @@ public class DataObjectFactory { null, entityResolver, new MOAErrorHandler()); + Logger.trace("<<< parsed"); return new XMLDataObjectImpl(doc.getDocumentElement()); } catch (Exception e) { @@ -304,18 +306,12 @@ public class DataObjectFactory { } case Content.LOCREF_CONTENT: { - InputStream contentIS = null; String locRefURI = ((ContentLocRef) content).getLocationReferenceURI(); - TransactionContext context = TransactionContextManager.getInstance().getTransactionContext(); - Vector entity = context.FindResolvedEntity(locRefURI); - if (entity!=null) { - contentIS = (InputStream) entity.get(0); - } else { + if (context.FindResolvedEntity(locRefURI)==null) { ExternalURIResolver uriResolver = new ExternalURIResolver(); - InputStream uriStream = null; byte[] contentBytes; String contentType = null; @@ -323,7 +319,6 @@ public class DataObjectFactory { { uriStream = uriResolver.resolve(locRefURI); contentBytes = StreamUtils.readStream(uriStream); - contentIS = new ByteArrayInputStream(contentBytes); contentType = uriResolver.getContentType(); } catch (Exception e) @@ -334,9 +329,10 @@ public class DataObjectFactory { { closeInputStream(uriStream); } - entities.put(locRefURI, contentIS); context.PutResolvedEntity(locRefURI, contentBytes, contentType); } + InputStream contentIS = context.ResolveURI(locRefURI); + entities.put(reference, contentIS); break; } case Content.XML_CONTENT : diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/service/AxisHandler.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/service/AxisHandler.java index f5f77ff50..8e5c8a49b 100644 --- a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/service/AxisHandler.java +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/service/AxisHandler.java @@ -1,6 +1,7 @@ package at.gv.egovernment.moa.spss.server.service; import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; @@ -18,6 +19,8 @@ import org.apache.axis.handlers.BasicHandler; import org.apache.axis.transport.http.HTTPConstants; import org.apache.axis.utils.Messages; import org.apache.axis.utils.XMLUtils; +import org.apache.xml.serialize.OutputFormat; +import org.apache.xml.serialize.XMLSerializer; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.NodeList; @@ -27,7 +30,6 @@ import at.gv.egovernment.moa.logging.Logger; import at.gv.egovernment.moa.logging.LoggingContext; import at.gv.egovernment.moa.logging.LoggingContextManager; import at.gv.egovernment.moa.spss.MOASystemException; -import at.gv.egovernment.moa.spss.api.common.Content; import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider; import at.gv.egovernment.moa.spss.server.transaction.TransactionContext; import at.gv.egovernment.moa.spss.server.transaction.TransactionContextManager; @@ -105,7 +107,11 @@ public class AxisHandler extends BasicHandler { (X509Certificate[]) request.getAttribute(X509_CERTIFICATE_PROPERTY); //Configure Axis +// AxisProperties.setProperty(AxisEngine.PROP_ENABLE_NAMESPACE_PREFIX_OPTIMIZATION,"false"); +// AxisProperties.setProperty(AxisEngine.PROP_DOMULTIREFS,"false"); +// AxisProperties.setProperty(AxisEngine.PROP_SEND_XSI,"true"); //msgContext.setProperty(org.apache.axis.SOAPPart.ALLOW_FORM_OPTIMIZATION, Boolean.FALSE); + //msgContext.setProperty(org.apache.axis. AxisEngine.PROP_ENABLE_NAMESPACE_PREFIX_OPTIMIZATION,"false"); Message soapMessage = msgContext.getCurrentMessage(); @@ -201,9 +207,21 @@ public class AxisHandler extends BasicHandler { info("handler.03", null); } if (Logger.isDebugEnabled()) { - String msg = soapMessage.getSOAPPartAsString(); - Logger.debug(new LogMsg(msg)); - } +// OutputFormat format = new OutputFormat((Document) xmlRequest.getOwnerDocument()); +// format.setLineSeparator("\n"); +// format.setIndenting(false); +// format.setPreserveSpace(true); +// format.setOmitXMLDeclaration(false); +// format.setEncoding("UTF-8"); +// ByteArrayOutputStream baos = new ByteArrayOutputStream(); +// XMLSerializer conSerializer = new XMLSerializer(baos, format); +// conSerializer.serialize(xmlRequest); +// Logger.debug(new LogMsg("Request:" + baos.toString())); + + + String msg = soapMessage.getSOAPPartAsString(); + Logger.debug(new LogMsg(msg)); + } } catch (MOASystemException e) { MOASystemException se = new MOASystemException("2900", null, e); AxisFault fault = AxisFault.makeFault(se); diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/service/SignatureCreationService.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/service/SignatureCreationService.java index c173625f8..8fceb6fb6 100644 --- a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/service/SignatureCreationService.java +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/service/SignatureCreationService.java @@ -70,7 +70,7 @@ public class SignatureCreationService { //since Axis (1.1 ff) has problem with namespaces we take the raw request stored by the Axishandler. TransactionContext context = TransactionContextManager.getInstance().getTransactionContext(); // validate the request - reparsedReq = ServiceUtils.reparseRequest(context.getRequest()); + reparsedReq = ServiceUtils.reparseRequest(request[0]);//context.getRequest()); // convert to API objects Logger.trace(">>> preparsing Request"); diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/service/SignatureVerificationService.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/service/SignatureVerificationService.java index b335a6e23..feb49ffbf 100644 --- a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/service/SignatureVerificationService.java +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/service/SignatureVerificationService.java @@ -56,7 +56,7 @@ public class SignatureVerificationService { //since Axis (1.1 ff) has problem with namespaces we take the raw request stored by the Axishandler. TransactionContext context = TransactionContextManager.getInstance().getTransactionContext(); // validate the request - reparsedReq = ServiceUtils.reparseRequest(context.getRequest()); + reparsedReq = ServiceUtils.reparseRequest(request[0]);//context.getRequest()); // convert to API objects requestObj = requestParser.parse(reparsedReq); diff --git a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/transaction/TransactionContext.java b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/transaction/TransactionContext.java index 5c1e35a95..62db42674 100644 --- a/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/transaction/TransactionContext.java +++ b/spss/server/serverlib/src/main/java/at/gv/egovernment/moa/spss/server/transaction/TransactionContext.java @@ -273,8 +273,9 @@ public void cleanAttachmentCache() { if (mmds!=null) { InputStream is = mmds.getInputStream(); if (is!=null) is.close(); - File f = mmds.getDiskCacheFile(); - if (f!=null) f.delete(); +// not available in Axis 1.0 to 1.1 +// File f = mmds.getDiskCacheFile(); +// if (f!=null) f.delete(); mmds.delete(); } } catch (IOException e) { -- cgit v1.2.3