Author: samisa
Date: Sun Dec 19 06:37:59 2010
New Revision: 1050768

URL: http://svn.apache.org/viewvc?rev=1050768&view=rev
Log:
Fixed the problem of AxisFault not giving correct QName in some case. In case 
of REST, this might not make sense, but for the sake of SOAP fault 
completeness, we can set the detail - AXIS2-3520

Modified:
    
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/util/Utils.java

Modified: 
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/util/Utils.java
URL: 
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/util/Utils.java?rev=1050768&r1=1050767&r2=1050768&view=diff
==============================================================================
--- 
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/util/Utils.java 
(original)
+++ 
axis/axis2/java/core/trunk/modules/kernel/src/org/apache/axis2/util/Utils.java 
Sun Dec 19 06:37:59 2010
@@ -526,7 +526,9 @@ public class Utils {
                 // If its a REST response the content is not a SOAP envelop 
and hence we will
                 // Have use the soap body as the exception
                 if (messageContext.isDoingREST() && soapBody.getFirstElement() 
!= null) {
-                    return new 
AxisFault(soapBody.getFirstElement().toString());
+                       AxisFault fault = new 
AxisFault(soapBody.getFirstElement().toString());
+                       fault.setDetail(soapBody.getFirstElement());
+                       return fault;
                 }
 
                 // if axis2 receives an rest type fault for an soap message 
then message context
@@ -535,7 +537,9 @@ public class Utils {
                 if 
((messageContext.getProperty(Constants.Configuration.MESSAGE_TYPE) != null) &&
                         
messageContext.getProperty(Constants.Configuration.MESSAGE_TYPE).equals(HTTPConstants.MEDIA_TYPE_APPLICATION_XML)){
                      if (soapBody.getFirstElement() != null){
-                         return new 
AxisFault(soapBody.getFirstElement().toString());
+                        AxisFault fault = new 
AxisFault(soapBody.getFirstElement().toString());
+                        fault.setDetail(soapBody.getFirstElement());
+                        return fault;
                      } else {
                          return new AxisFault("application/xml type error 
received.");
                      }


Reply via email to