cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r832352 - in /cxf/branches/2.2.x-fixes/rt: bindings/jbi/src/main/java/org/apache/cxf/binding/jbi/interceptor/JBIFaultOutInterceptor.java transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBIDestinationOutputStream.java
Date Tue, 03 Nov 2009 09:05:18 GMT
Author: ffang
Date: Tue Nov  3 09:05:17 2009
New Revision: 832352

URL: http://svn.apache.org/viewvc?rev=832352&view=rev
Log:
[CXF-2517]Exception shouldn't be considered as JBI ERROR,should use JBI FAULT instead

Modified:
    cxf/branches/2.2.x-fixes/rt/bindings/jbi/src/main/java/org/apache/cxf/binding/jbi/interceptor/JBIFaultOutInterceptor.java
    cxf/branches/2.2.x-fixes/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBIDestinationOutputStream.java

Modified: cxf/branches/2.2.x-fixes/rt/bindings/jbi/src/main/java/org/apache/cxf/binding/jbi/interceptor/JBIFaultOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/bindings/jbi/src/main/java/org/apache/cxf/binding/jbi/interceptor/JBIFaultOutInterceptor.java?rev=832352&r1=832351&r2=832352&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/bindings/jbi/src/main/java/org/apache/cxf/binding/jbi/interceptor/JBIFaultOutInterceptor.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/bindings/jbi/src/main/java/org/apache/cxf/binding/jbi/interceptor/JBIFaultOutInterceptor.java
Tue Nov  3 09:05:17 2009
@@ -61,7 +61,9 @@
             StaxUtils.writeStartElement(writer, prefix, JBIFault.JBI_FAULT_ROOT, 
                                         JBIConstants.NS_JBI_BINDING);
             if (!jbiFault.hasDetails()) {
-                writer.writeEmptyElement("fault");
+                Element faultString = DOMUtils.createDocument().createElement("fault");
+                faultString.setTextContent(jbiFault.getCause().getMessage());
+                StaxUtils.writeNode(faultString, writer, true);   
             } else {
                 Element detail = jbiFault.getDetail();
                 Element elem = DOMUtils.getFirstElement(detail);

Modified: cxf/branches/2.2.x-fixes/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBIDestinationOutputStream.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBIDestinationOutputStream.java?rev=832352&r1=832351&r2=832352&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBIDestinationOutputStream.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/transports/jbi/src/main/java/org/apache/cxf/transport/jbi/JBIDestinationOutputStream.java
Tue Nov  3 09:05:17 2009
@@ -96,10 +96,13 @@
                 if (inMessage.getExchange().getOutFaultMessage() != null) {
                     org.apache.cxf.interceptor.Fault f = (org.apache.cxf.interceptor.Fault)

                             inMessage.getContent(Exception.class);
-                    if (f.hasDetails()) {
-                        Fault fault = xchng.createFault();
+                    if (!(f.getCause() instanceof Error)) {
+                        Fault fault = xchng.createFault(); 
                         fault.setContent(new DOMSource(doc));
                         xchng.setFault(fault);
+                        if (!f.hasDetails()) {
+                            xchng.setProperty("faultstring", f.getMessage());
+                        }
                     } else {
                         xchng.setError(f);
                     }



Mime
View raw message