cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r741188 - /cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/DispatchImpl.java
Date Thu, 05 Feb 2009 17:21:20 GMT
Author: dkulp
Date: Thu Feb  5 17:21:18 2009
New Revision: 741188

URL: http://svn.apache.org/viewvc?rev=741188&view=rev
Log:
[CXF-2021] Add detail from fault to SoapFalt

Modified:
    cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/DispatchImpl.java

Modified: cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/DispatchImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/DispatchImpl.java?rev=741188&r1=741187&r2=741188&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/DispatchImpl.java (original)
+++ cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/DispatchImpl.java Thu Feb
 5 17:21:18 2009
@@ -35,6 +35,7 @@
 import javax.activation.DataSource;
 import javax.xml.bind.JAXBContext;
 import javax.xml.namespace.QName;
+import javax.xml.soap.Detail;
 import javax.xml.soap.SOAPException;
 import javax.xml.soap.SOAPFactory;
 import javax.xml.soap.SOAPFault;
@@ -53,6 +54,9 @@
 import javax.xml.ws.soap.SOAPBinding;
 import javax.xml.ws.soap.SOAPFaultException;
 
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
 import org.apache.cxf.Bus;
 import org.apache.cxf.BusFactory;
 import org.apache.cxf.binding.soap.SoapBinding;
@@ -194,6 +198,16 @@
                         Fault fault = (Fault)exp;
                         soapFault.setFaultCode(fault.getFaultCode());
                         soapFault.setFaultString(fault.getMessage());
+                        if (fault.getDetail() != null) {
+                            Detail det = soapFault.addDetail();
+                            Element fd = fault.getDetail();
+                            Node child = fd.getFirstChild();
+                            while (child != null) {
+                                Node next = child.getNextSibling();
+                                det.appendChild(det.getOwnerDocument().importNode(child,
true));
+                                child = next;
+                            }
+                        }
                         SOAPFaultException ex = new SOAPFaultException(soapFault);
                         ex.initCause(exp);
                         throw ex;



Mime
View raw message