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 sc...@apache.org on 2007/01/24 19:49:03 UTC

svn commit: r499529 - /webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/MethodMarshallerUtils.java

Author: scheu
Date: Wed Jan 24 10:49:02 2007
New Revision: 499529

URL: http://svn.apache.org/viewvc?view=rev&rev=499529
Log:
AXIS2-1799
Contributor:Rich Scheuerle
Small change to ensure that exception marshalling complies with JAX-WS 10.2.2.3

Modified:
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/MethodMarshallerUtils.java

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/MethodMarshallerUtils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/MethodMarshallerUtils.java?view=diff&rev=499529&r1=499528&r2=499529
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/MethodMarshallerUtils.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/marshaller/impl/alt/MethodMarshallerUtils.java Wed Jan 24 10:49:02 2007
@@ -525,8 +525,14 @@
             // The reason is constructed with the getMessage of the exception.  
             // There is no detail
             WebServiceException wse = (WebServiceException) t;
+            
+            // Get the fault text using algorithm defined in JAX-WS 10.2.2.3
+            String text = wse.getMessage();
+            if (text == null || text.length() == 0) {
+                text = wse.toString();
+            }
             xmlfault = new XMLFault(null,       // Use the default XMLFaultCode
-                    new XMLFaultReason(wse.getMessage()));  // Assumes text is the language supported by the current Locale
+                    new XMLFaultReason(text));  // Assumes text is the language supported by the current Locale
         } else {
             if (log.isErrorEnabled()) {
                 log.debug("Marshal as a unchecked System Exception");
@@ -535,8 +541,13 @@
             // The reason is constructed with the toString of the exception.  
             // This places the class name of the exception in the reason
             // There is no detail.
+            // Get the fault text using algorithm defined in JAX-WS 10.2.2.3
+            String text = t.getMessage();
+            if (text == null || text.length() == 0) {
+                text = t.toString();
+            }
             xmlfault = new XMLFault(null,       // Use the default XMLFaultCode
-                    new XMLFaultReason(t.toString()));  // Assumes text is the language supported by the current Locale
+                    new XMLFaultReason(text));  // Assumes text is the language supported by the current Locale
         }
         // Add the fault to the message
         message.setXMLFault(xmlfault);



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