cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r684918 - /cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapFault.java
Date Mon, 11 Aug 2008 20:52:27 GMT
Author: dkulp
Date: Mon Aug 11 13:52:26 2008
New Revision: 684918

URL: http://svn.apache.org/viewvc?rev=684918&view=rev
Log:
[CXF-1716] Map internal codes to proper soap:fault codes

Modified:
    cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapFault.java

Modified: cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapFault.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapFault.java?rev=684918&r1=684917&r2=684918&view=diff
==============================================================================
--- cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapFault.java (original)
+++ cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapFault.java Mon
Aug 11 13:52:26 2008
@@ -148,6 +148,17 @@
 
     public static SoapFault createFault(Fault f, SoapVersion v) {
         if (f instanceof SoapFault) {
+            //make sure the fault code is per spec
+            //if it's one of our internal codes, map it to the proper soap code
+            if (f.getFaultCode().getNamespaceURI().equals(Fault.FAULT_CODE_CLIENT.getNamespaceURI()))
{
+                QName fc = f.getFaultCode();
+                if (Fault.FAULT_CODE_CLIENT.equals(fc)) {
+                    fc = v.getSender();
+                } else if (Fault.FAULT_CODE_SERVER.equals(fc)) { 
+                    fc = v.getReceiver();
+                }
+                f.setFaultCode(fc);
+            }
             return (SoapFault)f;
         }
 



Mime
View raw message