From c940b711f4358d07c5b58cd1f48f7d8d6889e2c7 Mon Sep 17 00:00:00 2001 From: pdanner Date: Fri, 25 Jan 2008 12:45:02 +0000 Subject: Changed taking out of xml-request from soap message to be more robust again white spaces git-svn-id: https://joinup.ec.europa.eu/svn/moa-idspss/trunk@1061 d688527b-c9ab-4aba-bd8d-4036d912da1d --- .../at/gv/egovernment/moa/spss/server/service/AxisHandler.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'spss/server/serverlib') 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 8e5c8a49b..3a7f13c48 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,7 +1,6 @@ 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; @@ -19,8 +18,6 @@ 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; @@ -121,9 +118,10 @@ public class AxisHandler extends BasicHandler { Element xmlRequest = null; Element soapPart = DOMUtils.parseDocument(new ByteArrayInputStream(soapMessage.getSOAPPartAsBytes()), false, null, null).getDocumentElement(); if (soapPart!=null) { + //TODO: check if DOM Version is intolerant when white spaces are between tags (preceding normalization would be necessary) NodeList soapBodies = soapPart.getElementsByTagNameNS(SOAP_NS_URI, "Body"); if (soapBodies!=null && soapBodies.getLength()>0) { - xmlRequest = (Element) soapBodies.item(0).getFirstChild(); + xmlRequest = DOMUtils.getElementFromNodeList(soapBodies.item(0).getChildNodes()); } //oder TODO: Evaluierung ob XPATH schneller /* @@ -131,7 +129,7 @@ public class AxisHandler extends BasicHandler { nSMap.put((String)SOAP_PREFIX, SOAP_NS_URI); Element soapBody = (Element) XPathUtils.selectSingleNode(soapPart, nSMap, "/"+SOAP_PREFIX+":Envelope/"+SOAP_PREFIX+":Body"); if (soapBody!=null) { - xmlRequest= (Element) soapBody.getFirstChild(); + xmlRequest = DOMUtils.getElementFromNodeList(soapBody.getChildNodes()); } */ } -- cgit v1.2.3