You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by du...@apache.org on 2007/03/01 16:09:39 UTC

svn commit: r513372 - in /webservices/axis/trunk/proposals/dug/java/src/org/apache/axis: AxisFault.java message/SOAPEnvelope.java message/SOAPFaultBuilder.java

Author: dug
Date: Thu Mar  1 07:09:38 2007
New Revision: 513372

URL: http://svn.apache.org/viewvc?view=rev&rev=513372
Log:
sync with head

Modified:
    webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/AxisFault.java
    webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/message/SOAPEnvelope.java
    webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/message/SOAPFaultBuilder.java

Modified: webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/AxisFault.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/AxisFault.java?view=diff&rev=513372&r1=513371&r2=513372
==============================================================================
--- webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/AxisFault.java (original)
+++ webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/AxisFault.java Thu Mar  1 07:09:38 2007
@@ -75,6 +75,9 @@
     /** SOAP headers which should be serialized with the Fault. */
     protected ArrayList faultHeaders = null;
 
+    public static final String PROP_HOSTNAME_DETAIL = 
+        "axis.addHostnameFaultDetail";
+
     /**
      * Make an AxisFault based on a passed Exception.  If the Exception is
      * already an AxisFault, simply use that.  Otherwise, wrap it in an
@@ -89,7 +92,7 @@
     {
         if (e instanceof InvocationTargetException) {
             Throwable t = ((InvocationTargetException)e).getTargetException();
-            if (t instanceof Throwable) {
+            if (t instanceof Exception) {
                 e = (Exception)t;
             }
         }
@@ -187,7 +190,9 @@
             removeHostname();
             initFromSOAPFaultException((SOAPFaultException) target);
             //but if they left it out, add it
-            addHostnameIfNeeded();
+            if (isAddHostnameDetail()) {
+                addHostnameIfNeeded();
+            }
         }
 
     }
@@ -227,7 +232,9 @@
         super (message, t);
         setFaultCodeAsString(Constants.FAULT_SERVER_GENERAL);
         setFaultString(getMessage());
-        addHostnameIfNeeded();
+        if (isAddHostnameDetail()) {
+            addHostnameIfNeeded();
+        }
     }
 
     /**
@@ -249,6 +256,7 @@
         // Set the exception message (if any) as the fault string
         setFaultString( target.toString() );
 
+        boolean addHostnameDetail = isAddHostnameDetail();
 
         // Put the exception class into the AXIS SPECIFIC HACK
         //  "exceptionName" element in the details.  This allows
@@ -258,10 +266,11 @@
         // and the other side uses *that* QName to figure out what exception
         // to use, because the class name may be completly different on the
         // client.
-        if ((target instanceof AxisFault) &&
+        if (addHostnameDetail &&
+            (target instanceof AxisFault) &&
             (target.getClass() != AxisFault.class)) {
-          addFaultDetail(Constants.QNAME_FAULTDETAIL_EXCEPTIONNAME,
-                    target.getClass().getName());
+            addFaultDetail(Constants.QNAME_FAULTDETAIL_EXCEPTIONNAME,
+                           target.getClass().getName());
         }
 
         //add stack trace
@@ -277,7 +286,9 @@
         }
 
         //add the hostname
-        addHostnameIfNeeded();
+        if (addHostnameDetail) {
+            addHostnameIfNeeded();
+        }
     }
     
     /**
@@ -916,4 +927,11 @@
     public void removeHostname() {
         removeFaultDetail(Constants.QNAME_FAULTDETAIL_HOSTNAME);
     }
+
+    private boolean isAddHostnameDetail() {
+        return JavaUtils.isTrue(
+                      AxisProperties.getProperty(PROP_HOSTNAME_DETAIL),
+                      true);
+    }
+    
 }

Modified: webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/message/SOAPEnvelope.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/message/SOAPEnvelope.java?view=diff&rev=513372&r1=513371&r2=513372
==============================================================================
--- webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/message/SOAPEnvelope.java (original)
+++ webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/message/SOAPEnvelope.java Thu Mar  1 07:09:38 2007
@@ -687,6 +687,8 @@
             recorder.clear();
             recorder = null;
         }
-        setDirty();
+        if (dirty) {
+            setDirty();
+        }
     }
 }

Modified: webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/message/SOAPFaultBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/message/SOAPFaultBuilder.java?view=diff&rev=513372&r1=513371&r2=513372
==============================================================================
--- webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/message/SOAPFaultBuilder.java (original)
+++ webservices/axis/trunk/proposals/dug/java/src/org/apache/axis/message/SOAPFaultBuilder.java Thu Mar  1 07:09:38 2007
@@ -24,6 +24,7 @@
 import org.apache.axis.soap.SOAPConstants;
 import org.apache.axis.utils.Messages;
 import org.apache.axis.utils.XMLUtils;
+import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 import org.xml.sax.Attributes;
@@ -301,8 +302,9 @@
                         if (node instanceof MessageElement) {
                             elements[i] = ((MessageElement) node).getAsDOM();
                         } else if(node instanceof Text){
-                            elements[i] = XMLUtils.newDocument().createElement("text");
-                            elements[i].appendChild(node);
+                            Document tempDoc = XMLUtils.newDocument(); 
+                            elements[i] = tempDoc.createElement("text"); 
+                            elements[i].appendChild(tempDoc.importNode(node,true)); 
                         }
                     } catch (Exception e) {
                         throw new SAXException(e);



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org