aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--moaSig/moa-sig/src/main/java/at/gv/egovernment/moa/spss/server/service/AxisHandler.java38
1 files changed, 36 insertions, 2 deletions
diff --git a/moaSig/moa-sig/src/main/java/at/gv/egovernment/moa/spss/server/service/AxisHandler.java b/moaSig/moa-sig/src/main/java/at/gv/egovernment/moa/spss/server/service/AxisHandler.java
index 9fa99b1..4ee4e07 100644
--- a/moaSig/moa-sig/src/main/java/at/gv/egovernment/moa/spss/server/service/AxisHandler.java
+++ b/moaSig/moa-sig/src/main/java/at/gv/egovernment/moa/spss/server/service/AxisHandler.java
@@ -28,7 +28,9 @@ import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
import java.security.cert.X509Certificate;
+import java.util.Enumeration;
import java.util.Iterator;
import javax.servlet.http.HttpServletRequest;
@@ -46,6 +48,8 @@ import org.apache.axis.utils.XMLUtils;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
import at.gv.egovernment.moa.spss.MOASystemException;
import at.gv.egovernment.moa.spss.server.config.ConfigurationProvider;
@@ -127,6 +131,7 @@ public class AxisHandler extends BasicHandler {
* An error occurred during processing of the request.
*/
private void handleRequest(MessageContext msgContext) throws AxisFault {
+ Message soapMessage = null;
try {
Logger.trace("---- Entering Axishandler");
// generate a unique transaction id and build the TransactionContext
@@ -135,6 +140,17 @@ public class AxisHandler extends BasicHandler {
X509Certificate[] clientCert = (X509Certificate[]) request.getAttribute(X509_CERTIFICATE_PROPERTY);
+ if (Logger.isTraceEnabled()) {
+ Enumeration<String> allHeaders = request.getHeaderNames();
+ if (allHeaders != null) {
+ while(allHeaders.hasMoreElements()) {
+ String header = allHeaders.nextElement();
+ Logger.trace("Header: " + header + " : " + request.getHeader(header));
+
+ }
+ }
+ }
+
// Configure Axis
// AxisProperties.setProperty(AxisEngine.PROP_ENABLE_NAMESPACE_PREFIX_OPTIMIZATION,"false");
// AxisProperties.setProperty(AxisEngine.PROP_DOMULTIREFS,"false");
@@ -144,10 +160,10 @@ public class AxisHandler extends BasicHandler {
// msgContext.setProperty(org.apache.axis.
// AxisEngine.PROP_ENABLE_NAMESPACE_PREFIX_OPTIMIZATION,"false");
//AxisProperties.setProperty(AxisEngine.PROP_ATTACHMENT_IMPLEMENTATION, AxisEngine.DEFAULT_ATTACHMENT_IMPL);
- Message soapMessage = msgContext.getCurrentMessage();
+ soapMessage = msgContext.getCurrentMessage();
ConfigurationProvider configuration = ConfigurationProvider.getInstance();
-
+ new String(soapMessage.getSOAPPartAsBytes());
Element xmlRequest = null;
// log.info(soapMessage.getSOAPPartAsString());
Element soapPart = DOMUtils
@@ -257,6 +273,24 @@ public class AxisHandler extends BasicHandler {
AxisFault fault = AxisFault.makeFault(se);
fault.setFaultDetail(new Element[] { se.toErrorResponse() });
throw fault;
+
+ } catch (SAXException t ) {
+ if (soapMessage != null && soapMessage.getSOAPPartAsBytes() != null) {
+ try {
+ Logger.debug("Req: " + new String(soapMessage.getSOAPPartAsBytes(), "UTF-8"));
+ } catch (UnsupportedEncodingException e1) {
+ e1.printStackTrace();
+ }
+
+ }
+
+ t.printStackTrace();
+ Logger.info(new LogMsg(t.getStackTrace()));
+ MOASystemException e = new MOASystemException("2900", null, t);
+ AxisFault fault = AxisFault.makeFault(e);
+ fault.setFaultDetail(new Element[] { e.toErrorResponse() });
+ throw fault;
+
} catch (Throwable t) {
t.printStackTrace();
Logger.info(new LogMsg(t.getStackTrace()));